/* ========================================
   WrestleDelaware — Finder (Upgraded Version)
   ======================================== */

/* Core color tokens */
:root {
  --bg: #0b0f17;
  --card: #121826;
  --line: #1f2937;
  --muted: #9fb0c9;
  --blue: #0f4ccf;
  --blue-dark: #0a38a0;
  --chip-bg: #0f1c33;
  --chip-border: #2d4a78;
  --text-light: #ffffff;
}

/* Light mode overrides */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #eef3ff;
    --card: #ffffff;
    --line: #cdd8f1;
    --muted: #50607a;
    --chip-bg: #f3f6ff;
    --chip-border: #b8c9e8;
    --text-light: #0b1b32;
  }
}

body {
  background: var(--bg);
  color: var(--text-light);
  font-family: system-ui, sans-serif;
}

/* =======================
   FILTER CARD
   ======================= */
.filters-card {
  background: #0a3a88;
  border: 1px solid #1e4ea3;
}

.filters-card .form-label {
  color: #ffffff;
  font-weight: 600;
}

.filters-card .form-select,
.filters-card .form-control {
  background: #0f2e66;
  border: 1px solid #3a66c7;
  color: #ffffff;
}

.filters-card .form-select option {
  background: #ffffff;
  color: #111;
}

/* =======================
   FINDER TABLE
   ======================= */
#wrestlersTable a.view-wrestler {
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

#wrestlersTable a.view-wrestler:hover {
  color: var(--blue-dark);
}

/* Start hint */
#startHint {
  font-size: 0.85rem;
}

/* =======================
   CHIPS
   ======================= */
.chip {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text-light);
  border: 1px solid var(--chip-border);
  font-size: 0.85rem;
}

/* =======================
   KPI BLOCKS
   ======================= */
.kpi {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.kpi .label {
  color: var(--muted);
  font-size: 0.75rem;
}

.kpi .value {
  font-size: 1.2rem;
  font-weight: 700;
}

/* =======================
   MODAL CORE
   ======================= */
.modal-content {
  background: var(--card);
  color: var(--text-light);
  border: 1px solid var(--line);
  border-radius: 1rem;
}
/* Ensure modal text is light on dark */
.modal-content {
  color: var(--text-light);
}

/* Muted / secondary text inside modal */
.modal-content .text-muted,
.modal-content .kpi .label,
.modal-content .career-line {
  color: var(--muted) !important;
}

.modal-header,
.modal-footer {
  border-color: var(--line) !important;
}

.modal-title {
  font-weight: 700;
}
/* Make all modal links readable in dark mode */
.modal-content a {
  color: var(--blue);
  text-decoration: none;
}

.modal-content a:hover {
  color: var(--blue-dark);
  text-decoration: underline;
}

/* Default: NO underline for any wrestler */
.wrestler-link {
  text-decoration: none;
}

/* UNDERLINE only Delaware wrestlers (from rankings.csv) */
.delaware-link {
  text-decoration: underline;
}


/* =======================
   SEASON TABS (Flo-style)
   ======================= */
.season-tabs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
  margin-bottom: 1rem;
}

.season-tab {
  padding: 0.25rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--blue);
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-size: 0.85rem;
  transition: 0.15s;
}

.season-tab.active {
  background: var(--blue);
  color: #ffffff;
}

.season-tab:hover {
  background: var(--blue-dark);
  color: #ffffff;
}

/* =======================
   HIGHLIGHT VIDEO SECTION
   ======================= */
.highlight-btn {
  background: var(--blue);
  color: #ffffff;
  border: none;
  padding: 0.45rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: 0.2s;
}

.highlight-btn:hover {
  background: var(--blue-dark);
}

#highlightVideoPanel {
  margin-top: 0.8rem;
  display: none; /* JS toggles */
  animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.video-container {
  width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.video-container iframe {
  width: 100%;
  height: 360px;
}

/* Close video button */
#closeVideoBtn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 0.75rem;
}

/* =======================
   BOUTS TABLE
   ======================= */

#wmBoutsTable {
  border-collapse: collapse;
}

/* Header */
#wmBoutsTable thead th {
  font-weight: 700;
  background: #152238;
  color: #ffffff;
  border-bottom: 1px solid #253144;
}

/* Base cells (all rows) */
#wmBoutsTable tbody td {
  background: #121826;               /* dark card color */
  color: var(--text-light);          /* light text */
  border-top: 1px solid #253144;
}

/* Stripe effect */
#wmBoutsTable tbody tr:nth-of-type(odd) > td {
  background: #171f33;               /* slightly lighter, but still dark */
}

/* Hover */
#wmBoutsTable tbody tr:hover > td {
  background: rgba(128,168,255,0.10);
}

/* Result pill */
.wlpill {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  background: #0a2a55;
  color: #ffffff;
  border: 1px solid #29558c;
}

/* Opponent link */
.wm-opp {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.wm-opp:hover {
  color: var(--blue-dark);
}

/* =======================
   LIGHT MODE TABLE OVERRIDES
   ======================= */
@media (prefers-color-scheme: light) {
  #wmBoutsTable thead th {
    background: #dbe7ff;
    color: #0b1b32;
    border-bottom-color: #aac2ea;
  }

  #wmBoutsTable tbody td {
    background: #ffffff;             /* normal white rows */
    color: #0b1b32;
    border-top-color: #d0d7e8;
  }

  #wmBoutsTable tbody tr:nth-of-type(odd) > td {
    background: rgba(0,0,0,0.03);    /* light gray stripe */
  }

  #wmBoutsTable tbody tr:hover > td {
    background: rgba(0,0,0,0.06);
  }

  .wlpill {
    background: #e5efff;
    color: #0b1b32 !important;
    border-color: #aac2ea;
  }
}
