/* ============================================================
   ISKRA DESIGN TOKENS
   A unified token system for the entire app.
   ============================================================ */

:root {
  /* ── Typography ─────────────────────────────────────────── */
  --font-display: 'Syne', 'Arial Black', sans-serif;
  --font-body:    'DM Sans', 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  --text-xs:   0.6875rem;  /* 11px */
  --text-sm:   0.8125rem;  /* 13px */
  --text-base: 0.9375rem;  /* 15px */
  --text-md:   1.0625rem;  /* 17px */
  --text-lg:   1.25rem;    /* 20px */
  --text-xl:   1.5rem;     /* 24px */
  --text-2xl:  2rem;       /* 32px */
  --text-3xl:  2.75rem;    /* 44px */

  --weight-normal:   400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --weight-black:    800;

  --leading-tight:  1.2;
  --leading-snug:   1.35;
  --leading-normal: 1.5;
  --leading-relaxed:1.65;

  /* ── Spacing ─────────────────────────────────────────────── */
  --space-1:  0.25rem;   /* 4px  */
  --space-2:  0.5rem;    /* 8px  */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-5:  1.25rem;   /* 20px */
  --space-6:  1.5rem;    /* 24px */
  --space-8:  2rem;      /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */

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

  /* ── Shadows ─────────────────────────────────────────────── */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.15);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.2);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.45), 0 4px 12px rgba(0,0,0,0.3);
  --shadow-xl:   0 20px 60px rgba(0,0,0,0.55);
  --shadow-glow: 0 0 24px rgba(var(--accent-rgb), 0.3);

  /* ── Animation Timing ────────────────────────────────────── */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-linear: linear;

  --duration-fast:   120ms;
  --duration-base:   200ms;
  --duration-slow:   350ms;
  --duration-slower: 500ms;

  /* ── Z-index ─────────────────────────────────────────────── */
  --z-base:    1;
  --z-sidebar: 10;
  --z-header:  20;
  --z-drawer:  30;
  --z-modal:   40;
  --z-toast:   50;
  --z-tooltip: 60;

  /* ── Layout ──────────────────────────────────────────────── */
  --sidebar-w:     360px;
  --header-h:      60px;
  --input-area-h:  64px;
  --touch-min:     44px;
  --msg-max-w:     72%;

  /* ── Breakpoints (used in JS too) ────────────────────────── */
  --bp-mobile: 640px;
  --bp-tablet: 1024px;
}

/* ── DARK THEME (default) ────────────────────────────────── */
[data-theme="dark"], :root {
  --bg-base:      #0a0b0f;
  --bg-surface:   #13141a;
  --bg-elevated:  #1c1d26;
  --bg-hover:     #22232e;
  --bg-active:    #282937;
  --bg-overlay:   rgba(0,0,0,0.7);

  --border-subtle: rgba(255,255,255,0.05);
  --border-soft:   rgba(255,255,255,0.09);
  --border-medium: rgba(255,255,255,0.13);

  --text-primary:   #eeeef5;
  --text-secondary: #8b8fa8;
  --text-muted:     #52566a;
  --text-inverse:   #0a0b0f;

  --accent:        #f59e0b;
  --accent-hover:  #fbbf24;
  --accent-muted:  rgba(245,158,11,0.15);
  --accent-rgb:    245,158,11;

  --msg-out-bg:    #1e3a5f;
  --msg-out-text:  #dbeafe;
  --msg-in-bg:     #1c1d26;
  --msg-in-text:   #eeeef5;

  --status-online:  #22c55e;
  --status-away:    #f59e0b;
  --status-offline: #52566a;

  --danger:        #ef4444;
  --danger-muted:  rgba(239,68,68,0.15);
  --success:       #22c55e;
  --success-muted: rgba(34,197,94,0.12);
  --warning:       #f59e0b;
  --info:          #3b82f6;
  --info-muted:    rgba(59,130,246,0.15);

  --skeleton-base:    #1c1d26;
  --skeleton-shimmer: #252635;

  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(255,255,255,0.08);
  --scrollbar-hover: rgba(255,255,255,0.14);
}

/* ── LIGHT THEME ─────────────────────────────────────────── */
[data-theme="light"] {
  --bg-base:      #f4f5f9;
  --bg-surface:   #ffffff;
  --bg-elevated:  #f9fafb;
  --bg-hover:     #f0f1f7;
  --bg-active:    #e8eaf3;
  --bg-overlay:   rgba(0,0,0,0.45);

  --border-subtle: rgba(0,0,0,0.05);
  --border-soft:   rgba(0,0,0,0.09);
  --border-medium: rgba(0,0,0,0.14);

  --text-primary:   #111827;
  --text-secondary: #4b5563;
  --text-muted:     #9ca3af;
  --text-inverse:   #ffffff;

  --accent:        #d97706;
  --accent-hover:  #b45309;
  --accent-muted:  rgba(217,119,6,0.12);
  --accent-rgb:    217,119,6;

  --msg-out-bg:    #1e40af;
  --msg-out-text:  #eff6ff;
  --msg-in-bg:     #f3f4f6;
  --msg-in-text:   #111827;

  --status-online:  #16a34a;
  --status-away:    #d97706;
  --status-offline: #9ca3af;

  --danger:        #dc2626;
  --danger-muted:  rgba(220,38,38,0.1);
  --success:       #16a34a;
  --success-muted: rgba(22,163,74,0.1);
  --warning:       #d97706;
  --info:          #2563eb;
  --info-muted:    rgba(37,99,235,0.1);

  --skeleton-base:    #e9eaf0;
  --skeleton-shimmer: #f0f1f7;

  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(0,0,0,0.1);
  --scrollbar-hover: rgba(0,0,0,0.18);

  --shadow-sm:   0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.07);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.14), 0 4px 12px rgba(0,0,0,0.08);
  --shadow-xl:   0 20px 60px rgba(0,0,0,0.18);
}

/* ── Accent Color Overrides ──────────────────────────────── */
[data-accent="violet"] {
  --accent:      #7c3aed;
  --accent-hover:#6d28d9;
  --accent-muted:rgba(124,58,237,0.15);
  --accent-rgb:  124,58,237;
}
[data-accent="rose"] {
  --accent:      #e11d48;
  --accent-hover:#be123c;
  --accent-muted:rgba(225,29,72,0.15);
  --accent-rgb:  225,29,72;
}
[data-accent="cyan"] {
  --accent:      #0891b2;
  --accent-hover:#0e7490;
  --accent-muted:rgba(8,145,178,0.15);
  --accent-rgb:  8,145,178;
}
[data-accent="emerald"] {
  --accent:      #059669;
  --accent-hover:#047857;
  --accent-muted:rgba(5,150,105,0.15);
  --accent-rgb:  5,150,105;
}
