/* public/assets/css/ncaa-standings.css */
/* Standalone NCAA standings styling (no stats.css / standings.css required) */

.page-standings__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0; /* let stats-panel__inner handle padding */
  
}
.stats-panel__inner {
  padding:40px;
  background-color: var(--accent-secondary-soft);
}
/* Mobile-first: stack heading above controls */
.page-standings__top-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 40px;
}

.page-standings__top-bar h1 {
  margin: 0;
  font-size: 1.6rem;
}

/* controls row */
.page-standings__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* Desktop: heading + controls inline */
@media (min-width: 768px) {
  .page-standings__top-bar {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .page-standings__controls {
    justify-content: flex-end;
  }
}

/* ===== Toggle buttons (simple theme-friendly) ===== */
.stats-toggle {
  display: flex;
  gap: 6px;
}

.stats-toggle__button {
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stats-toggle__button:hover {
  filter: brightness(1.05);
}

.stats-toggle__button--active,
.stats-toggle__button.is-active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-on-accent, #fff);
}

/* ===== View dropdown ===== */
.standings-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.standings-filter label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.standings-filter select {
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
}

.standings-filter select:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ===== Rules box ===== */
.standings__rules {
  margin: 6px 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.standings__rules ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.standings__rules li {
  margin: 2px 0;
}

/* ===== GRID: 1 col mobile, 2 col desktop ===== */
.standings-root {
  display: grid;
  grid-template-columns: 1fr;   /* mobile */
  gap: 24px;
  row-gap:60px;
}

@media (min-width: 980px) {
  .standings-root {
    align-items: start;
  }
}

/* ===== Conference card ===== */
.standings-conf--card {
  background: var(--page-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px;
}

/* Logo/title header */
.standings-conf__header {
  display: flex;
  justify-self: center;
  gap: 12px;
  margin-bottom: 12px;
}

.standings-conf__title {
  margin: 0;
  font-size: 1.05rem;
}

/* Bigger conference logos */
.standings-conf__logo {
  width: auto;
  display: block;
}

/* ===== Table (standalone "stats-table" look) ===== */
.standings-group__table {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--accent-primary);
}

/* table base */
.stats-table {
  width: 100%;
  border-collapse: collapse;
}

/* header */
.stats-table thead th {
  text-align: left;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 10px 10px;
  background: var(--bg-surface-alt, rgba(255,255,255,0.04));
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

/* body */
.stats-table tbody td {
  font-size: 0.82rem;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.stats-table tbody tr:last-child td {
  border-bottom: 0;
}

/* zebra */
.stats-table tbody tr:nth-child(2n) td {
  background: var(--accent-secondary-soft);
}

/* numeric align helper */
.stats-table .num,
.stats-table td[style*="text-align:right"],
.stats-table th[style*="text-align:right"] {
  text-align: right;
}

/* Make the table scroll inside the card on small screens */
@media (max-width: 600px) {
  .standings-group__table {
    overflow-x: auto;
  }
  .stats-table {
    min-width: 640px;
  }
  .stats-panel__inner {
    padding:5px;
    background: unset;
    border-radius: unset;
    border: unset; 
    box-shadow: unset;
  }
  .standings-conf--card {
    padding:0;
  }
}

/* empty state */
.stats-empty {
  margin-top: 16px;
  padding: 14px;
  border: 1px dashed var(--border-subtle);
  border-radius: 12px;
  color: var(--text-muted);
}
/* Force grid items to stretch to row height */
.standings-root {
  align-items: stretch;
}

/* Each card fills its grid cell */
.standings-conf--card {
  display: flex;
  flex-direction: column;
}

/* Table container grows to fill card */
.standings-group__table {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Table fills available vertical space */
.standings-group__table .stats-table {
  flex: 1;
}
/* ===== GRID ===== */
.standings-root {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

/* Desktop: 2-column grid */
@media (min-width: 980px) {
  .standings-root {
    align-items: stretch; /* IMPORTANT */
  }
}

/* ===== Conference card ===== */
.standings-conf--card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 18px;
}

/* Header (logo or title) */
.standings-conf__header {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 96px; /* KEY: equal header height */
  margin-bottom: 14px;
}

/* Logos – bigger & centered */
.standings-conf__logo {
  max-height: 72px;
  width: auto;
  display: block;
}

/* Text fallback */
.standings-conf__title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}

/* Table wrapper fills remaining height */
.standings-group__table {
  flex: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
/* Header area: fixed height, centered content */
.standings-conf__header {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;          /* KEY: same height for every card */
  margin-bottom: 16px;
  padding: 8px;
}
.standings-conf__logo {
  max-height: 80px;
  width: auto;
  max-width: 100%;
  display: block;
}
/* Make sure the panel doesn’t allow children to spill out */
.stats-panel__inner {
  overflow: hidden;
}

/* Grid items MUST be allowed to shrink inside grid tracks */
.standings-root {
  width: 100%;
}

.standings-root > * {
  min-width: 0;          /* KEY FIX */
}

/* Cards must not exceed the grid column width */
.standings-conf--card {
  width: 100%;
  max-width: 100%;
  min-width: 0;          /* KEY FIX */
  box-sizing: border-box;
}

/* The table wrapper should scroll instead of pushing width */
.standings-group__table {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;      /* important */
  box-sizing: border-box;
}

/* Table should not force column wider than the card */
.stats-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;   /* prevents runaway width */
}

/* Allow the Team column to truncate rather than expand */
.stats-table th,
.stats-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-table td:nth-child(2),
.stats-table th:nth-child(2) {
  white-space: nowrap;
}
