/* Custom styles for Liga Sports Booking */

/* Variables */
:root {
  /* Mint / Sand (default light) */
  --primary: #14b8a6;
  --primary-dark: #0d9488;
  --accent: #fbbf24;
  --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: #0ea5e9;
  --primary-dark: #0284c7;
  --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);
}

.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: #0369a1;
  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 */
.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;
}
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* Use a mint-tinted background instead of pure white */
  background: var(--modal-bg);
  width: 90%;
  max-width: 500px;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  max-height: 90vh;
  overflow-y: auto;
  /* Smooth fade and slight slide animation when modal appears */
  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,
.modal-addons {
  /* Reduce spacing between modal sections for compactness */
  margin-bottom: 0.75rem;
}
.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 */
/* Use a responsive grid so schedule options are evenly spaced and wrap naturally */
.schedule-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  /* Increase gap between schedule cards for better breathing room */
  gap: 0.75rem;
  margin-top: 0.5rem;
}
/* Responsive: single column on mobile for better readability */
@media (max-width: 480px) {
  .schedule-options {
    grid-template-columns: 1fr;
  }
}
/* Individual schedule option box */
.schedule-option {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-light);
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-dark);
  /* Animate border color and a subtle lift on hover */
  transition: border-color 0.15s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.schedule-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
.schedule-option input {
  margin-right: 0.25rem;
}
.schedule-option:hover {
  border-color: var(--primary);
}
/* Icon displayed inside schedule option */
.schedule-option .schedule-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

/* 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.75rem;
  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 styles for date selection */
.calendar {
  display: flex;
  flex-direction: column;
  margin-top: 0.5rem;
}
.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 0.75rem;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 0.25rem;
}
.calendar-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  /* Increase height for better touch targets */
  height: 40px;
  font-size: 0.9rem;
  cursor: pointer;
  position: relative;
}
.calendar-cell.empty {
  border: none;
  cursor: default;
}
.calendar-cell.full {
  /* Use a light red shade to clearly indicate full-booked dates */
  background: #fee2e2;
  color: #b91c1c;
  cursor: not-allowed;
  position: relative;
}

/* Add a small cross icon to indicate fully booked days */
.calendar-cell.full::after {
  content: '✖';
  color: #b91c1c;
  font-size: 0.85rem;
  position: absolute;
  top: 2px;
  right: 4px;
}
.calendar-cell.available:hover {
  border-color: var(--primary);
  background: var(--bg-light);
}
.calendar-cell.selected {
  background: var(--primary);
  color: #ffffff;
}

/* Grid wrapper for calendar cells */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}
.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: var(--primary);
  color: #ffffff;
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
}
footer p {
  margin: 0;
  font-size: 0.875rem;
}

/* Section container utility */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 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;
  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;
  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: #0ea5e9;
  --primary-dark: #0284c7;
  --accent: #22c55e;
  --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(34, 197, 94, 0.08), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(14, 165, 233, 0.12), 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: var(--radius);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  box-shadow: 0 14px 32px rgba(14, 165, 233, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(14, 165, 233, 0.45);
}
.btn:active {
  transform: translateY(0);
}

input,
select,
textarea {
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius);
  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(14, 165, 233, 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;
}
