/* Custom styles for Liga Sports Booking */

/* Variables */
:root {
  /* Navy / Orange brand palette */
  --primary: #142c44;
  --primary-dark: #0e1f30;
  --accent: #f38100;
  --bg-light: #f9fafb;
  --panel: #ffffff;
  --text-dark: #374151;
  --text-light: #6b7280;
  --muted: #e5e7eb;
  --glass: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.2);
  --modal-bg: #f0fdf4;
  --shadow-soft: 0 10px 30px rgba(0,0,0,0.08);
  --skeleton-base: #e5e7eb;
  --skeleton-highlight: #f5f6f7;
}

[data-theme="midnight"] {
  --primary: #f38100;
  --primary-dark: #e07400;
  --accent: #fbbf24;
  --bg-light: #0b1221;
  --panel: #111827;
  --text-dark: #e5e7eb;
  --text-light: #9ca3af;
  --muted: #1f2937;
  --glass: rgba(17, 24, 39, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --modal-bg: #0f172a;
  --shadow-soft: 0 12px 30px rgba(0,0,0,0.35);
  --skeleton-base: #1f2937;
  --skeleton-highlight: #374151;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
}

/* Global image safety */
img {
  max-width: 100%;
  height: auto;
}

.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 14px 40px rgba(0,0,0,0.12);
}

.hero-card {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.14), rgba(14, 165, 233, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
}

.hero-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.18), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(14,165,233,0.18), transparent 45%);
  pointer-events: none;
}

.avatar-bubble {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--primary), var(--accent));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.avatar-bubble.photo {
  background-size: cover;
  background-position: center;
  color: transparent;
}

.challenge-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .challenge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.challenge-card {
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.14);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="midnight"] .challenge-card {
  background: rgba(17, 24, 39, 0.7);
  border-color: rgba(255, 255, 255, 0.12);
}

.challenge-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.22);
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--skeleton-base);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--skeleton-highlight), transparent);
  animation: shimmer 1.25s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  background: rgba(255,255,255,0.35);
  border-radius: 50%;
  width: 10px;
  height: 10px;
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.45s ease;
}

.ripple:active::after {
  transform: scale(18);
  opacity: 0.25;
}
/* Navigation */
nav {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

nav .nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
  gap: 0.5rem;
}

nav .brand {
  /* When using an image logo, the brand anchor will contain an <img> so
     we remove font settings here. The logo will control its own size. */
  font-size: 0;
  font-weight: normal;
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Logo image for brand */
.logo-img {
  height: 32px;
  width: auto;
  display: block;
}

.theme-toggle-active {
  background: var(--primary);
  color: #fff;
}

.mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--panel);
  border-top: 1px solid var(--muted);
  padding: 0.6rem 1rem;
  display: none;
  gap: 0.5rem;
  justify-content: space-between;
  z-index: 25;
}

@media (max-width: 768px) {
  .mobile-bottom-bar {
    display: flex;
  }
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  nav .nav-container {
    padding: 0.75rem;
  }
  
  nav ul li a {
    font-size: 0.85rem;
  }
}

/* Hide desktop navigation on small screens and show hamburger */
@media (max-width: 768px) {
  nav .nav-container {
    flex-wrap: wrap;
  }
  
  nav ul.desktop-links {
    display: none !important;
  }
  
  nav .hamburger {
    display: flex;
    margin-left: auto;
  }
  
  /* Mobile menu container should occupy full width on small screens */
  .mobile-menu {
    width: 100%;
    max-width: 100%;
    order: 3;
    flex-basis: 100%;
  }
}

@media (min-width: 769px) {
  nav ul.desktop-links {
    display: flex !important;
  }
  
  /* Hide hamburger and mobile menu on larger screens */
  nav .hamburger {
    display: none;
  }
  
  .mobile-menu {
    display: none !important;
  }
}

nav ul li a {
  text-decoration: none;
  color: var(--text-dark);
  font-size: 0.9rem;
  font-weight: 500;
  display: block;
  white-space: nowrap;
  transition: color 0.2s ease;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--primary-dark);
}

/* Sticky table headers */
.sticky-header th {
  position: sticky;
  top: 0;
  background: var(--bg-light);
  z-index: 1;
}

.filter-highlight {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 12px;
  transition: outline 0.3s ease;
}

.empty-state {
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px dashed var(--muted);
  background: linear-gradient(145deg, rgba(20, 184, 166, 0.06), rgba(14, 165, 233, 0.04));
  color: var(--text-light);
  text-align: center;
}

.empty-state .emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

/* Notification animations */
.notification-dropdown {
  transform-origin: top right;
  transition: opacity 160ms ease, transform 160ms ease;
  opacity: 0;
  transform: scale(0.96) translateY(-6px);
}

.notification-dropdown.active {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.notification-badge.pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 2px solid #ef4444;
  animation: badgePulse 1.1s infinite;
}

@keyframes badgePulse {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.2); opacity: 0; }
}

/* FAB */
.fab {
  position: fixed;
  right: 1rem;
  bottom: 1.25rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  box-shadow: 0 14px 30px rgba(0,0,0,0.18);
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  z-index: 30;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fab:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(0,0,0,0.22); }

.fab svg { width: 18px; height: 18px; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Timeline */
.timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  position: relative;
}

.timeline-dot.active { background: var(--primary); }

.timeline-line {
  height: 2px;
  background: var(--muted);
}

.timeline-line.active { background: var(--primary); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.chip.pending { background: #fef3c7; color: #92400e; }
.chip.accepted { background: #dcfce7; color: #166534; }
.chip.booked { background: #e0f2fe; color: #075985; }
.chip.ready { background: #ede9fe; color: #5b21b6; }

.accordion {
  border: 1px solid var(--muted);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.accordion summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 600;
  background: var(--panel);
}

.accordion[open] {
  box-shadow: var(--shadow-soft);
}

/* Mobile menu */
/* Mobile menu container. By default it is visible on small screens but
   hidden via the .hidden utility class. We avoid setting display:none
   here so toggling the hidden class works properly. */
.mobile-menu {
  background: #ffffff;
  padding: 1rem;
  border-top: 1px solid #e5e7eb;
  width: 100%;
  box-sizing: border-box;
}

/* Hide mobile menu when the hidden class is present */
.mobile-menu.hidden {
  display: none;
}

.mobile-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: block;
}

.mobile-menu ul li {
  display: block;
  border-bottom: 1px solid #e5e7eb;
}

.mobile-menu ul li:last-child {
  border-bottom: none;
}

.mobile-menu ul li a {
  display: block;
  padding: 0.75rem 0;
  text-decoration: none;
  color: var(--text-dark);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.mobile-menu ul li a:active,
.mobile-menu ul li a.active {
  color: var(--primary);
  font-weight: 600;
}

.mobile-menu ul li a:hover {
  color: var(--primary-dark);
}

/* Hamburger icon */
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.hamburger svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-dark);
  stroke-width: 2;
}

/* Hero section */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  color: #ffffff;
  padding: 4rem 1rem;
}
.hero img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.6);
}
.hero .content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}
.hero h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}
@media (min-width: 768px) {
  .hero h1 {
    font-size: 3rem;
  }
}
.hero p {
  font-size: 1rem;
  margin-bottom: 2rem;
  color: #e5e7eb;
}
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: #ffffff;
  border-radius: 0.375rem;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s ease;
}
.btn:hover {
  background: var(--primary-dark);
}

/* Disabled button state for proceed actions */
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Grid utilities */
.grid {
  display: grid;
  gap: 2rem;
}
.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Tab container styles for Class & Event page */
.tab-container {
  display: flex;
  background: #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
  width: fit-content;
}
.tab-container .tab {
  flex: 1;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}
.tab-container .tab.active {
  background: var(--primary);
  color: #ffffff;
}

/* Filter bar styling */
.filter-bar .badge {
  display: inline-block;
  background: #e0f2fe;
  color: #0e1f30;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* List container spacing */
.list-container > .card {
  margin-bottom: 1rem;
}

/* Bundle row styling */
.bundle-row {
  background: #f1f5f9;
  color: var(--text-light);
  text-align: center;
  font-size: 0.75rem;
  border-radius: 0.375rem;
  padding: 0.5rem;
}

/* Price row styling for class/event cards */
.price-row {
  font-weight: 600;
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-dark);
}
.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 767px) {
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

/* Cards */
a.card {
  text-decoration: none;
  color: inherit;
}
.card {
  background: #ffffff;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

/* --------------------------------------------
   Modal styles for booking form
   The modal overlay covers the viewport with a translucent
   background and centers the modal dialog. The dialog uses
   a rounded card design consistent with the rest of the site.
*/
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
/* Court booking modal - fixed positioning */
#bookingModal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--modal-bg);
  width: 90%;
  max-width: 500px;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0,0,0,0.06);
  z-index: 1001;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalFade 0.3s ease;
  border: 1px solid rgba(226,232,240,0.6);
}
/* History modal - flex centered within overlay */
#historyModal {
  position: relative;
  background: var(--modal-bg);
  border-radius: 0.75rem;
  z-index: 1001;
  max-height: 80vh;
  overflow-y: auto;
  animation: modalFade 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
/* Generic modal fallback */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--modal-bg);
  border-radius: 0.5rem;
  z-index: 1001;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalFade 0.3s ease;
}
.modal-content {
  position: relative;
  padding: 1.5rem;
}

/* Add spacing between date, time and add-on sections within booking modals */
.modal-date,
.modal-time {
  margin-bottom: 0.85rem;
}
.modal-date > label,
.modal-time > label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.3rem;
  padding: 0.25rem 0;
  letter-spacing: -0.01em;
}
.modal-addons {
  margin-bottom: 0.4rem;
}
.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-light);
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  cursor: pointer;
}
.modal-content h2 {
  margin-top: 0;
}

/* Input with icon wrapper */
.input-icon-wrapper {
  position: relative;
}
.input-icon-wrapper input[type="date"] {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.9rem;
  color: var(--text-dark);
  background: #ffffff;
}
.input-icon {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  opacity: 0.6;
}

/* Schedule options in modal */
.schedule-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}
@media (max-width: 374px) {
  .schedule-options {
    grid-template-columns: 1fr;
  }
}
/* ============================================
   SCHEDULE SLOTS — Premium time picker
   ============================================ */
.schedule-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: #334155;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: visible;
  min-width: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

/* Animated left accent bar */
.schedule-option::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #142c44, #1a3a5c);
  border-radius: 14px 0 0 14px;
  opacity: 0;
  transition: opacity 0.25s ease, width 0.25s ease;
}

/* Subtle shimmer on slot */
.schedule-option::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(14,165,233,0.04), transparent);
  transition: left 0.6s ease;
  pointer-events: none;
}

.schedule-option:hover {
  border-color: #142c44;
  background: linear-gradient(135deg, #f0f9ff, #ecfeff);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.12), 0 2px 6px rgba(0,0,0,0.04);
}
.schedule-option:hover::before {
  opacity: 1;
}
.schedule-option:hover::after {
  left: 100%;
}

/* Checked state */
.schedule-option:has(input:checked) {
  border-color: #142c44;
  background: linear-gradient(135deg, #e0f7ff 0%, #ecfeff 40%, #f0fdf4 100%);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.18), 0 0 0 2px rgba(14, 165, 233, 0.06);
}
.schedule-option:has(input:checked)::before {
  opacity: 1;
  width: 5px;
  background: linear-gradient(180deg, #142c44, #f38100);
}

/* Custom checkbox */
.schedule-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.schedule-option input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #142c44, #1a3a5c);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
  transform: scale(1.05);
}
.schedule-option input[type="checkbox"]:checked::after {
  content: '✓';
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

/* Booked slot X mark */
.slot-x-mark {
  width: 20px;
  height: 20px;
  border: 2px solid #fca5a5;
  border-radius: 6px;
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  flex-shrink: 0;
  display: grid;
  place-content: center;
  color: #b91c1c;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.schedule-option .schedule-icon {
  width: 18px;
  height: 18px;
  opacity: 0.5;
  display: none;
}

/* Booked slot styling */
.schedule-option.slot-booked {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-color: #e2e8f0;
}
.schedule-option.slot-booked:hover {
  transform: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  border-color: #e2e8f0;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

/* Add-on list in modal */
.modal-addons .addon-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.addon-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  background: var(--bg-light);
  font-size: 0.9rem;
}
.addon-item:hover {
  border-color: var(--primary);
}
.addon-icon {
  width: 20px;
  height: 20px;
  opacity: 0.8;
}
.addon-price {
  margin-left: auto;
  color: var(--text-light);
  font-size: 0.8rem;
}

/* Modal summary section */
.modal-summary {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  white-space: pre-line;
  color: var(--text-dark);
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .modal {
    width: 95%;
    max-width: 95%;
  }
}

/* ============================================
   CALENDAR — Premium date picker
   ============================================ */
.calendar {
  display: flex;
  flex-direction: column;
  margin-top: 0.5rem;
}

.calendar-title {
  position: relative;
  padding-bottom: 0.6rem;
}
.calendar-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 25%;
  right: 25%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #142c44, #f38100, transparent);
  border-radius: 2px;
}

.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 0.4rem;
  letter-spacing: 0.08em;
}
.calendar-header div {
  padding: 0.35rem 0;
}
/* Weekend headers highlight */
.calendar-header div:nth-child(6) { color: #142c44; }
.calendar-header div:nth-child(7) { color: #f43f5e; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.3rem;
  padding: 0.25rem;
}

.calendar-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  background: #f8fafc;
  aspect-ratio: 1 / 1.15;
  width: 100%;
  margin: 0 auto;
  font-size: clamp(0.65rem, 2.5vw, 0.85rem);
  overflow: hidden;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  position: relative;
  border-radius: 14px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 1px;
  padding: 2px 0;
}

.cal-day {
  line-height: 1;
  font-weight: 600;
  transition: transform 0.2s ease;
}

.cal-price {
  font-size: clamp(0.38rem, 1.3vw, 0.52rem);
  font-weight: 700;
  color: #142c44;
  line-height: 1;
  opacity: 0.9;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.cal-price.promo {
  color: #f59e0b;
  animation: promoPulse 2s ease-in-out infinite;
}
@keyframes promoPulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 1; transform: scale(1.05); }
}
.calendar-cell.selected .cal-price {
  color: #ffffff;
}
.calendar-cell.full .cal-price {
  color: #ef4444;
  opacity: 0.4;
}

/* Empty cells */
.calendar-cell.empty {
  background: transparent;
  border: none;
  cursor: default;
}

/* Weekend cells subtle tint */
.calendar-grid .calendar-cell.available:nth-child(7n+6) {
  background: #f0f9ff;
}
.calendar-grid .calendar-cell.available:nth-child(7n) {
  background: #fff1f2;
}

/* Today: pulsing ring */
.calendar-cell.today {
  border-color: #142c44;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15);
  animation: todayGlow 3s ease-in-out infinite;
}
@keyframes todayGlow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.12); }
  50% { box-shadow: 0 0 0 5px rgba(14, 165, 233, 0.08); }
}

/* Hover */
.calendar-cell.available:hover {
  border-color: #142c44;
  background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
  color: #0e1f30;
  transform: scale(1.12);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.18);
}
.calendar-cell.available:hover .cal-day {
  transform: scale(1.05);
}

/* Selected: vivid gradient + glow ring */
.calendar-cell.selected {
  background: linear-gradient(135deg, #142c44 0%, #1a3a5c 40%, #f38100 100%);
  color: #ffffff;
  font-weight: 700;
  border-color: transparent;
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.35), 0 0 0 3px rgba(14, 165, 233, 0.12);
  transform: scale(1.13);
  z-index: 2;
}
.calendar-cell.selected .cal-day {
  text-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* Full/Closed */
.calendar-cell.full {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #ef4444;
  cursor: not-allowed;
  position: relative;
  text-decoration: line-through;
  opacity: 0.65;
}
.calendar-cell.full::after {
  content: '';
}

/* Event */
.calendar-cell.event {
  background: linear-gradient(135deg, #f38100, #7c3aed, #6d28d9);
  color: #fff;
  cursor: default;
  opacity: 0.95;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.25);
}
.calendar-cell.event .cal-day {
  color: #fff;
}
.calendar-cell.event .cal-price,
.calendar-cell.event .event-label {
  color: #e9d5ff;
  opacity: 1;
  font-size: 0.65rem;
}
.card img {
  width: 100%;
  height: 10rem;
  object-fit: cover;
}
.card .card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card .card-body h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
}
.card .card-body p {
  flex: 1;
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-light);
}
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
}
.badge-success {
  background: #f0fdfa;
  color: #047857;
}
.badge-warning {
  background: #fefce8;
  color: #92400e;
}
.badge-danger {
  background: #fef2f2;
  color: #b91c1c;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}
table thead {
  background: var(--primary);
  color: #ffffff;
}
table th,
table td {
  padding: 0.75rem;
  text-align: left;
}
table tbody tr:nth-child(even) {
  background: #f3f4f6;
}
table tbody tr:hover {
  background: #e5e7eb;
}

/* Forms */
form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}
form input,
form select,
form textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  box-sizing: border-box;
}
form button {
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
form button:hover {
  background: var(--primary-dark);
}

/* Footer */
footer {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #e2e8f0;
  padding: 3rem 1.5rem 0;
  margin-top: 3rem;
}
footer p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
}
.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 0.8fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-brand .footer-tagline {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.5;
}
.footer-contact h4,
.footer-links h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0 0 1rem;
  font-weight: 700;
  color: #fff;
}
.footer-contact p {
  font-size: 0.85rem;
  margin: 0.5rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: #cbd5e1;
  line-height: 1.5;
}
.footer-contact p span {
  flex-shrink: 0;
  width: 1.2em;
  text-align: center;
}
.footer-contact a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-contact a:hover {
  color: #fff;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s, padding-left 0.2s;
}
.footer-links a:hover {
  color: #fff;
  padding-left: 4px;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  padding: 1.25rem 0;
}
.footer-bottom p {
  font-size: 0.8rem;
  color: #64748b;
}
@media (max-width: 768px) {
  footer {
    padding: 2.5rem 1.25rem 0;
  }
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  .footer-contact p {
    justify-content: center;
  }
  .footer-links {
    align-items: center;
  }
}

/* Section container utility */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

/* Login page */
.auth-page {
  min-height: calc(100vh - 210px);
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0fdf4 100%);
}

.auth-shell {
  width: 100%;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}

.auth-intro h1 {
  font-size: 2.6rem;
  margin: 0.35rem 0 0.8rem;
  line-height: 1.15;
  background: linear-gradient(135deg, #0a1a2e, #142c44);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-wave {
  display: inline-block;
  animation: wave 1.8s ease-in-out infinite;
  transform-origin: 70% 70%;
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-8deg); }
  40% { transform: rotate(14deg); }
  50% { transform: rotate(-4deg); }
  60% { transform: rotate(10deg); }
  70% { transform: rotate(0deg); }
}

.auth-eyebrow {
  margin: 0;
  color: var(--primary-dark);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.auth-subtitle {
  margin: 0;
  color: var(--text-light);
  max-width: 52ch;
  font-size: 0.95rem;
  line-height: 1.5;
}

.auth-benefits {
  margin: 1.1rem 0 0;
  padding-left: 0;
  list-style: none;
  color: var(--text-dark);
  display: grid;
  gap: 0.55rem;
  font-size: 0.9rem;
}

.auth-card {
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

.auth-card .card-body {
  padding: 1.75rem;
}

.auth-card h2 {
  margin: 0 0 1.25rem;
  font-size: 1.2rem;
  color: #1e293b;
}

.auth-field {
  margin-bottom: 1rem;
}

.auth-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.35rem;
}

.auth-field input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-size: 0.92rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #f9fafb;
  box-sizing: border-box;
}

.auth-field input:focus {
  outline: none;
  border-color: #142c44;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
  background: #fff;
}

.auth-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  background: linear-gradient(135deg, #142c44, #0e1f30);
  border: none;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 1rem 0 0.75rem;
  color: #9ca3af;
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.auth-divider span {
  padding: 0 0.75rem;
}

.auth-success {
  color: var(--primary);
  margin-top: 0.85rem;
}

.auth-info {
  color: var(--text-light);
  margin-top: 0.7rem;
}

.auth-error {
  color: #dc2626;
  margin-top: 0.85rem;
}

.auth-register-text {
  margin-top: 0;
  font-size: 0.88rem;
  color: var(--text-light);
  text-align: center;
}

.auth-register-text a {
  color: var(--primary-dark);
  font-weight: 600;
}

.auth-footer {
  margin-top: 0;
  padding: 1.1rem 1rem;
  text-align: center;
}

@media (max-width: 960px) {
  .auth-shell {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .auth-intro h1 {
    font-size: 2.2rem;
  }

  .auth-intro {
    text-align: center;
  }

  .auth-benefits {
    justify-items: center;
  }
}

@media (max-width: 640px) {
  .auth-page {
    min-height: auto;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .auth-intro h1 {
    font-size: 1.8rem;
  }

  .auth-card .card-body {
    padding: 1.25rem;
  }

  .auth-field input {
    padding: 0.65rem 0.75rem;
    font-size: 1rem;
  }

  .auth-submit {
    padding: 0.8rem;
    font-size: 1rem;
  }
}

/* Utility: hide elements */
.hidden {
  display: none !important;
}

/* History page custom styling */
.history-section {
  margin-top: 2rem;
}
.history-section h2 {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  color: var(--text-dark);
}
/* Card for each history entry */
.history-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.history-card:hover {
  border-color: var(--primary);
}
.history-card img.history-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

/* Medal icons used in league tables */
.medal-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 0.25rem;
}
.history-info {
  flex: 1;
}
.history-info h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-dark);
}
.history-info p {
  margin: 0.25rem 0;
  font-size: 0.85rem;
  color: var(--text-light);
  white-space: pre-line;
}
.history-info small {
  color: var(--text-light);
  font-size: 0.75rem;
}

/*
 * Fade-in up animation for cards and history entries. This subtle animation
 * gives the interface a modern, polished feel when elements first appear on
 * the page. It uses a small vertical offset and fades from transparent to
 * opaque. To stagger animations naturally, delays can be applied inline via
 * the style attribute.
 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/*
 * Player statistics styling.
 * Presents rank, wins and matches with small icons in a row below the player name.
 */
.player-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-dark);
}
.player-stats img {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

/* Apply the fadeInUp animation to cards and history entries */
.card,
.history-card {
  animation: fadeInUp 0.6s ease both;
}

/* Modal for history details */
#historyModal .modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
#historyModal .modal-content h2 {
  margin-bottom: 1rem;
}
#historyModal .modal-content p {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  white-space: pre-line;
}
#historyModal .modal-content img {
  width: 200px;
  height: 200px;
  max-width: 100%;
  object-fit: contain;
  margin-bottom: 1rem;
}

/* Ensure event booking modal schedule options take full width for clarity */
#eventBookingModal .schedule-options {
  /* Display each schedule on its own row with extra vertical spacing */
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

/*
 * QR code container styling.
 * Provides a subtle background and padding so the QR code stands out and
 * aligns with the overall color palette. It also constrains the size of the
 * QR image for consistency across pages (payment success and history).
 */
.qr-container {
  display: inline-block;
  padding: 1rem;
  border-radius: 0.5rem;
  background: #ecfeff; /* very light blue to frame the QR code */
  border: 1px solid #bae6fd; /* soft border */
}
.qr-container img {
  width: 220px;
  height: 220px;
  max-width: 100%;
  object-fit: contain;
}

/* Animation for modal fade-in */
@keyframes modalFade {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* --------------------------------------------------------------------
 * Loader overlay styling
 * Shows a semi-transparent full-screen overlay with a spinning padel ball.
 * Used when the user triggers an action that takes a moment, like
 * proceeding to payment. The loader uses an existing ball icon
 * and rotates it continuously. A short message appears below the icon.
 */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.loader-overlay.hidden {
  display: none;
}
.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.loader img {
  width: 60px;
  height: 60px;
  margin-bottom: 0.5rem;
  animation: spinBall 1s linear infinite;
}
.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--muted);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spinBall 0.9s linear infinite;
  margin-bottom: 0.75rem;
}
.loader p {
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
}
@keyframes spinBall {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* --- Modern theme refresh overrides --- */
:root {
  --primary: #142c44;
  --primary-dark: #0e1f30;
  --accent: #f38100;
  --bg-light: #f7fbff;
  --text-dark: #0f172a;
  --text-light: #64748b;
  --card-bg: #ffffff;
  --surface: #e2e8f0;
  --modal-bg: #f1f5f9;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  --radius: 16px;
  --radius-lg: 22px;
}

body {
  background: radial-gradient(circle at 10% 20%, rgba(243, 129, 0, 0.06), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(20, 44, 68, 0.08), transparent 30%),
    var(--bg-light);
  color: var(--text-dark);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.card {
  background: var(--card-bg);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.16);
}

.btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  box-shadow: 0 4px 12px rgba(20, 44, 68, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(20, 44, 68, 0.35);
}
.btn:active {
  transform: translateY(0);
}

input,
select,
textarea {
  padding: 0.7rem 0.8rem;
  border-radius: 0.5rem;
  border: 1px solid #d4d7dd;
  font-size: 0.95rem;
  box-sizing: border-box;
  background: #fff;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 44, 68, 0.18);
}

.modal-content {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow) !important;
  background: var(--modal-bg) !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
}

/* ============================================
   MOBILE RESPONSIVE FIXES
   ============================================ */

/* --- Generic modal mobile --- */
@media (max-width: 480px) {
  .modal {
    width: 95% !important;
    max-width: 95% !important;
    padding: 0;
  }
  .modal-content {
    padding: 1rem !important;
  }
  #bookingModal {
    width: 95% !important;
    max-width: 95% !important;
  }
}

/* --- Calendar responsive --- */
@media (max-width: 420px) {
  .calendar-cell {
    border-radius: 12px;
    border-width: 1.5px;
  }
  .calendar-grid {
    gap: 2px;
    padding: 2px;
  }
  .calendar-header {
    font-size: 0.6rem;
  }
}

@media (max-width: 374px) {
  .calendar-cell {
    border-radius: 10px;
    gap: 0;
    padding: 1px 0;
  }
  .calendar-grid {
    gap: 1px;
    padding: 1px;
  }
  .calendar-header {
    font-size: 0.55rem;
  }
}

/* --- Notification dropdown mobile --- */
@media (max-width: 768px) {
  .notification-dropdown {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 75vh !important;
    border-radius: 1rem 1rem 0 0 !important;
    transform-origin: bottom center !important;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.15) !important;
    z-index: 9999 !important;
  }
  .notification-dropdown.active {
    transform: scale(1) translateY(0) !important;
  }
  .notification-dropdown .actions button {
    font-size: 0.85rem !important;
    padding: 0.5rem 0.85rem !important;
    min-height: 36px;
  }
  .notification-dropdown li {
    padding: 0.85rem 1rem !important;
  }
}

/* --- Ranking table responsive --- */
@media (max-width: 600px) {
  .ranking-table th,
  .ranking-table td {
    padding: 0.4rem 0.35rem;
    font-size: 0.75rem;
  }
  .ranking-table .avatar-bubble {
    width: 32px;
    height: 32px;
    font-size: 0.7rem;
  }
}

/* --- Dashboard header mobile --- */
@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .dashboard-header > .glass-card {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* --- Ranking controls mobile --- */
@media (max-width: 600px) {
  #rankingControls {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }
  #rankingControls > div {
    flex-wrap: wrap !important;
  }
  #rankingControls input[type="text"] {
    min-width: 0 !important;
    width: 100% !important;
  }
  #rankingControls select {
    width: 100%;
  }
}

/* --- Challenge filter buttons mobile --- */
@media (max-width: 480px) {
  #challengeFilters {
    gap: 0.35rem !important;
  }
  #challengeFilters .btn {
    padding: 0.45rem 0.65rem !important;
    font-size: 0.78rem !important;
    min-height: 36px;
  }
}

/* --- League toggle buttons mobile --- */
@media (max-width: 480px) {
  .league-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .league-toggle button {
    padding: 0.45rem 0.65rem !important;
    font-size: 0.78rem !important;
    min-height: 36px;
  }
}

/* --- QR container responsive --- */
@media (max-width: 360px) {
  .qr-container img {
    width: 180px;
    height: 180px;
  }
}

/* --- Section padding mobile --- */
@media (max-width: 480px) {
  .section {
    padding: 1.5rem 0.75rem;
  }
}

/* --- History card mobile --- */
@media (max-width: 480px) {
  .history-card {
    padding: 0.75rem;
    gap: 0.75rem;
  }
  .history-card img.history-icon {
    width: 32px;
    height: 32px;
  }
  .history-info h3 {
    font-size: 0.95rem;
  }
}

/* --- League booking card mobile --- */
@media (max-width: 480px) {
  #leagueBookingCard .card-body > div:first-child {
    min-width: 0 !important;
  }
}

/* --- League modal date/hour grid mobile --- */
@media (max-width: 420px) {
  .league-form [style*="grid-template-columns:2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* --- Grid cols on small screens --- */
@media (max-width: 480px) {
  .grid {
    gap: 1rem;
  }
}

/* --- Form inline grids on register page --- */
@media (max-width: 420px) {
  .form-row-2col {
    grid-template-columns: 1fr !important;
  }
}

/* --- Touch-friendly minimum sizes --- */
@media (max-width: 768px) {
  nav ul li a {
    min-height: 40px;
    display: flex;
    align-items: center;
  }
}

/* --- Prevent horizontal overflow globally --- */
html, body {
  overflow-x: hidden;
}
main {
  overflow-x: hidden;
}

/* --- Coach modal responsive --- */
@media (max-width: 480px) {
  #coachModal .modal-content {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 1rem 1rem 0 0 !important;
    max-height: 95vh !important;
  }
  #coachProfileModal .modal-content {
    max-width: 95% !important;
    width: 95% !important;
  }
  #sessionTypeCards {
    grid-template-columns: 1fr !important;
  }
  #coachGrid {
    grid-template-columns: 1fr !important;
  }
}

/* --- Active matches grid on tiny screens --- */
@media (max-width: 480px) {
  .grid-cols-2#activeMatchesList,
  #activeMatchesList.grid-cols-2 {
    grid-template-columns: 1fr;
  }
}

/* --- Upcoming matches section mobile --- */
@media (max-width: 480px) {
  #upcomingMatchesList {
    padding: 0.5rem !important;
    font-size: 0.85rem;
  }
}

/* --- Schedule option touch targets --- */
@media (max-width: 480px) {
  .schedule-option {
    padding: 0.45rem 0.4rem;
    font-size: 0.72rem;
    min-height: 40px;
    gap: 0.3rem;
    border-radius: 10px;
    border-width: 1.5px;
  }
  .schedule-option input[type="checkbox"],
  .schedule-option .slot-x-mark {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    font-size: 10px;
    border-width: 1.5px;
  }
}

@media (max-width: 374px) {
  .schedule-option {
    padding: 0.4rem 0.35rem;
    font-size: 0.68rem;
    gap: 0.25rem;
  }
  .schedule-option input[type="checkbox"],
  .schedule-option .slot-x-mark {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    font-size: 9px;
  }
}

/* --- Lightbox responsive --- */
@media (max-width: 480px) {
  #evidenceLightboxImg {
    max-width: 96vw !important;
    max-height: 80vh !important;
    border-radius: 0.5rem !important;
  }
}

/* --- Value package grid mobile --- */
@media (max-width: 480px) {
  .vp-grid {
    grid-template-columns: 1fr !important;
  }
}

/* --- League date/hour grid stacking --- */
@media (max-width: 420px) {
  .league-date-grid {
    grid-template-columns: 1fr !important;
  }
}

/* --- League booking card min-width fix --- */
@media (max-width: 480px) {
  #leagueBookingCard [style*="min-width:200px"] {
    min-width: 0 !important;
  }
}

/* --- Reward section mobile --- */
@media (max-width: 480px) {
  .reward-section {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
    gap: 0.75rem;
  }
  .points-display {
    font-size: 2rem;
  }
}

/* --- Court cards grid mobile fix --- */
@media (max-width: 480px) {
  #courtCards.grid-cols-2 {
    grid-template-columns: 1fr;
  }
}
