/* ─── Orb Analytics – Design System (Light Theme) ────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@100..900&family=Inter:wght@300;400;500;600&family=Audiowide&display=swap');

:root {
  --purple-950: #0D0118;
  --purple-900: #1A0533;
  --purple-800: #2D0A4E;
  --purple-700: #4A1272;
  --purple-600: #6B21A8;
  --purple-500: #9333EA;
  --purple-400: #A855F7;
  --purple-300: #7C3AED;
  --purple-200: #EDE9FE;
  --purple-100: #F5F3FF;

  --gold:    #D97706;
  --green:   #10B981;
  --red:     #DC2626;
  --blue:    #0284C7;

  --gray-950: #09090B;
  --gray-900: #111827;
  --gray-800: #1F2937;
  --gray-700: #374151;
  --gray-600: #71717A;
  --gray-500: #1F2937;
  --gray-400: #374151;
  --gray-300: #D1D5DB;
  --gray-200: #E5E7EB;
  --gray-100: #F3F4F6;
  --gray-50:  #F9FAFB;

  --bg:      #F4F4F5;
  --surface: #FFFFFF;
  --card:    #FFFFFF;
  --border:  #E4E4E7;
  --text:    #3F3F46;
  --muted:   #6B21A8;
  --accent:  var(--purple-600);

  --font-display: 'Roboto Slab', serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    var(--font-body);

  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --transition: 0.2s ease;
  --glow: 0 2px 12px rgba(0,0,0,0.08);
  --hover-tint: rgba(147, 51, 234, 0.08);
  --hover-border: var(--purple-400);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── Dark theme ─────────────────────────────────────────────────── */
body.dark {
  --bg:      #121214;
  --surface: #1C1C1F;
  --card:    #202024;
  --border:  #303036;
  --text:    #F4F4F5;
  --muted:   #A1A1AA;
  --purple-600: #A855F7;
  --purple-300: #C084FC;

  --gray-50:  #232327;
  --gray-100: #28282D;
  --gray-200: #34343A;
  --gray-300: #45454C;
  --gray-400: #71717A;
  --gray-500: #9CA3AF;
  --gray-600: #A1A1AA;
  --gray-700: #C4C4CC;

  --red:     #EF4444;
}

body.dark .nav { background: #121214; }
body.dark .form-select option { background: var(--surface); color: var(--text); }
body.dark .form-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A1A1AA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); }
body.dark .form-input[type="date"] { color-scheme: dark; }
body.dark .nav-links a:hover,
body.dark .nav-links a.active { color: var(--text); background: rgba(147,51,234,0.18); }

/* ─── Theme toggle ───────────────────────────────────────────────── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--gray-600);
  font-size: 1rem;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--hover-border); background: var(--hover-tint); }
.nav-theme-toggle { display: none; }

/* ─── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }

/* ─── Nav ────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.nav-logo-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
}

.orb-logo-img { width: 28px; height: 28px; object-fit: contain; }
.nav-logo-text { font-family: 'Audiowide', var(--font-display); font-size: 1.125rem; color: var(--text); white-space: nowrap; }
.nav-logo-text .nav-logo-bold { font-weight: 700; }
.nav-logo-text .nav-logo-light { font-weight: 400; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--gray-600);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  letter-spacing: 0.01em;
}

.nav-links a:hover { color: var(--text); background: var(--gray-100); }
.nav-links a.active { color: var(--purple-600); background: var(--gray-100); font-weight: 600; }

.nav-social { display: flex; align-items: center; gap: 0.5rem; }
.nav-social a { color: var(--gray-600); transition: var(--transition); display: flex; align-items: center; padding: 0.3rem; border-radius: var(--radius-sm); }
.nav-social a:hover { color: var(--purple-500); background: var(--hover-tint); }
.nav-social svg { width: 17px; height: 17px; fill: currentColor; }

/* ─── Page Shell ─────────────────────────────────────────────────── */
.page { min-height: calc(100vh - 60px); }

.container { max-width: 1360px; margin: 0 auto; padding: 0 2rem; }

/* ─── App layout (sidebar + content) ────────────────────────────── */
.app-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

/* ─── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #FFFFFF;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.25s ease;
}

body.dark .sidebar { background: var(--surface); border-right-color: var(--border); }

.sidebar-inner {
  padding: 1rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-footer {
  margin-top: auto;
  padding: 0.75rem 0.85rem 0;
  border-top: 1px solid var(--border);
}

.sidebar-nav { display: flex; flex-direction: column; gap: 0.25rem; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--gray-600);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.sidebar-link:hover {
  color: var(--text);
  background: var(--gray-100);
}

.sidebar-link.active {
  color: var(--purple-600);
  background: var(--gray-100);
  font-weight: 600;
  border-left: 3px solid var(--purple-600);
  padding-left: calc(0.85rem - 3px);
}

.sidebar-link.soon {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.sidebar-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-icon svg { width: 20px; height: 20px; stroke: currentColor; }

.sidebar-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.sidebar-soon {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--gray-100);
  color: var(--gray-600);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-pill);
}

/* Main content area */
.sidebar-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 49;
}

.sidebar-overlay.open { display: block; }

/* Mobile toggle button */
.sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-600);
  flex-shrink: 0;
  transition: var(--transition);
}

.sidebar-toggle:hover { border-color: var(--hover-border); background: var(--hover-tint); }

.sidebar-toggle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

body.dark .sidebar-toggle { color: var(--text); }

/* ─── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--hover-border); box-shadow: var(--glow); }

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: none;
}

.btn-primary { background: var(--purple-600); color: white; }
.btn-primary:hover { background: var(--purple-500); box-shadow: var(--glow); }
.btn-ghost { background: transparent; color: var(--gray-600); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--hover-border); background: var(--hover-tint); }
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.75rem; }

/* ─── Tabs ───────────────────────────────────────────────────────── */
.tab-bar { display: flex; gap: 0.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.25rem; }
.tab-btn { flex: 1; padding: 0.45rem 1rem; border: none; background: transparent; color: var(--gray-600); font-family: var(--font-body); font-size: 0.875rem; font-weight: 600; border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); white-space: nowrap; }
.tab-btn.active { background: var(--purple-600); color: white; box-shadow: var(--glow); }
.tab-btn:hover:not(.active) { color: var(--text); background: var(--hover-tint); }

/* ─── Badges ─────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.badge-live    { background: rgba(239,68,68,0.12);   color: #B91C1C; border: 1px solid rgba(239,68,68,0.35); }
.badge-final   { background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--border); }
.badge-pre     { background: var(--gray-100); color: var(--purple-600); border: 1px solid var(--border); }
.badge-win     { background: rgba(16,185,129,0.12);  color: #065F46; border: 1px solid rgba(16,185,129,0.35); min-width: 3.25rem; justify-content: center; }
.badge-loss    { background: rgba(239,68,68,0.12);   color: #B91C1C; border: 1px solid rgba(239,68,68,0.35); min-width: 3.25rem; justify-content: center; }
.badge-push    { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.badge-pending { background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--border); }

body.dark .badge-win  { background: rgba(16,185,129,0.18); color: #6EE7B7; border-color: rgba(52,211,153,0.45); }
body.dark .badge-loss { background: rgba(239,68,68,0.18);  color: #FCA5A5; border-color: rgba(239,68,68,0.45); }
body.dark .badge-live { background: rgba(239,68,68,0.18);  color: #FCA5A5; border-color: rgba(239,68,68,0.45); }

/* ─── Live dot ───────────────────────────────────────────────────── */
.live-dot { display: inline-block; width: 7px; height: 7px; background: var(--red); border-radius: 50%; animation: pulse-dot 1.4s ease-in-out infinite; margin-right: 4px; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }

/* ─── Section heading ────────────────────────────────────────────── */
.section-label { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; color: var(--purple-600); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.4rem; }
.section-title { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1.15; letter-spacing: -0.01em; }

/* ─── Forms ──────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { font-size: 0.75rem; font-weight: 600; color: var(--gray-600); letter-spacing: 0.04em; text-transform: uppercase; }

.form-input, .form-select {
  background-color: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.875rem;
  padding: 0.6rem 0.9rem;
  transition: var(--transition);
  width: 100%;
  outline: none;
}
.form-input:focus, .form-select:focus { border-color: var(--purple-500); box-shadow: 0 0 0 3px rgba(109,40,217,0.08); background-color: var(--surface); }
.form-select option { background: var(--surface); color: var(--text); }

.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2.25rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 14px;
}

.form-input[type="date"] {
  color-scheme: light;
  cursor: pointer;
}
.form-input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px;
  transition: var(--transition);
}
.form-input[type="date"]::-webkit-calendar-picker-indicator:hover {
  background: var(--hover-tint);
}

/* ─── Table ──────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; color: var(--gray-600); letter-spacing: 0.08em; text-transform: uppercase; padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); background: var(--gray-50); }
.data-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }

/* ─── Stat card ──────────────────────────────────────────────────── */
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; display: flex; flex-direction: column; gap: 0.35rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.stat-card .stat-label { font-family: var(--font-mono); font-size: 0.75rem; color: var(--gray-600); letter-spacing: 0.08em; text-transform: uppercase; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-card .stat-sub { font-size: 0.8125rem; color: var(--gray-600); }
.stat-positive { color: var(--green); }
.stat-negative { color: var(--red); }
.stat-neutral  { color: var(--text); }

/* ─── Empty state ────────────────────────────────────────────────── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem; padding: 3rem 1.5rem; color: var(--gray-600); text-align: center; }
.empty-state svg { opacity: 0.35; }
.empty-state p { font-size: 0.875rem; }

/* ─── Spinner ────────────────────────────────────────────────────── */
.spinner { display: inline-block; width: 22px; height: 22px; border: 2px solid var(--border); border-top-color: var(--purple-500); border-radius: 50%; animation: spin 0.75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 0.75rem; padding: 3rem; color: var(--gray-600); font-size: 0.875rem; }

/* ─── Footer ─────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); padding: 1.5rem 2rem; text-align: center; color: var(--gray-600); font-size: 0.8125rem; margin-top: 4rem; }

/* ─── Site-wide disclaimer ───────────────────────────────────────── */
.disclaimer-block {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin-top: 3rem;
}
body.dark .disclaimer-block { background: var(--gray-100); }
.disclaimer-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-600);
  margin-bottom: 0.75rem;
}
.disclaimer-text { font-size: 0.8125rem; line-height: 1.65; color: var(--gray-600); }
.disclaimer-text p + p { margin-top: 0.75rem; }

/* ─── Email Signup ───────────────────────────────────────────────── */
.email-signup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin: 2rem 0;
  min-height: 280px;
  align-items: stretch;
}
.email-signup-sponsor {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}
.email-signup-sponsor img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.email-signup-cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.75rem 2.5rem;
  text-align: center;
  gap: 0;
}
.email-signup-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple-600);
  margin-bottom: 0.6rem;
}
@media (max-width: 768px) {
  .email-signup { grid-template-columns: 1fr; min-height: unset; }
  .email-signup-sponsor { min-height: 200px; }
  .email-signup-cta { padding: 2rem 1.5rem; }
}
.email-signup-title { font-family: var(--font-display); font-size: 1.75rem; font-weight: 800; color: var(--text); margin-bottom: 0.5rem; line-height: 1.15; }
.email-signup-sub { font-size: 0.875rem; color: var(--muted); margin-bottom: 1.5rem; max-width: 320px; line-height: 1.55; }
.email-signup-form { display: flex; gap: 0.5rem; max-width: 420px; margin: 0 auto; }
.email-signup-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.875rem;
  padding: 0.6rem 1rem;
  outline: none;
  transition: var(--transition);
}
.email-signup-input::placeholder { color: var(--muted); }
.email-signup-input:focus { border-color: var(--purple-600); background: var(--surface); }
.email-signup-btn { background: var(--purple-600); color: white; border: none; border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 0.875rem; font-weight: 700; padding: 0.6rem 1.25rem; cursor: pointer; white-space: nowrap; transition: var(--transition); text-decoration: none; display: inline-flex; align-items: center; }
.email-signup-btn:hover { opacity: 0.85; }
.email-signup-disclaimer { font-size: 0.75rem; color: var(--muted); margin-top: 0.75rem; }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav {
    padding: 0 0.75rem;
    padding-top: max(0.65rem, env(safe-area-inset-top, 0px));
    height: 68px;
  }
  .nav-links { display: none; }
  .container { padding: 0 1rem; }
  .section-title { font-size: 1.5rem; }
  .nav-logo-text { font-size: 1.125rem; }
  .orb-logo-img { width: 22px; height: 22px; }
  .nav-social { display: none; }
  .nav-theme-toggle { display: flex; }
  .sidebar-footer { display: none; }
  .email-signup-form { flex-direction: column; }
  .email-signup-input { width: 100%; }

  /* Sidebar mobile */
  .sidebar {
    position: fixed;
    top: 68px;
    left: 0;
    height: calc(100vh - 68px);
    transform: translateX(-100%);
    z-index: 50;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }

  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .sidebar-content { width: 100%; }
}
