/* ============================================
   TheBigBoard — Unified Design System
   Single source of truth for all pages
   ============================================

   ACCENT COLOR DECISION: Amber #f59e0b (SCIF identity)
   -------------------------------------------------
   Rationale:
   1. SCIF aesthetic — amber signals operational
      intelligence, urgency, and classified-system UX.
   2. Consistency — the landing page established amber
      as the brand accent. All pages now follow this.
   3. WCAG AA — #f59e0b on #060608 yields sufficient
      contrast for headings and interactive elements.
   4. Green (#22c55e) = live/active states only.
      Red (#dc2626) = critical/alerts only.
      Amber = primary UI accent across all pages.

   MIGRATION NOTES
   -------------------------------------------------
   - This file replaces the :root blocks in both
     shell.css and dashboard.css.
   - Page-specific CSS (battlefield.css, iran.css, etc.)
     should reference these variables and may define
     page-scoped overrides with --page-* prefixes.
   - Drop Roboto everywhere. Inter = UI, IBM Plex Mono = data.
   ============================================ */

/* === CORE PALETTE === */
:root {
  /* Backgrounds — SCIF-aligned dark palette */
  --bg-primary:      #060608;   /* deepest background (SCIF standard) */
  --bg-card:         #0c0c12;   /* card / surface fill */
  --bg-raised:       #14141e;   /* elevated surfaces (dropdowns, modals) */
  --bg-header:       #060608;   /* sticky header bar */
  --bg-strip:        #0c0c12;   /* status strip / secondary bars */

  /* Borders */
  --border:          #1a1a2e;
  --border-light:    #2a2a3e;
  --border-card:     #1a1a2e;   /* 1px card border — tight, consistent */

  /* Text hierarchy */
  --text-primary:    #e4e4e7;   /* headings, key values */
  --text-secondary:  #a1a1aa;   /* body text, descriptions */
  --text-muted:      #71717a;   /* labels, timestamps */
  --text-dim:        #52525b;   /* disabled, decorative */

  /* --- PRIMARY ACCENT: Amber (SCIF identity) --- */
  --accent:          #f59e0b;
  --accent-dim:      #92400e;
  --accent-bg:       rgba(245, 158, 11, 0.10);
  --accent-border:   rgba(245, 158, 11, 0.25);

  /* --- SECONDARY ACCENT: Amber (SCIF identity) --- */
  --accent-amber:        #f59e0b;
  --accent-amber-dim:    rgba(245, 158, 11, 0.15);
  --accent-amber-border: rgba(245, 158, 11, 0.25);

  /* --- SCIF DESIGN TOKENS --- */
  --scif-bg:         #060608;
  --scif-surface:    #0c0c12;
  --scif-border:     #1a1a2e;
  --scif-amber:      #f59e0b;
  --scif-amber-dim:  rgba(245, 158, 11, 0.15);
  --scif-red:        #dc2626;
  --scif-green:      #22c55e;
  --scif-yellow:     #eab308;
  --scif-text:       #e2e2e8;
  --scif-text-dim:   #7a7a8e;
  --scif-mono:       'IBM Plex Mono', 'Courier New', monospace;
  --scif-sans:       'Inter', system-ui, -apple-system, sans-serif;

  /* --- SEMANTIC COLORS --- */
  --color-critical:  #dc2626;   /* red — alerts, strikes, critical */
  --color-critical-dim: #991b1b;
  --color-critical-bg: rgba(220, 38, 38, 0.12);
  --color-critical-border: rgba(220, 38, 38, 0.25);

  --color-warning:   #f59e0b;   /* amber — warnings, escalating */
  --color-warning-dim: #92400e;
  --color-warning-bg: rgba(245, 158, 11, 0.12);
  --color-warning-border: rgba(245, 158, 11, 0.25);

  --color-success:   #22c55e;   /* green — confirmed, de-escalating */
  --color-success-dim: #166534;
  --color-success-bg: rgba(34, 197, 94, 0.12);
  --color-success-border: rgba(34, 197, 94, 0.25);

  --color-info:      #06b6d4;   /* cyan — maritime, straits */
  --color-info-bg:   rgba(6, 182, 212, 0.12);
  --color-info-border: rgba(6, 182, 212, 0.25);

  /* --- CATEGORY COLORS (datacards, feeds) --- */
  --cat-military:    #dc2626;
  --cat-maritime:    #06b6d4;
  --cat-aviation:    #38bdf8;
  --cat-economic:    #f59e0b;
  --cat-nuclear:     #8b5cf6;
  --cat-social:      #22c55e;
  --cat-diplomatic:  #3b82f6;
  --cat-humanitarian:#f97316;
  --cat-cyber:       #14b8a6;
  --cat-intel:       #8b5cf6;

  /* --- FORCE / FACTION COLORS --- */
  --force-allied:    #3b82f6;   /* blue — US/allied */
  --force-adversary: #dc2626;   /* red — adversary */
  --force-neutral:   #94a3b8;   /* grey — neutral / unknown */
  --force-iran:      #dc2626;
  --force-houthi:    #eab308;
  --force-pmf:       #a855f7;

  /* --- CONFIDENCE LEVELS --- */
  --confidence-high: #22c55e;
  --confidence-med:  #f59e0b;
  --confidence-low:  #ef4444;

  /* === TYPOGRAPHY === */
  --font-ui:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-data: 'IBM Plex Mono', 'Menlo', monospace;

  /* === LAYOUT TOKENS === */
  --card-radius:     8px;
  --radius-sm:       4px;
  --radius-lg:       12px;
  --gutter:          16px;
  --header-height:   50px;
  --strip-height:    40px;
  --mobile-bar-height: 56px;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);

  /* === RESPONSIVE BREAKPOINTS (reference only) ===
     Mobile:  max-width 390px  (small phone)
     Tablet:  max-width 768px  (portrait tablet / large phone)
     Desktop: max-width 1280px (compact desktop)
     Wide:    above 1280px
  */
}

/* === BASE RESET === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background: var(--bg-primary);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* === DATA / MONO TEXT === */
.mono,
[data-font="mono"] {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
}

/* === UNIFIED CARD === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--card-radius);
  overflow: hidden;
}

/* === UNIFIED BADGE === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
}

.badge--critical {
  background: var(--color-critical-bg);
  color: var(--color-critical);
  border: 1px solid var(--color-critical-border);
}

.badge--warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.badge--success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.badge--accent {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.badge--info {
  background: var(--color-info-bg);
  color: var(--color-info);
  border: 1px solid var(--color-info-border);
}

/* === SCROLLBAR GLOBAL === */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* === CRT SCANLINE OVERLAY === */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
}

/* === CLASSIFICATION BANNERS === */
.class-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  background: var(--scif-red);
  color: #fff;
  text-align: center;
  padding: 4px 16px;
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.class-banner-bottom {
  background: var(--scif-red);
  color: #fff;
  text-align: center;
  padding: 4px 16px;
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Push header below classification banner */
body.has-class-banner #tbb-header {
  top: 26px;
}

body.has-class-banner #tbb-content {
  padding-top: calc(var(--header-height) + 26px);
}

/* === SCIF SECTION HEADERS === */
.section-header {
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--scif-amber);
  border-bottom: 1px solid var(--scif-border);
  padding-bottom: 10px;
  margin-bottom: 24px;
}

/* === STATUS BADGES === */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

/* === ROADMAP TAGS === */
.roadmap-tag {
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  margin-right: 8px;
}

.tag-shipped  { background: rgba(34, 197, 94, 0.15); color: var(--scif-green); }
.tag-progress { background: var(--scif-amber-dim);    color: var(--scif-amber); }
.tag-planned  { background: rgba(122, 122, 142, 0.15); color: var(--scif-text-dim); }

/* === SOURCE CARDS === */
.source-card {
  background: var(--scif-surface);
  border: 1px solid var(--scif-border);
  border-radius: 4px;
  padding: 20px;
  transition: border-color 0.2s;
}

.source-card:hover {
  border-color: var(--scif-green);
}

.source-card-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.source-card-name {
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--scif-amber);
  margin-bottom: 6px;
}

.source-card-desc {
  font-size: 13px;
  color: var(--scif-text-dim);
  line-height: 1.5;
}

/* === SKELETON / LOADING === */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-raised) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-shine 1.5s ease-in-out infinite;
  border-radius: 3px;
  color: transparent !important;
}

@keyframes skeleton-shine {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === LIVE PULSE (reusable) === */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
  50%      { opacity: 0.6; box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}

@keyframes pulse-critical {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
  50%      { opacity: 0.6; box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

/* === RESPONSIVE GRID HELPERS === */
@media (max-width: 390px) {
  :root {
    --gutter: 10px;
  }
}

@media (max-width: 768px) {
  :root {
    --gutter: 12px;
  }
}
