/* === JATSport Design System — base.css ===
 * Shared design tokens and component styles.
 * theme.js injects light-mode overrides at runtime.
 * Page-specific overrides live inline in each HTML file.
 */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

/* ── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg: #070b09;
  --surface: #111a16;
  --surface2: #192420;
  --surface3: #213028;

  /* Borders */
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.14);

  /* Text */
  --text: #e8f0ec;
  --muted: #7a9088;
  --label: #98b0a6;

  /* Brand */
  --brand: #00a882;
  --brand-dark: #007060;
  --accent: #00a882;   /* alias — use --brand in new code */
  --accent2: #007060;  /* alias */

  /* Semantic colors */
  --ev-pos: #2fd672;   /* positive EV / win / edge */
  --ev-neg: #f04040;   /* negative EV / loss */
  --warn:   #f59e0b;   /* warning / low confidence */
  --live:   #ff5200;   /* live / in-game */
  --info:   #5b9fff;   /* neutral info / links */

  /* Backward-compat aliases */
  --green: #2fd672;
  --red:   #f04040;
  --amber: #f59e0b;
  --gold:  #f59e0b;
  --grad:  linear-gradient(135deg, #00a882, #007060);
  --grad-gold: linear-gradient(135deg, #f59e0b, #d4851a);

  /* Typography */
  --ff-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --ff-body:    'IBM Plex Sans', -apple-system, sans-serif;
  --ff-mono:    'Space Mono', 'Courier New', monospace;

  /* Layout max-widths */
  --max-w-full: 1200px;
  --max-w-tool: 960px;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
html, body { overflow-x: hidden; }

/* ── Base ──────────────────────────────────────────────────────────────────── */
body {
  font-family: var(--ff-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
header {
  position: sticky; top: 0; z-index: 100;
  background: #070b09;
  border-bottom: 1px solid var(--border);
  padding: 0 16px; min-height: 52px;
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
/* Two-row header variant (app.html): .header-top replaces the single flex row */
.header-top {
  height: 52px; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; min-width: 0; flex-shrink: 0;
}
.logo {
  width: 30px; height: 30px; border-radius: 9px;
  flex-shrink: 0; overflow: hidden;
  display: block; text-decoration: none;
}
header h1 {
  font-size: 14px; font-weight: 700; letter-spacing: -0.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.live-dot {
  width: 7px; height: 7px; background: var(--live); border-radius: 50%;
  animation: pulse 1.5s infinite; box-shadow: 0 0 6px var(--live); flex-shrink: 0;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.last-update { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ── Header Nav ────────────────────────────────────────────────────────────── */
.header-nav { display: flex; align-items: center; gap: 2px; }
/* Button variant (app.html uses <button class="header-nav-link">) */
.header-nav-link {
  background: none; border: none; color: var(--muted);
  font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 6px 12px; border-radius: 8px; cursor: pointer;
  transition: all 0.15s; display: flex; align-items: center;
  gap: 5px; white-space: nowrap; text-decoration: none;
}
.header-nav-link:hover { color: var(--text); background: var(--surface2); }
.header-nav-link.active { color: var(--accent); background: rgba(0,168,130,0.08); }
/* Anchor variant (other pages use <a class="header-nav-link"> or <a> inside .header-nav) */
.header-nav a {
  color: var(--muted); font-size: 13px; font-weight: 500;
  padding: 6px 12px; border-radius: 8px; text-decoration: none;
  display: flex; align-items: center; gap: 5px;
  transition: all 0.15s; white-space: nowrap;
}
.header-nav a:hover { color: var(--text); background: var(--surface2); }
.header-nav a.active { color: var(--accent); background: rgba(0,168,130,0.08); }
@media (max-width: 900px) { .nav-label { display: none; } }
@media (max-width: 700px) { .header-nav { display: none; } }

/* ── Nav Dropdown ──────────────────────────────────────────────────────────── */
.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; min-width: 160px; z-index: 1000; padding: 4px 0;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block; padding: 8px 16px;
  color: var(--muted); text-decoration: none;
  font-size: 13px; white-space: nowrap;
}
.nav-dropdown-menu a:hover { color: var(--text); background: rgba(255,255,255,0.05); }

/* ── Sport Nav ─────────────────────────────────────────────────────────────── */
.sport-nav {
  background: rgba(8,11,18,0.6); border-bottom: 1px solid var(--border);
  padding: 0; display: flex; overflow-x: auto; scrollbar-width: none;
}
.sport-nav::-webkit-scrollbar { display: none; }
.sport-tab {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--muted);
  text-decoration: none; border-bottom: 2px solid transparent;
  white-space: nowrap; transition: all 0.15s; cursor: pointer;
  background: none; border-left: none; border-right: none; border-top: none;
  font-family: var(--ff-display); text-transform: uppercase; letter-spacing: 0.06em;
  flex: 1; min-width: 0;
}
.sport-tab:hover { color: var(--text); }
.sport-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Mobile Bottom Nav ─────────────────────────────────────────────────────── */
.mobile-bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: #080c0a;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 6px 0 env(safe-area-inset-bottom, 8px);
  z-index: 1000; justify-content: space-around; align-items: center;
}
@media (max-width: 768px) {
  .mobile-bottom-nav { display: flex; }
  body { padding-bottom: 68px; }
}
.mbn-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 4px 10px; color: var(--muted);
  text-decoration: none; font-size: 10px; font-weight: 500;
  letter-spacing: 0.3px; transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.mbn-item svg { width: 22px; height: 22px; stroke-width: 1.6; }
.mbn-item.active { color: var(--accent, #00c853); }
.mbn-item:hover { color: var(--accent, #00c853); }

/* ── Skeleton Screens ─────────────────────────────────────────────────────── */
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card {
  background: #111a16; border: 1px solid #1e2b1e;
  border-radius: 4px; padding: 16px; margin-bottom: 8px;
}
.skeleton-line {
  background: linear-gradient(90deg, #111a16 25%, #1e2b1e 50%, #111a16 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
  border-radius: 4px; height: 14px; margin-bottom: 8px;
}
.skeleton-line.wide { width: 100%; }
.skeleton-line.medium { width: 60%; }
.skeleton-line.narrow { width: 35%; }

/* ── Skeleton loading (shimmer via background-position) ───────────────────── */
@keyframes skeleton-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
  border-radius: 6px;
}
.skeleton-title { height: 16px; width: 55%; margin-bottom: 12px; }
.skeleton-badge { height: 22px; width: 52px; border-radius: 4px; display: inline-block; }
.skeleton-num   { height: 28px; width: 70px; }
@media (prefers-color-scheme: light) {
  .skeleton {
    background: linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.12) 50%, rgba(0,0,0,0.06) 75%);
    background-size: 800px 100%;
  }
}
