/* ================================================
   base.css — sportracker.com
   Global variables, reset, typography, layout
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ---- Color Palette ---- */
:root {
  --blue-50:   #EFF6FF;
  --blue-100:  #DBEAFE;
  --blue-600:  #2563EB;
  --blue-700:  #1D4ED8;

  --green-50:  #F0FDF4;
  --green-600: #16A34A;
  --green-700: #15803D;

  --red-50:    #FEF2F2;
  --red-500:   #EF4444;
  --red-600:   #DC2626;

  --amber-50:  #FFFBEB;
  --amber-500: #F59E0B;
  --amber-600: #D97706;
  --amber-700: #B45309;

  --slate-50:  #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-900: #0F172A;

  /* Semantic tokens */
  --primary:        var(--blue-600);
  --primary-hover:  var(--blue-700);
  --primary-light:  var(--blue-50);
  --text:           var(--slate-900);
  --text-muted:     var(--slate-500);
  --bg:             #FFFFFF;
  --bg-alt:         var(--slate-50);
  --border:         var(--slate-200);
  --card-bg:        #FFFFFF;

  --shadow-sm: 0 1px 4px rgba(15,23,42,0.06);
  --shadow-md: 0 4px 16px rgba(15,23,42,0.08);
  --shadow-lg: 0 8px 32px rgba(15,23,42,0.10);

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --nav-h:      64px;
  --transition: 0.2s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a   { text-decoration: none; color: inherit; }
ul  { list-style: none; }
button { font-family: inherit; }
input, select { font-family: inherit; }

/* ---- Typography ---- */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; }

/* ---- Layout ---- */
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ---- Navbar ---- */
.st-topbar {
  background: var(--slate-900); color: rgba(255,255,255,.75);
  font-size: .78rem; text-align: center; padding: 7px 24px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.st-topbar a { color: var(--amber-500); font-weight: 700; }

.st-nav {
  position: sticky; top: 0; z-index: 200;
  background: white; border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm); height: var(--nav-h);
  display: flex; align-items: center;
}
.st-nav__inner {
  display: flex; align-items: center; gap: 20px; width: 100%;
}
.st-nav__logo {
  font-size: 1.2rem; font-weight: 800; color: var(--text); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 0;
}
.st-nav__logo span { color: var(--primary); }
.st-nav__logo sup {
  font-size: .58rem; font-weight: 700; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 4px; margin-left: 4px; letter-spacing: .04em;
}

.st-nav__links {
  display: flex; align-items: center; gap: 4px; flex: 1;
}
.st-nav__link {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 600; color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.st-nav__link:hover { background: var(--bg-alt); color: var(--text); }
.st-nav__link.active { background: var(--primary-light); color: var(--primary); }
.st-nav__link-icon { font-size: 1rem; line-height: 1; }

.lang-toggle {
  display: flex; align-items: center;
  border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
  margin-left: auto; flex-shrink: 0;
}
.lang-btn {
  background: transparent; border: none; cursor: pointer;
  font-family: inherit; font-size: .72rem; font-weight: 700;
  padding: 5px 9px; color: var(--text-muted); letter-spacing: .04em;
  transition: background var(--transition), color var(--transition);
}
.lang-btn.active { background: var(--primary); color: white; }
.lang-btn:hover:not(.active) { background: var(--bg-alt); }

/* ---- Page header (hero strip) ---- */
.page-hero {
  padding: 48px 0 36px;
  background: linear-gradient(135deg, #0B1E3D 0%, #1a3a6b 100%);
  color: white; position: relative; overflow: hidden;
}
.page-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 60%, rgba(201,162,39,.15) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 30%, rgba(37,99,235,.18) 0%, transparent 55%);
}
.page-hero__inner { position: relative; z-index: 1; }
.page-hero__eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(255,255,255,.6); margin-bottom: 12px;
}
.page-hero__eyebrow a { color: rgba(255,255,255,.5); }
.page-hero__eyebrow a:hover { color: rgba(255,255,255,.8); }
.page-hero__eyebrow span { opacity: .4; }
.page-hero__title {
  font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 800;
  line-height: 1.15; margin-bottom: 10px;
}
.page-hero__title em { color: #F2CC5F; font-style: normal; }
.page-hero__sub {
  color: rgba(255,255,255,.65); font-size: .95rem;
  max-width: 500px; line-height: 1.65;
}

/* ---- Live badge ---- */
.live-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(220,38,38,.15); border: 1px solid rgba(220,38,38,.3);
  color: #fca5a5; padding: 5px 12px; border-radius: 99px;
  font-size: .72rem; font-weight: 700; letter-spacing: .05em; margin-bottom: 14px;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--red-600);
  animation: pulseDot 1.4s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .35; transform: scale(.65); }
}

/* ---- Page body ---- */
.page-body { background: var(--slate-50); min-height: 60vh; padding: 28px 0 72px; }

/* ---- Tabs ---- */
.st-tabs {
  background: white; border-bottom: 1px solid var(--border);
  position: sticky; top: var(--nav-h); z-index: 90;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.st-tabs__row {
  display: flex; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.st-tabs__row::-webkit-scrollbar { display: none; }
.tab-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 14px 20px; border: none; background: none;
  font-size: .87rem; font-weight: 600; color: var(--text-muted);
  cursor: pointer; white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover  { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- Update bar ---- */
.update-bar {
  background: white; border-bottom: 1px solid var(--border); padding: 6px 0;
}
.update-bar__inner {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .78rem; color: var(--text-muted); gap: 12px;
}
.update-bar__left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.poll-label { color: var(--green-600); font-weight: 600; }
.refresh-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 10px; font-size: .75rem; font-weight: 600;
  color: var(--primary); cursor: pointer; transition: background var(--transition);
  white-space: nowrap;
}
.refresh-btn:hover { background: var(--primary-light); }
.upd-left { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.st-visitor { display:inline-flex; align-items:center; gap:4px; font-size:.72rem; color:var(--text-muted); }
.st-visitor strong { color:var(--text); font-weight:700; }
/* Lightweight info bar for hub/archive pages (no update polling) */
.st-info-bar { background:white; border-bottom:1px solid var(--border); padding:5px 0; }
.st-info-bar .container { display:flex; justify-content:flex-end; }

/* ---- Skeleton loaders ---- */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e6e6e6 50%, #f0f0f0 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.sk-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 12px; }
.sk-card  { height: 125px; }
.sk-g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.sk-group { height: 210px; }

/* ---- Empty / Error boxes ---- */
.empty-box, .error-box {
  background: white; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 48px 24px; text-align: center;
}
.error-box { border-color: rgba(220,38,38,.2); background: var(--red-50); color: var(--red-600); }
.box-icon  { font-size: 2.6rem; margin-bottom: 12px; }
.box-title { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.box-sub   { font-size: .85rem; color: var(--text-muted); }
.error-box .box-sub { color: var(--red-600); opacity: .8; }
.box-retry {
  margin-top: 14px; background: var(--red-600); color: white; border: none;
  border-radius: 8px; padding: 8px 18px; font-size: .85rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.52); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-box {
  background: white; border-radius: var(--radius-lg);
  max-width: 640px; width: 100%; max-height: 90vh;
  overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: white; z-index: 1;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-close {
  background: none; border: none; font-size: 1.1rem; cursor: pointer;
  color: var(--text-muted); width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background var(--transition);
}
.modal-close:hover { background: var(--bg-alt); }

/* ---- Footer ---- */
.st-footer {
  background: var(--slate-900); color: rgba(255,255,255,.6);
  padding: 40px 0 24px; font-size: .85rem;
}
.st-footer__inner { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; }
.st-footer__logo { font-size: 1.1rem; font-weight: 800; color: white; margin-bottom: 6px; }
.st-footer__logo span { color: var(--primary); }
.st-footer__desc { font-size: .82rem; max-width: 260px; line-height: 1.65; }
.st-footer__col-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.4); margin-bottom: 10px; }
.st-footer__links { display: flex; flex-direction: column; gap: 6px; }
.st-footer__links a { color: rgba(255,255,255,.6); font-size: .83rem; transition: color var(--transition); }
.st-footer__links a:hover { color: white; }
.st-footer__bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.08); text-align: center; font-size: .75rem; color: rgba(255,255,255,.3); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: .88rem; font-weight: 600; cursor: pointer; border: none;
  transition: all var(--transition); text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(37,99,235,.3); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .68rem; font-weight: 700; padding: 2px 8px;
  border-radius: 99px; letter-spacing: .03em;
}
.badge--live   { background: rgba(220,38,38,.12); color: var(--red-600); }
.badge--new    { background: var(--blue-50); color: var(--blue-600); }
.badge--promo  { background: var(--amber-50); color: var(--amber-700); }
.badge--green  { background: var(--green-50); color: var(--green-600); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .st-nav__links { display: none; }
  .page-hero { padding: 32px 0 24px; }
}
@media (max-width: 480px) {
  .st-nav__logo sup { display: none; }
  .lang-btn { padding: 4px 7px; font-size: .68rem; }
}
