/* ==================================================
   Shared styles for the data pages:
   table, players, stats (breadcrumbs, stat tables,
   view toggles, KPI cards, entity header, filters)
================================================== */

/* Breadcrumbs, KPI cards and the player header live in components.css / player.css */

.section_heading a {
  color: inherit;
  text-decoration: none;
}

.section_heading a:hover {
  color: var(--brand);
}

/* ── Page intro / meta ──────────────────────────────────────── */
.page_meta {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 10px;
}

.page_intro {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 23px;
  margin-top: 12px;
}

.page_intro a,
.table_note a,
.page_meta a {
  color: var(--brand);
  text-decoration: none;
}

.page_intro a:hover,
.table_note a:hover,
.page_meta a:hover {
  text-decoration: underline;
}

.page_notice {
  background-color: var(--dark);
  border-left: 4px solid #f1c40f;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  margin-top: 12px;
}

/* ── View toggle (e.g. Overall / Home / Away) ───────────────── */
.view_tabs {
  display: flex;
  background: var(--dark);
  border-radius: 10px;
  padding: 0.3rem;
  gap: 5px;
  margin-top: 15px;
}

.view_tabs[hidden] {
  display: none;
}

.view_tab {
  flex: 1;
  padding: 0.5rem 1.1rem;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.view_tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.view_tab--active,
.view_tab--active:hover {
  background: var(--brand);
  color: var(--dark);
}

.view_panel {
  margin-top: 20px !important;
}

/* ── Stat table (card; scrolls sideways inside the card; first column(s) pinned) ─ */
.stat_table_wrap {
  margin-top: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.stat_table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  color: var(--text-primary);
}

.stat_table th,
.stat_table td {
  padding: 10px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  font-weight: normal;
  background-color: var(--dark);
  border-bottom: 1px solid var(--border);
}

.stat_table tbody tr:last-child th,
.stat_table tbody tr:last-child td {
  border-bottom: none;
}

.stat_table thead th {
  background-color: var(--surface-sunken);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.stat_table abbr {
  text-decoration: none;
  cursor: help;
}

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

.stat_table a:hover {
  color: var(--brand);
}

.stat_table .st_pos {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 40px;
  min-width: 40px;
  color: var(--text-secondary);
  font-weight: 700;
}

.stat_table .st_name {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
}

.stat_table .st_pos + .st_name {
  left: 40px;
}

.stat_table .st_name a,
.stat_table .st_name .st_plain {
  display: flex;
  align-items: center;
  column-gap: 10px;
  font-weight: 600;
}

.stat_table .st_name img {
  object-fit: contain;
  flex-shrink: 0;
}

.stat_table .st_left {
  text-align: left;
}

.stat_table .st_strong {
  font-weight: 800;
}

.stat_table .st_muted {
  color: var(--text-secondary);
}

.stat_table tr[hidden] {
  display: none;
}

@media (hover: hover) and (min-width: 820px) {
  .stat_table tbody tr:hover th,
  .stat_table tbody tr:hover td {
    background-color: var(--surface-sunken);
  }
}

/* Form badges (W/D/L) live in components.css */

/* .table_note lives in components.css */

/* ── Filter bar (client-side only, no URLs) ─────────────────── */
.filter_bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.filter_bar[hidden] {
  display: none;
}

.filter_bar label {
  display: flex;
  flex-direction: column;
  row-gap: 4px;
  flex: 1;
  min-width: 140px;
  font-size: 12px;
  color: var(--text-secondary);
}

.filter_bar input,
.filter_bar select {
  background-color: var(--dark);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 9px 10px;
  font-family: var(--font-primary);
  font-size: 14px;
}

.filter_empty {
  color: var(--text-secondary);
  margin-top: 15px;
}

/* ── Link lists (seasons, rankings) ─────────────────────────── */
.link_chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none !important;
  padding: 0 !important;
  margin: 10px 0 0 !important;
}

.link_chips li {
  margin: 0 !important;
}

.link_chips a,
.link_chips span {
  display: block;
  background-color: var(--dark);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-primary);
  text-decoration: none;
}

.link_chips a:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.link_chips .chip_current {
  border-color: var(--brand);
  color: var(--brand);
}

@media screen and (max-width: 820px) {
  .stat_table {
    font-size: 13px;
  }

  .stat_table th,
  .stat_table td {
    padding: 8px 7px;
  }

  .stat_table .st_pos {
    width: 32px;
    min-width: 32px;
  }

  .stat_table .st_pos + .st_name {
    left: 32px;
  }

  .stat_table .st_name img {
    width: 20px;
    height: 20px;
  }
}
