:root {
  --bg: #0f172a;
  --card: #111827;
  --muted: #334155;
  --text: #e5e7eb;
  --acc: #22d3ee;
  --good: #22c55e;
  --bad: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(120deg, #0b1220, #111827);
  color: var(--text);
}
body { 
  font-family: Arial, sans-serif; 
  background: #111827; 
  color: #e5e7eb; }

a {
  color: var(--acc);
  text-decoration: none;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

.card {
  background: rgba(17, 24, 39, .9);
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 12px;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, .35);
}

h1, h2 {
  margin: 0 0 10px 0;
}

/* Base styles for all form controls */
input,
select,
textarea,
button {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #374151;
  background: #0b1020;
  color: var(--text);
  box-sizing: border-box; /* ensures padding doesn't break width */
}

/* General button styling */
button {
  cursor: pointer;
  background: linear-gradient(135deg, #06b6d4, #22d3ee);
  color: #001016;
  font-weight: 700;
  border: none; /* overrides base border */
  margin-top:2px;
  margin-bottom: 2px;
}

/* Specific button: sublistbutton */
button.sublistbutton {
  width: 49%;       /* smaller width */
  display: block;   /* allows margin auto centering */
  /*margin: 0 auto;    centers button horizontally */

}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(80%) sepia(20%) saturate(500%) hue-rotate(180deg); 
    cursor: pointer;
}

/* Base dark style for time input */
input[type="time"] {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #374151;
  background: #0b1020;
  color: var(--text);
  box-sizing: border-box;
}

input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(80%) sepia(20%) saturate(500%) hue-rotate(180deg);
    cursor: pointer;
}

.row {
  display: grid;
  gap: 12px;
}

.grid-2 {
  grid-template-columns: 1fr 1fr;
}

.grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.muted {
  color: #94a3b8;
}

.pill {
  display: inline-block;
  padding: .25rem .6rem;
  border: 1px solid #334155;
  border-radius: 999px;
  font-size: .85rem;
  margin-top:5px;
}

.ok {
  color: #10b981;
}

.err {
  color: #ef4444;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.space {
  height: 12px;
  clear: both;
}

.right {
  text-align: right;
}

.badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: #0b1220;
  border: 1px solid #293247;
}

.request_a_sub {
  max-height:250px; 
  overflow-y:auto; 
  border:1px solid #ccc; 
  border-radius:4px; 
  margin-bottom: 10px; 
  padding-left:2px;
}

.view-btn {
    background: linear-gradient(135deg, #4f46e5, #6366f1); /* Indigo gradient */
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 3px 16px;
    font-size: 10px;
    font-weight: 300;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.16);
    transition: all 0.2s ease-in-out;
}

.view-btn:hover {
    background: linear-gradient(135deg, #6366f1, #4f46e5); /* reverse gradient on hover */
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
}

.view-btn:active {
    box-shadow: 0 3px 6px rgba(0,0,0,0.16);
}
#member-pool-scroll {
  max-height: 132px;      /* adjust as needed for 4 rows; tweak to fit pill size + spacing */
  overflow-y: auto;
  padding-right: 6px;     /* for scroll bar */
  margin-bottom: 8px;
}

.date-row {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.date-row button {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #f9f9f9;
  cursor: pointer;
}

.date-row button.active {
  background: #0077cc;
  color: white;
  font-weight: bold;
}

#other_players {
  width: 100%;
  height: 80px;
}

.players-needed-inline {
  display: flex;
  align-items: center;
  gap: 8px; /* space between label and select */
  margin-bottom: 10px;
}

.players-needed-label {
  white-space: nowrap; /* prevent wrapping */
  margin: 0;
}

.match-label {
  display: flex;
  align-items: center;
  gap: 8px;         /* spacing between label text and input */
  margin-bottom: 8px;
  white-space: nowrap; /* keep the label text on one line */
}

.match-label input {
  flex: 1;          /* lets inputs stretch to fill remaining space */
  min-width: 150px; /* ensures textbox doesn’t collapse */
}
.truncate-message {
  max-width: 200px;     /* adjust width to your layout */
  white-space: nowrap;  /* keep on one line */
  overflow: hidden;     /* hide overflow */
  text-overflow: ellipsis; /* add … */
}
.email-input {
  margin-top: 5px;
}
.logo {
    width: 170px;         /* adjust logo size if needed */
}
/* Schedule Table Styling */

.schedule-table-wrapper table {
  width: 100%;
}
.schedule-table-wrapper {
  background-clip: padding-box;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  border: 2px solid #ccc;   /* <-- outer border */
}

.table th,
.table td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #1f2937;
  position: relative;          /* for tooltips */
}

.table thead th {
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 2;
}

.table tbody tr:nth-child(odd) {
  background: rgba(255,255,255,0.02);
}

.table tbody tr:hover {
  background: rgba(255,255,255,0.08);
  transition: background 0.15s;
}

/* Booking status colors */
.available { 
  background-color: var(--good); 
  color: #001016; 
  font-weight: 600;
}
.booked { 
  background-color: var(--bad); 
  color: #001016; 
  font-weight: 600;
}
.pending { 
  background-color: var(--acc); 
  color: #001016; 
  font-weight: 600;
}

/* Tooltip */
.tooltip {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 58%;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  max-width: 300px;           /* prevent extremely wide tooltips */
  word-wrap: break-word;       /* wrap long player lists */
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Show tooltip on hover */
.table td:hover .tooltip {
  display: block;
  opacity: 1;
}

/* Position dynamically using JavaScript */
.tooltip.bottom {
  top: 100%;           /* below cell */
  left: 50%;
  transform: translateX(-50%);
}

.tooltip.top {
  bottom: 100%;        /* above cell */
  left: 50%;
  transform: translateX(-50%);
}
/* Player selection panel */
#playerSelection {
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  padding: 16px;
  margin-top: 20px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

/* Inputs for selecting players */
#playerSelection input.playerInput {
  background: #0b1020;               /* dark input */
  border: 1px solid #374151;         /* slightly lighter border */
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
  flex: 1;
  box-sizing: border-box;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}

#playerSelection input.playerInput:focus {
  border-color: var(--acc);
  box-shadow: 0 0 5px var(--acc);
}

.playerInput::placeholder {
  color: #e5e7eb; /* same as --text, or even brighter white if needed */
  opacity: 1;      /* override default opacity */
}

/* Save and Cancel buttons */
#playerSelection button {
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  margin-left: 8px;
  transition: all 0.2s;
  width: 150px;
  margin-top:20px;
}

/* Save button */
#playerSelection button.save-btn {
  background: linear-gradient(135deg, #22c55e, #10b981); /* green gradient */
  color: #001016;
}

#playerSelection button.save-btn:hover {
  background: linear-gradient(135deg, #10b981, #22c55e);
}

/* Cancel button */
#playerSelection button#cancelPlayersBtn {
  background: linear-gradient(135deg, #ef4444, #f87171); /* red gradient */
  color: #fff;
}

#playerSelection button#cancelPlayersBtn:hover {
  background: linear-gradient(135deg, #f87171, #ef4444);
}

/* Icons to edit and delete bookings */
.cell-icons {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* so clicks pass through except on icons */
}

.cell-icons i {
  font-size: 0.7em; /* about half-size */
  color: white;
  position: absolute;
  pointer-events: auto; /* re-enable click on icons */
  cursor: pointer;
}

/* Positioning */
.schedule-table-wrapper table {
  width: 100%;
  table-layout: fixed; /* lock column widths */
  border-collapse: collapse;
}

.schedule-table {
  width: 100%;
  table-layout: fixed;   /* important: makes widths obey % */
  border-collapse: collapse;
}

.schedule-table-wrapper td {
  vertical-align: middle;
  text-align: center; /* keep "Booked" centered */
  position: relative; /* so icons are positioned within this cell */
}

/* Centered text wrapper */
.schedule-table-wrapper .cell-text {
  display: inline-block;
}

/* Icons absolute in corners */
.schedule-table-wrapper td .edit-icon,
.schedule-table-wrapper td .delete-icon {
  font-size: 0.7em;
  color: white;
  position: absolute;
  cursor: pointer;
  pointer-events: auto;
}

/* Pencil top right */
.schedule-table-wrapper td .edit-icon {
  top: 4px;
  right: 4px;
}

/* X bottom right */
.schedule-table-wrapper td .delete-icon {
  bottom: 4px;
  right: 4px;
}

.schedule-table-wrapper td .edit-icon:hover,
.schedule-table-wrapper td .delete-icon:hover {
  color: #f87171;
}
