/* assets/css/stats.css */

/* ==========================
   Page layout
   ========================== */
.page-stats {
  background-color:var(--accent-primary);
}
.page-stats .site-main {
  width: 90%;
  max-width: 1100px;
  margin: 20px auto;
  padding: 16px 0 24px;
}

.page-stats__inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-stats__top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.page-stats__top-bar h1 {
  margin: 0;
  font-size: 1.4rem;
}

/* Top-right controls (Stats/Standings toggle + team select) */
.page-stats__controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* ==========================
   Stats / Standings toggle
   ========================== */

.stats-toggle {
  display: flex;
  gap: 6px;
}

.stats-toggle__button {
  font-size: 0.85rem;
  padding: 4px 10px;
}

/* Active tab-style button */
/* .stats-toggle__button--active {
  background: var(--accent-secondary);
  border-color: var(--accent-secondary);
  color: #000;
} */

/* ==========================
   Team filter (right side)
   ========================== */

.page-stats .team-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.page-stats .team-filter label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.page-stats .team-filter select {
  padding: 3px 8px;
  font-size: 0.85rem;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-alt);
  color: var(--text-main);
  cursor: pointer;
}

.page-stats .team-filter select:focus-visible {
  outline: 1px solid var(--accent-primary);
}

/* ==========================
   Stats panel
   ========================== */

.stats-panel--full {
  margin-top: 4px;
}

.stats-panel__inner {
  /* tie into team/neutral card vars */
  background: var(--page-card-bg, var(--bg-surface));
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  padding: 12px 14px 10px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}

.stats-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.stats-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

/* wrapper allows horizontal scroll on narrow screens */
.stats-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

/* ==========================
   Stats table
   ========================== */

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.stats-table thead {
  /* header strip uses the card header color if defined */
  background: var(--accent-secondary);
}

.stats-table th,
.stats-table td {
  padding: 6px 8px;
  text-align: right;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.stats-table th:first-child,
.stats-table td:first-child {
  text-align: left;
}

.stats-table th {
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

/* sort arrows */
.stats-table th.sort-asc::after,
.stats-table th.sort-desc::after {
  content: '';
  display: inline-block;
  margin-left: 4px;
  border: 4px solid transparent;
}

.stats-table th.sort-asc::after {
  border-bottom-color: var(--accent-primary);
}

.stats-table th.sort-desc::after {
  border-top-color: var(--accent-primary);
}

/* zebra + hover */
.stats-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

.stats-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* empty state text */
#stats-empty {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
/* Teams that need dark header text on stats tables */
.page-stats.team-det  .stats-table thead th,
.page-stats.team-tor  .stats-table thead th,
.page-stats.team-stl  .stats-table thead th,
.page-stats.team-sea  .stats-table thead th,
.page-stats.team-pit  .stats-table thead th,
.page-stats.team-buf  .stats-table thead th,
.page-stats.team-cgy  .stats-table thead th {
  color: #000;
}

/* ==========================
   Mobile tweaks
   ========================== */

@media (max-width: 700px) {
  .page-stats__top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-stats__controls {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .page-stats .site-main {
    width: 100%;
    margin-inline: 0;
    padding-inline: 12px;
  }

  .stats-panel__inner {
    padding: 10px;
  }
}




