/* ── Shared utility classes used across dashboard, filters, stats ── */

/* Page-level heading (h2) — "Aggregated Stats", "Poker Stats Glossary" */
.page-heading {
  margin: 0 0 0.875em 0;
  font-size: 1.4em;
}

/* Card-level section heading — "Preflop Stats by Position", "Postflop" */
.section-heading {
  margin: 0 0 0.75em 0;
  font-size: 1.2em;
}

/* Large stat number in postflop grid cards */
.big-value {
  font-size: 22px;
  font-weight: 700;
}

/* Small secondary detail below a stat */
.detail {
  font-size: 12px;
}

/* Win / loss colouring */
.positive { color: #4ade80; }
.negative { color: #f87171; }

/* Sortable column headers */
a.sortable { text-decoration: none; color: inherit; }
a.sortable:hover .sort-arrow { opacity: 1; color: #f1f5f9; }
.sort-arrow { opacity: 0.45; transition: opacity 0.15s; }
.sort-arrow.active { opacity: 0.85; }

/* Summary stats row (hands / net / bb-100) */
.summary-row {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 14px;
}
.summary-row > .card {
  margin: 0;
  flex: 1;
}
.card-stats {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  min-width: 120px;
}

.card-stats .stat-label { font-size: 13px; }
.card-stats .stat-value { font-size: 26px; font-weight: 700; }

/* Stat tooltip (positioned by tooltips.js) */
.stat-tooltip {
  display: none;
  position: absolute;
  z-index: 1000;
  max-width: 320px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #1a2744;
  border: 1px solid #2d3f5e;
  color: #e8eefc;
  font-size: 13px;
  line-height: 1.45;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .45);
}

/* Stat header links inside tables / grid cards */
a.stat-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted rgba(147, 197, 253, .4);
}
a.stat-link:hover {
  color: #93c5fd;
  border-bottom-color: #93c5fd;
}

/* Aggregates tab bar */
.agg-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.agg-tab {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  background: #0f1b33;
  color: #93c5fd;
  border: 1px solid #1f2a44;
}
.agg-tab.active {
  background: #1d4ed8;
  color: #e8eefc;
  border-color: #1d4ed8;
}

@media (max-width: 600px) {
  .summary-row { flex-direction: column; }

  /* Merge the 4 stat cards into one card on mobile */
  .summary-row--4up {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    background: #0f1b33;
    border: 1px solid #1f2a44;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
  }
  .summary-row--4up > .card {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
  }

  .card-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 767px) {
  html { font-size: 15px; }
  .big-value { font-size: 20px; }
  .card-stats .stat-value { font-size: 22px; }
  .grid { grid-template-columns: repeat(2, 1fr); }

  .col-stakes,
  .col-line,
  .col-time { display: none; }

  /* Aggregates tab bar: wrap + compact */
  .agg-tabs { flex-wrap: wrap; }
  .agg-tab { padding: 6px 12px; font-size: 13px; }
}