/* =======================
   Global dark theme tokens
   ======================= */
:root {
  --bg: #0b0e14;
  /* page background */
  --card: #10131a;
  /* card background */
  --text: #e8eefc;
  /* primary text */
  --muted: rgba(232, 238, 252, .75);
  --border: rgba(255, 255, 255, .10);
  --border-strong: rgba(255, 255, 255, .18);
  --accent: steelblue;
  --accent-2: #d62828;
  /* red for emphasis/buttons */
  --shadow: 0 6px 18px rgba(0, 0, 0, .25);
  --radius: 0px;
  --space: 16px;
  --team1-colour: rgba(70, 130, 180, 0.35);
  --team2-colour: rgba(255, 0, 0, 0.35);
}

/* Reset-ish */
* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
}

a {
  color: var(--text);
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* =======================
     Top navigation
     ======================= */
.topnav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.2) blur(6px);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.topnav .brand {
  font-weight: 700;
  letter-spacing: .2px;
  margin-right: 4px;
  padding: 6px 10px;
  border-radius: 0;
  color: var(--text);
}

.topnav a {
  color: var(--text);
  padding: 6px 10px;
  border-radius: 0;
  opacity: .92;
  transition: background .15s ease, opacity .15s ease, transform .1s ease;
}

.topnav a:hover {
  background: rgba(255, 255, 255, .06);
  opacity: 1;
}

.topnav a.active {
  background: rgba(70, 130, 180, .22);
}

/* Dropdown navigation item (e.g. Teams) */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.nav-dropdown-arrow {
  font-size: 10px;
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.nav-dropdown:hover .nav-dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #11141e;
  border: 1px solid var(--border-strong);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  min-width: 220px;
  max-height: 420px;
  overflow-y: auto;
  z-index: 1001;
  display: none;
  padding: 6px 0;
  margin-top: 4px;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-item {
  display: block !important;
  padding: 8px 16px !important;
  color: var(--text) !important;
  font-size: 13px !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  opacity: 0.9 !important;
  transition: background 0.15s ease, color 0.15s ease !important;
}

.nav-dropdown-item:hover {
  background: rgba(70, 130, 180, 0.25) !important;
  color: #ffffff !important;
  opacity: 1 !important;
}


/* =======================
     Page layout
     ======================= */
.page-wrap {
  /*padding: 16px;*/
  margin: 0 auto;
  max-width: 2000px;
}

@media (min-width: 900px) {
  /*.page-wrap {
    padding: 24px;
  }*/
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space);
}

/* Buttons (neutral by default, flash red on hover) */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 0;
  /* match entry look */
  background: var(--card);
  /* neutral like old entry page */
  color: var(--text);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition:
    background .18s ease,
    border-color .18s ease,
    color .18s ease;
}

.btn:hover {
  background: var(--accent-2);
  /* highlight red */
  border-color: #b32626;
  /* subtle red border */
  color: #fff;
  /* readable on red */
}

/* Optional: focus ring for keyboard users */
.btn:focus {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(214, 40, 40, 0.35),
    0 0 0 4px rgba(214, 40, 40, 0.18);
}

/* If you still use a "primary" variant anywhere */
.btn-primary {
  background: var(--accent-2);
  color: #fff;
  border: 1px solid #b32626;
}

.btn-primary:hover {
  filter: brightness(1.05);
}


/* Inputs */
select,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 0;
  border: 1px solid var(--border);
  background: #0b0e14;
  color: var(--text);
  font-size: 15px;
}

label {
  display: block;
  margin: 0 0 6px;
  opacity: .9;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: visible;
}

.data-table thead th {
  position: sticky;
  top: 52px;
  z-index: 10;
  background: var(--card);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-strong);
  font-weight: 600;
  white-space: nowrap;
}

.data-table tbody td {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, .03);
}

/* Utilities */
.muted {
  color: var(--muted);
}

.space-y>*+* {
  margin-top: var(--space);
}

.space-x>*+* {
  margin-left: var(--space);
}

/* Flash messages */
.flash {
  border: 1px solid var(--border-strong);
  background: #0f1219;
  padding: 10px 12px;
  border-radius: 0;
}

/* Legacy back button hidden (use topnav) */
.back-button {
  display: none !important;
}

/* View Selectors & Toggle Buttons (Refactored) */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
  flex-wrap: wrap;
}

.btn-toggle {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0b0e14;
  color: #e8eefc;
  padding: 6px 10px;
  border-radius: 0;
  cursor: pointer;
  font-size: 14px;
}

.btn-toggle.active {
  box-shadow: 0 0 0 2px rgba(70, 130, 180, 0.35) inset;
}

.btn-toggle:focus {
  outline: 2px solid rgba(70, 130, 180, 0.6);
  outline-offset: 2px;
}

/* Info Button (reusable across site) */
.btn-info {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 0;
  background: #0b0e14;
  color: var(--muted);
  border: 1px solid rgba(147, 51, 234, 0.4);
  cursor: pointer;
  font-size: 13px;
  transition:
    background .18s ease,
    border-color .18s ease,
    color .18s ease;
}

.btn-info:hover {
  background: rgba(147, 51, 234, 0.15);
  border-color: rgba(147, 51, 234, 0.6);
  color: var(--text);
}

.btn-info:focus {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(147, 51, 234, 0.35),
    0 0 0 4px rgba(147, 51, 234, 0.18);
}

.btn-info .info-icon {
  font-weight: 700;
  font-size: 14px;
  opacity: 0.8;
}

/* Info Overlay System (reusable) */
.info-overlay {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.info-overlay-item {
  position: relative;
  background: var(--card);
  border: 1px solid rgba(147, 51, 234, 0.6);
  border-radius: 0;
  padding: 32px 24px 24px;
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  z-index: 10001;
  pointer-events: auto;
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}

.info-overlay-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  margin: 0;
}

.info-overlay-text a {
  pointer-events: auto;
  cursor: pointer;
}

.info-overlay-text img {
  max-width: 100%;
  height: auto;
  border-radius: 0;
  margin: 8px 0;
  display: block;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .info-overlay-item {
    max-width: 200px;
    padding: 10px 12px;
  }

  .info-overlay-text {
    font-size: 12px;
  }
}

/* Global Help Modal Styles */
.help-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.help-modal-content {
  background: #111827;
  border: 1px solid var(--border-2);
  border-radius: 0;
  padding: 24px;
  max-width: 520px;
  width: 90%;
  position: relative;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}