body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f7fb;
  color: #212529;
}

/* Navbar */
.navbar {
  margin-bottom: 1rem;
  background-color: #0057b7; /* Padel court blue (fallback) */
  /* Remove default horizontal padding so the color spans edge to edge */
  --bs-navbar-padding-x: 0;
}
/* Ensure contrast when Bootstrap sets bg-body-tertiary on the navbar */
.navbar.bg-body-tertiary {
  background-color: #0057b7 !important;
}
.navbar .navbar-brand,
.navbar .nav-link {
  color: #fff !important;
}
.navbar .nav-link:hover {
  opacity: 0.85;
}
/* Make toggler visible on blue background */
.navbar .navbar-toggler {
  border-color: rgba(255,255,255,0.35);
}
.navbar .navbar-toggler-icon {
  filter: invert(1) brightness(2);
}

/* Containers */
.container {
  max-width: 960px;
}

/* Tables */
.table th,
.table td {
  vertical-align: middle;
}
.table-hover tbody tr:hover {
  background-color: #f1f9ff;
}

/* Buttons */
.btn {
  border-radius: 0.375rem;
}
.btn-primary {
  background-color: #0057b7;
  border-color: #0057b7;
}
.btn-primary:hover {
  background-color: #004999;
  border-color: #004999;
}
.btn-warning {
  color: #000;
}

/* Outlines (light) */
.btn-outline-secondary {
  color: #495057;
  border-color: #ced4da;
}
.btn-outline-secondary:hover {
  color: #212529;
  background-color: #e9ecef;
  border-color: #ced4da;
}

/* Forms (light) */
.form-label {
  font-weight: 600;
}
.form-text {
  color: #6c757d;
}
.form-control,
.form-select,
.input-group-text {
  border-radius: 0.5rem;
}

/* Cards / Surfaces (light) */
.card {
  border-radius: 0.75rem;
  border: 1px solid rgba(0,0,0,0.06);
  background-color: #fff;
}

/* Hero banner */
.hero {
  background: radial-gradient(1200px 500px at -10% -10%, #2a7be4 0%, #0057b7 40%, #004999 100%);
  color: #fff;
}

/* Feature cards subtle hover */
.feature-card {
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  border: 1px solid rgba(0,0,0,0.05);
}
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.08);
}

/* Share CTA */
.share-card {
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.share-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.18);
}

/* Links */
a {
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* =============================== */
/*            DARK MODE            */
/* =============================== */

:root[data-bs-theme="dark"] body {
  background-color: #0f172a; /* slate-900 */
  color: #e5e7eb;           /* zinc-200 */
}

/* Bootstrap surface tokens */
:root[data-bs-theme="dark"] .bg-body,
:root[data-bs-theme="dark"] .modal-content {
  background-color: #0f172a !important;
  color: #e5e7eb !important;
}
:root[data-bs-theme="dark"] .bg-body-tertiary {
  background-color: #111827 !important; /* gray-900 */
  color: #e5e7eb !important;
}

/* ✅ Force any hardcoded .bg-white to become a dark surface */
:root[data-bs-theme="dark"] .bg-white {
  background-color: #111827 !important; /* gray-900 */
  color: #e5e7eb !important;
}

/* Navbar stays brand blue; make links readable */
:root[data-bs-theme="dark"] .navbar,
:root[data-bs-theme="dark"] .navbar.bg-body-tertiary {
  background-color: #0057b7 !important;
}
:root[data-bs-theme="dark"] .navbar .navbar-brand,
:root[data-bs-theme="dark"] .navbar .nav-link {
  color: #ffffff !important;
}

/* Cards / list group / modals */
:root[data-bs-theme="dark"] .card,
:root[data-bs-theme="dark"] .list-group-item,
:root[data-bs-theme="dark"] .modal-content {
  background-color: #111827; /* gray-900 */
  color: #e5e7eb;
  border: 1px solid rgba(255,255,255,0.06);
}
:root[data-bs-theme="dark"] .list-group-item + .list-group-item {
  border-top-color: rgba(255,255,255,0.06);
}

/* Tables */
:root[data-bs-theme="dark"] .table {
  color: #e5e7eb;
}
:root[data-bs-theme="dark"] .table thead th {
  background-color: #0b1220; /* deeper header */
  color: #e5e7eb;
  border-bottom-color: rgba(255,255,255,0.12);
}
:root[data-bs-theme="dark"] .table tbody tr {
  background-color: #111827;
}
:root[data-bs-theme="dark"] .table-hover tbody tr:hover {
  background-color: #1f2937; /* gray-800 */
}
:root[data-bs-theme="dark"] .table td,
:root[data-bs-theme="dark"] .table th {
  border-color: rgba(255,255,255,0.08);
}

/* Forms */
:root[data-bs-theme="dark"] .form-label {
  color: #e5e7eb;
}
:root[data-bs-theme="dark"] .form-text,
:root[data-bs-theme="dark"] .text-muted {
  color: #cbd5e1 !important; /* slate-300 */
}
:root[data-bs-theme="dark"] .form-control,
:root[data-bs-theme="dark"] .form-select {
  background-color: #0b1220;      /* dark input surface */
  color: #e5e7eb;
  border-color: #1f2937;
}
:root[data-bs-theme="dark"] .form-control:focus,
:root[data-bs-theme="dark"] .form-select:focus {
  background-color: #0b1220;
  color: #ffffff;
  border-color: #2563eb;          /* blue focus ring */
  box-shadow: 0 0 0 .25rem rgba(37, 99, 235, 0.25);
}
:root[data-bs-theme="dark"] .input-group-text {
  background-color: #0b1220;
  color: #e5e7eb;
  border-color: #1f2937;
}
:root[data-bs-theme="dark"] ::placeholder {
  color: #94a3b8; /* slate-400 */
}

/* Buttons */
:root[data-bs-theme="dark"] .btn-primary {
  background-color: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
:root[data-bs-theme="dark"] .btn-primary:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
}
:root[data-bs-theme="dark"] .btn-outline-secondary {
  color: #e5e7eb;
  border-color: #334155; /* slate-700 */
}
:root[data-bs-theme="dark"] .btn-outline-secondary:hover {
  color: #0f172a;
  background-color: #e5e7eb;
  border-color: #e5e7eb;
}

/* Feature cards—make them pop in dark mode */
:root[data-bs-theme="dark"] .feature-card {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
  border: 0;
}
:root[data-bs-theme="dark"] .feature-card .text-muted {
  color: rgba(255,255,255,0.85) !important;
}
:root[data-bs-theme="dark"] .feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.75rem 1.25rem rgba(37, 99, 235, 0.25);
}

/* Share card—align with dark surfaces and legible text */
:root[data-bs-theme="dark"] .share-card {
  background-color: #1f2937 !important; /* gray-800 */
  color: #f9fafb;
  border: 1px solid rgba(255,255,255,0.06);
}
:root[data-bs-theme="dark"] .share-card h3,
:root[data-bs-theme="dark"] .share-card p {
  color: #f9fafb !important;
}

/* Dropdowns / menus */
:root[data-bs-theme="dark"] .dropdown-menu {
  background-color: #0b1220;
  color: #e5e7eb;
  border-color: #1f2937;
}
:root[data-bs-theme="dark"] .dropdown-item {
  color: #e5e7eb;
}
:root[data-bs-theme="dark"] .dropdown-item:hover,
:root[data-bs-theme="dark"] .dropdown-item:focus {
  background-color: #1f2937;
  color: #fff;
}

/* Alerts (if used) */
:root[data-bs-theme="dark"] .alert {
  border-color: rgba(255,255,255,0.12);
}

/* === Fix: Score input fields on mobile === */
input[name="home_g"],
input[name="away_g"] {
  min-width: 3.5rem;
  text-align: center;
}

/* === Fix: Mobile navbar — collapsed panel matches navbar background === */
@media (max-width: 991.98px) {
  .navbar .container,
  .navbar .container-fluid {
    padding-left: 0;
    padding-right: 0;
  }
  .navbar .navbar-collapse {
    background-color: inherit;
  }
}
