/* ============================================================
   TENNISBANE BOOKING — Light Theme
   ============================================================ */
:root {
  --clay:        #FF7A5C;
  --clay-dark:   #E05A3C;
  --clay-light:  #FF9E88;
  --bg:          #FAFAFA;
  --surface:     #FFFFFF;
  --surface2:    #F2F2F7;
  --surface3:    #E8E8F0;
  --text:        #3D3D4E;
  --text-muted:  #7A7A8C;
  --border:      #DCDCE8;
  --danger:      #C0392B;
  --success:     #27AE60;
  --booked-bg:   rgba(192,57,43,.08);
  --booked-bd:   rgba(192,57,43,.25);
  --booked-text: #B03020;
  --mine-bg:     rgba(58,110,165,.10);
  --mine-bd:     rgba(58,110,165,.30);
  --mine-text:   #2C5A90;
  --navy:        #3A6EA5;
  --blue:        #3A6EA5;
  --blue-light:  #5B8CCB;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: 'Inter', 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ── HEADER ─────────────────────────────────────────────── */
header {
  background: var(--blue);
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  letter-spacing: 3px;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-ball {
  width: 20px; height: 20px;
  background: var(--blue-light);
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.logo-ball::after {
  content: '';
  position: absolute;
  top: 50%; left: -4px;
  width: calc(100% + 8px);
  height: 2px;
  background: var(--blue);
  border-radius: 50%;
  transform: translateY(-50%) rotate(-30deg);
}

.header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.date-badge {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.15);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  color: rgba(255,255,255,.7);
  display: flex; align-items: center; gap: 6px;
}
.date-badge span { color: #fff; font-weight: 500; }
.clock-sep { color: rgba(255,255,255,.3); }
.clock-time { color: var(--clay-light); font-weight: 600; font-variant-numeric: tabular-nums; }

.user-info {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.15);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  color: #fff;
}
.user-avatar {
  width: 22px; height: 22px;
  background: var(--clay);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  color: white;
  flex-shrink: 0;
}


.legend { display: flex; gap: 14px; align-items: center; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.legend-dot   { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  padding: 8px 18px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary  { background: var(--clay); color: #fff; }
.btn-primary:hover:not(:disabled)  { background: var(--clay-dark); }
.btn-ghost    { background: transparent; color: rgba(255,255,255,.8); border: 1px solid rgba(255,255,255,.3); }
.btn-ghost:hover:not(:disabled)    { border-color: #fff; color: #fff; background: rgba(255,255,255,.08); }
/* Ghost button inside modals (light background) */
.modal .btn-ghost { color: var(--text-muted); border-color: var(--border); }
.modal .btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--text-muted); background: var(--surface2); }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled)   { background: #a93226; }
.btn-sm       { padding: 4px 10px; font-size: 12px; }
.btn-edit     { background: var(--blue); color: #fff; }
.btn-edit:hover:not(:disabled) { background: var(--blue-light); }

/* ── MAIN ────────────────────────────────────────────────── */
main { padding: 20px 24px; max-width: 1100px; margin: 0 auto; }

/* ── DAY NAV ─────────────────────────────────────────────── */
.day-nav { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.day-nav .legend { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.day-btn {
  padding: 7px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
}
.day-btn:hover  { border-color: var(--clay); color: var(--clay); }
.day-btn.active { background: var(--clay); border-color: var(--clay); color: #fff; }

/* ── QUOTA BADGE ─────────────────────────────────────────── */
.quota-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 0;
  flex-wrap: wrap;
}
.quota-badge .q-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 17px;
  letter-spacing: 1px;
  color: var(--blue);
}
.quota-badge.quota-full .q-num { color: var(--danger); }

/* ── BOOKING GRID ────────────────────────────────────────── */
.grid-wrapper {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.grid-scroll { overflow-x: auto; }

table.booking-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 400px;
}
.booking-table thead th {
  background: var(--blue);
  color: rgba(255,255,255,.8);
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.booking-table tbody tr { border-bottom: 1px solid var(--border); }
.booking-table tbody tr:last-child td { border-bottom: none; }
.booking-table tbody tr:hover td { background: var(--surface2); }

.time-cell {
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  letter-spacing: .5px;
  width: 72px;
  border-right: 2px solid var(--border);
}
.court-cell { padding: 4px 8px; height: 44px; }
.booking-table tbody tr td:nth-child(2) { border-right: 2px solid var(--border); }

.slot {
  width: 100%;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  cursor: pointer;
  transition: all .15s;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
}
.slot.available {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text-muted);
  justify-content: center;
}
.slot-time-lbl {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  width: 100%;
  text-align: center;
  transition: color .15s;
}
.slot.available.bookable:hover {
  background: var(--blue);
  border-color: var(--blue);
}
.slot.available.bookable:hover .slot-time-lbl {
  color: #F2F2F7;
}
.slot.booked-other {
  background: var(--booked-bg);
  border-color: var(--booked-bd);
  color: var(--booked-text);
  cursor: default;
}
.slot.booked-mine {
  background: rgba(58,110,165,.12);
  border-color: rgba(58,110,165,.35);
  color: #2C5A90;
}
.slot.past { opacity: .4; cursor: not-allowed; }
.slot.past:hover { background: var(--surface2); border-color: var(--border); color: var(--text-muted); }

.slot-name   { font-size: 12px; font-weight: 600; }
.slot-andel  { font-size: 10px; opacity: .6; margin-left: 5px; }

.delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: .5;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 13px;
  line-height: 1;
  transition: opacity .15s;
  flex-shrink: 0;
}
.delete-btn:hover { opacity: 1; }

.loading-row {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(3px);
  transition: opacity .2s;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 400px;
  margin: 16px;
  animation: slideUp .2s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
}
@keyframes slideUp { from { transform: translateY(20px); opacity:0; } to { transform: translateY(0); opacity:1; } }

.modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  letter-spacing: 2px;
  color: var(--blue);
  margin-bottom: 4px;
}
.modal-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }

.confirm-title { font-weight: 600; font-size: 16px; margin-bottom: 8px; }
.confirm-sub   { color: var(--text-muted); font-size: 13px; margin-bottom: 22px; }
.confirm-btns  { display: flex; gap: 10px; justify-content: center; }

/* ── FORMS ───────────────────────────────────────────────── */
.form-group  { margin-bottom: 14px; }
label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  letter-spacing: .5px;
  text-transform: uppercase;
}
input, select, textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 13px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
input:focus, select:focus { border-color: var(--clay); background: var(--surface); }
select option { background: var(--surface); }

.error-msg {
  background: rgba(192,57,43,.08);
  border: 1px solid rgba(192,57,43,.3);
  color: var(--danger);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 14px;
}
.error-msg.hidden { display: none; }

.success-msg {
  background: rgba(39,174,96,.08);
  border: 1px solid rgba(39,174,96,.3);
  color: #1a7a42;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 14px;
}
.success-msg.hidden { display: none; }

/* ── ADMIN ───────────────────────────────────────────────── */
.admin-section { margin-bottom: 32px; }
.admin-section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 19px;
  letter-spacing: 1.5px;
  color: var(--blue);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 0;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
}
.user-table th {
  background: var(--surface2);
  padding: 9px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.user-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.user-table tr:last-child td { border-bottom: none; }
.user-table tbody tr:hover td { background: var(--surface2); }

/* ── STATS ROW ───────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.stat-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 38px;
  letter-spacing: 2px;
  color: var(--blue);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ── TOAST ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 13px;
  z-index: 2000;
  max-width: 300px;
  animation: slideUp .2s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,.10);
}
.toast.hidden { display: none; }
.toast.success { border-color: var(--success); color: #1a7a42; }
.toast.error   { border-color: var(--danger);  color: var(--danger); }

/* ── ROLE BADGES ─────────────────────────────────────────── */
.hidden { display: none !important; }
.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
}
.role-admin    { background: rgba(44,78,115,.12); color: var(--blue); }
.role-member   { background: rgba(0,0,0,.06); color: var(--text-muted); }
.role-2andeler { background: rgba(52,152,219,.12); color: #1a6a99; }

/* ── SECTION TITLE (for notAdmin gate) ───────────────────── */
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 2px;
}

/* ── EDIT MODAL ──────────────────────────────────────────── */
.edit-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  margin: 16px;
  animation: slideUp .2s ease;
}


/* ── COURT SEPARATOR ─────────────────────────────────────── */
/* Both court columns equal width */
.booking-table thead th:nth-child(2),
.booking-table thead th:nth-child(3) {
  width: 50%;
}

/* Visual divider before Bane 2 column */
.booking-table thead th:nth-child(3),
.booking-table tbody tr td:nth-child(3) {
  border-left: 6px solid var(--bg);
}

/* ── RESPONSIVE TIME ─────────────────────────────────────── */
.time-short { display: none; }
.time-full  { display: inline; }

/* ── MOBILE ──────────────────────────────────────────────── */
@media (max-width: 540px) {
  .hide-xs { display: none !important; }

  header { padding: 0 10px; height: 50px; }
  .logo  { font-size: 18px; letter-spacing: 2px; }
  .logo-ball { width: 16px; height: 16px; }
  .date-badge { padding: 4px 9px; font-size: 12px; }
  .clock-sep { display: none; }
  .user-info  { padding: 4px 8px; font-size: 12px; }
  .user-avatar { width: 20px; height: 20px; font-size: 9px; }
  .btn { padding: 6px 12px; font-size: 12px; }

  main { padding: 10px 12px; }

  .day-nav { gap: 6px; margin-bottom: 12px; }
  .day-btn  { padding: 7px 14px; font-size: 12px; }

  .quota-badge { font-size: 12px; padding: 6px 10px; }
  .quota-badge .q-num { font-size: 14px; }

  .grid-wrapper { border-radius: 8px; }
  table.booking-table { min-width: 0; width: 100%; }

  .booking-table thead th {
    padding: 8px 5px;
    font-size: 10px;
    letter-spacing: 0.3px;
  }
  .booking-table thead th:first-child { width: 30px; }

  .time-cell {
    width: 30px;
    padding: 0 3px;
    font-size: 12px;
    font-weight: 700;
  }
  .time-full  { display: none; }
  .time-short { display: inline; }

  .court-cell { padding: 3px 4px; height: 40px; }

  .slot {
    height: 34px;
    padding: 0 7px;
    font-size: 11px;
    border-radius: 5px;
  }
  .slot-name  { font-size: 11px; }
  .slot-andel { font-size: 9px; }
  .delete-btn { font-size: 11px; padding: 1px 4px; }

  .stats-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-card  { padding: 12px; }
  .stat-num   { font-size: 26px; }
  .stat-label { font-size: 10px; }

  .form-row { grid-template-columns: 1fr; gap: 10px; }
  .card { padding: 14px; }

  .user-table th:nth-child(3),
  .user-table td:nth-child(3),
  .user-table th:nth-child(5),
  .user-table td:nth-child(5) { display: none; }

  .admin-section-title { font-size: 16px; }
  .modal { padding: 18px; }
  .modal-title { font-size: 20px; }

  .toast { bottom: 12px; right: 12px; left: 12px; max-width: none; }
}

@media (max-width: 380px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .user-table th:nth-child(4),
  .user-table td:nth-child(4) { display: none; }
}
