/* ================================================================
   stats.css — a dark "analytics dashboard" look, deliberately
   different from the bright, playful main listings page.
   Deep navy panels, teal data bars, glowing tabular numbers.
   ================================================================ */

:root {
  --bg:      #0c111b;   /* page background          */
  --bg2:     #070b12;   /* darker edge for gradient */
  --panel:   #141d2b;   /* card / panel surface     */
  --panel2:  #1b2637;   /* raised surface           */
  --line:    #26344a;   /* hairline borders         */
  --text:    #e7eef7;   /* main text                */
  --muted:   #8494ab;   /* secondary text           */
  --teal:    #2dd4bf;   /* primary accent           */
  --sky:     #38bdf8;   /* secondary accent         */
  --gold:    #f5c518;   /* a small nod to home       */
  --radius:  14px;
  --mono: "SFMono-Regular", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 500px at 50% -180px, rgba(45, 212, 191, 0.10), transparent 70%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  background-attachment: fixed;
  color: var(--text);
  font-size: 17px;
  line-height: 1.45;
  min-height: 100vh;
}

/* ---------- Top bar ---------- */
.topbar {
  text-align: center;
  padding: 34px 16px 26px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.topbar::after {   /* thin accent underline instead of the gold slab */
  content: "";
  position: absolute;
  left: 50%; bottom: -1px;
  width: 180px; height: 2px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
}
.topbar h1 {
  margin: 0;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: .3px;
  background: linear-gradient(90deg, var(--teal), var(--sky));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subtitle {
  margin: 8px 0 0;
  font-size: 1.02rem;
  color: var(--muted);
}
.topbar-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--teal);
  border: 1px solid var(--line);
  background: var(--panel);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  padding: 7px 16px;
  border-radius: 999px;
  transition: border-color .15s ease, color .15s ease;
}
.topbar-link:hover { border-color: var(--teal); color: var(--sky); }

/* ---------- Example banner ---------- */
.banner {
  background: rgba(245, 197, 24, 0.12);
  border-bottom: 1px solid rgba(245, 197, 24, 0.4);
  color: var(--gold);
  text-align: center;
  padding: 11px 16px;
  font-size: .98rem;
}

/* ---------- View toggle (segmented control) ---------- */
.bigtabs {
  display: flex;
  gap: 6px;
  max-width: 460px;
  margin: 26px auto 4px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.tab {
  flex: 1;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1rem;
  transition: background .15s ease, color .15s ease;
}
.tab:hover { color: var(--text); }
.tab-active {
  background: linear-gradient(135deg, var(--teal), var(--sky));
  color: #06222b;
  font-weight: 700;
}
.tab-emoji { font-size: 1.2rem; line-height: 1; }
.tab-label { font-weight: 600; }
.tab-count {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 999px;
  padding: 1px 10px;
  font-size: .85rem;
  font-weight: 700;
  font-family: var(--mono);
}
.tab:not(.tab-active) .tab-count {
  background: var(--panel2);
  color: var(--muted);
}

/* ---------- Layout ---------- */
.stats-main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 18px 18px 48px;
}

/* ---------- Big summary numbers ---------- */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 24px 0 30px;
}
.stat-card {
  position: relative;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  overflow: hidden;
}
.stat-card::before {   /* top accent line */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--teal), var(--sky));
  opacity: .8;
}
.stat-emoji { font-size: 1.5rem; line-height: 1; opacity: .9; }
.stat-value {
  font-family: var(--mono);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -.5px;
  color: #fff;
  margin: 8px 0 3px;
  word-break: break-word;
  text-shadow: 0 0 18px rgba(45, 212, 191, 0.25);
}
.stat-label {
  font-size: .82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ---------- Charts ---------- */
.stat-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 16px;
}
.chart-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 22px;
}
.chart-title {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.chart-empty { color: var(--muted); font-size: .92rem; margin: 6px 0; }

.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 12px;
}
.bar-label {
  font-size: .92rem;
  font-weight: 500;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-track {
  background: #0c1420;
  border: 1px solid var(--line);
  border-radius: 6px;
  height: 16px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 5px 6px 6px 5px;
  background: linear-gradient(90deg, var(--teal), var(--sky));
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
  transition: width .4s cubic-bezier(.2, .8, .2, 1);
}
.bar-count {
  font-family: var(--mono);
  font-weight: 700;
  font-size: .92rem;
  color: var(--teal);
  min-width: 40px;
  text-align: right;
}

/* ---------- Footer ---------- */
.foot {
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
  padding: 26px 16px 40px;
  border-top: 1px solid var(--line);
  margin-top: 30px;
}
.foot p { margin: 4px 0; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 30px 16px;
}
.hidden { display: none; }

@media (max-width: 520px) {
  .topbar h1 { font-size: 1.7rem; }
  .bar-row { grid-template-columns: 88px 1fr auto; }
  .bar-label { font-size: .82rem; }
  .stat-value { font-size: 1.5rem; }
  .tab-label { display: none; }   /* icons + counts only on small screens */
}
