/* ═══════════════════════════════════════════════════════════════
   tokens.css — ZenAlert Design System Tokens
   All colors, typography, spacing, motion, and severity scales.
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ── Base palette (Linear/Vercel style dark mode) ─────── */
  --bg-deepest:    #000000;
  --bg-deep:       #0A0A0A;
  --bg-base:       #111111;
  --bg-elevated:   #1A1A1A;
  --bg-surface:    #222222;
  --bg-hover:      #2A2A2A;
  --bg-glass:      rgba(10, 10, 10, 0.7);
  --bg-glass-strong: rgba(0, 0, 0, 0.85);

  /* ── Border / hairline ────────────────────────────────── */
  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.12);
  --border-strong:  rgba(255, 255, 255, 0.20);
  --border-accent:  rgba(94, 234, 198, 0.4);

  /* ── Text ─────────────────────────────────────────────── */
  --text-primary:   #EDEDED;
  --text-secondary: #A1A1AA;
  --text-tertiary:  #71717A;
  --text-muted:     #52525B;
  --text-inverse:   #000000;

  /* ── Primary accent (electric mint) ──────────────────── */
  --accent:         #5EEAC6;
  --accent-bright:  #87F2D8;
  --accent-dim:     #2D9E82;
  --accent-bg:      rgba(94, 234, 198, 0.1);
  --accent-bg-strong: rgba(94, 234, 198, 0.15);

  /* ── Severity colors (colorblind-safe) ────────────────── */
  --severity-normal:   #22C55E;
  --severity-watch:    #F59E0B;
  --severity-high:     #F97316;
  --severity-critical: #EF4444;
  --severity-offline:  #71717A;

  --severity-normal-bg:   rgba(34, 197, 94, 0.12);
  --severity-watch-bg:    rgba(245, 158, 11, 0.12);
  --severity-high-bg:     rgba(249, 115, 22, 0.12);
  --severity-critical-bg: rgba(239, 68, 68, 0.12);
  --severity-offline-bg:  rgba(113, 113, 122, 0.12);

  --severity-normal-border:   rgba(34, 197, 94, 0.3);
  --severity-watch-border:    rgba(245, 158, 11, 0.3);
  --severity-high-border:     rgba(249, 115, 22, 0.3);
  --severity-critical-border: rgba(239, 68, 68, 0.3);
  --severity-offline-border:  rgba(113, 113, 122, 0.3);

  /* ── Typography ───────────────────────────────────────── */
  --font-heading:  'Inter', system-ui, sans-serif;
  --font-body:     'Inter', system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  --text-xs:   0.75rem;     /* 12px */
  --text-sm:   0.875rem;    /* 14px */
  --text-base: 1rem;        /* 16px */
  --text-md:   1.125rem;    /* 18px */
  --text-lg:   1.25rem;     /* 20px */
  --text-xl:   1.5rem;      /* 24px */
  --text-2xl:  2rem;        /* 32px */
  --text-3xl:  2.5rem;      /* 40px */
  --text-4xl:  3.5rem;      /* 56px */

  --leading-tight:  1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.6;
  --tracking-heading: -0.02em;
  --tracking-body: -0.01em;
  --tracking-mono: 0em;

  --weight-regular: 400;
  --weight-medium:  500;
  --weight-semi:    600;

  /* ── Spacing (8px grid) ───────────────────────────────── */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

  /* ── Radii ────────────────────────────────────────────── */
  --radius-xs:  4px;
  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* ── Shadows (Linear/Vercel style, crisp) ────────────── */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.5);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 30px rgba(0,0,0,0.6);
  --shadow-xl:  0 20px 40px rgba(0,0,0,0.7);
  --shadow-glow: 0 0 24px rgba(94, 234, 198, 0.2);
  --shadow-critical: 0 0 24px rgba(239, 68, 68, 0.25);

  /* ── Motion ───────────────────────────────────────────── */
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:  cubic-bezier(0.65, 0, 0.35, 1);

  --duration-fast:    150ms;
  --duration-normal:  250ms;
  --duration-slow:    400ms;

  /* ── Layout ───────────────────────────────────────────── */
  --sidebar-width:     240px;
  --topbar-height:     56px;
  --max-content-width: 1200px;

  /* ── Z-index ──────────────────────────────────────────── */
  --z-base:     1;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
  --z-toast:    500;
  --z-loader:   600;
}

/* ── Light theme overrides ─────────────────────────────────── */
[data-theme="light"] {
  --bg-deepest:    #FAFAFA;
  --bg-deep:       #F4F4F5;
  --bg-base:       #FFFFFF;
  --bg-elevated:   #FFFFFF;
  --bg-surface:    #FAFAFA;
  --bg-hover:      #F4F4F5;
  --bg-glass:      rgba(255, 255, 255, 0.7);
  --bg-glass-strong: rgba(255, 255, 255, 0.9);

  --border-subtle:  rgba(0, 0, 0, 0.05);
  --border-default: rgba(0, 0, 0, 0.1);
  --border-strong:  rgba(0, 0, 0, 0.15);
  --border-accent:  rgba(13, 148, 120, 0.3);

  --text-primary:   #09090B;
  --text-secondary: #52525B;
  --text-tertiary:  #71717A;
  --text-muted:     #A1A1AA;
  --text-inverse:   #FFFFFF;

  --accent:         #0D9478;
  --accent-bright:  #10B981;
  --accent-dim:     #047857;
  --accent-bg:      rgba(13, 148, 120, 0.1);
  --accent-bg-strong: rgba(13, 148, 120, 0.15);

  --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.05);
  --shadow-lg:  0 8px 30px rgba(0,0,0,0.08);
  --shadow-xl:  0 20px 40px rgba(0,0,0,0.1);
  --shadow-glow: 0 0 24px rgba(13, 148, 120, 0.15);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
