/*
 * DuoMind design tokens: the one place for colors, type, spacing, radii, sizes and shadows.
 * Used by the twin app (src/renderer, imported in main.css) and the admin dashboard (served by
 * the server at /design/tokens.css). Pages use these variables only, never raw values.
 *
 * The interface is dark only.
 */
:root {
  color-scheme: dark;

  /* ── Background and surfaces ─────────────────────────────────────────── */
  --color-bg: #0f172a;                         /* page / window background */
  --color-bg-raised: #1e293b;                  /* top of the window gradient */
  --color-surface: #1e2540;                    /* cards, dialogs (top) */
  --color-surface-2: #161b30;                  /* cards, dialogs (bottom) */
  --color-sunken: rgba(15, 23, 42, 0.55);      /* inputs, boxes inside a card */
  --color-sunken-soft: rgba(15, 23, 42, 0.38);
  --color-sunken-strong: rgba(15, 23, 42, 0.78);
  --color-code-bg: rgba(2, 6, 23, 0.82);       /* code and command boxes */
  --color-backdrop: rgba(8, 12, 26, 0.65);     /* behind dialogs */
  --color-overlay-soft: rgba(255, 255, 255, 0.06);
  --color-overlay: rgba(255, 255, 255, 0.14);
  --color-overlay-strong: rgba(255, 255, 255, 0.3);
  --color-shadow: rgba(0, 0, 0, 0.45);

  --gradient-window: linear-gradient(180deg, var(--color-bg-raised) 0%, var(--color-bg) 100%);
  --gradient-surface: linear-gradient(180deg, var(--color-surface), var(--color-surface-2));

  /* ── Text ────────────────────────────────────────────────────────────── */
  --color-text-strong: #ffffff;                /* on primary buttons, active items */
  --color-text: #f1f5f9;                       /* titles, main text */
  --color-text-2: #cbd5e1;                     /* body text */
  --color-text-muted: #94a3b8;                 /* labels, secondary text */
  --color-text-faint: #64748b;                 /* hints, placeholders, timestamps */

  /* ── Lines ───────────────────────────────────────────────────────────── */
  --color-border: rgba(148, 163, 184, 0.14);   /* separators, quiet borders */
  --color-border-input: rgba(148, 163, 184, 0.22);
  --color-neutral-soft: rgba(148, 163, 184, 0.12); /* neutral badges, tracks */
  --color-neutral-strong: rgba(148, 163, 184, 0.4);

  /* ── Brand (indigo) ──────────────────────────────────────────────────── */
  --color-primary: #6366f1;
  --color-primary-hover: #818cf8;
  --color-primary-strong: #4f46e5;
  --color-primary-text: #a5b4fc;               /* indigo text on dark */
  --color-primary-text-2: #c7d2fe;
  --color-primary-text-3: #e0e7ff;
  --color-primary-subtle: rgba(99, 102, 241, 0.08);
  --color-primary-soft: rgba(99, 102, 241, 0.14);
  --color-primary-muted: rgba(99, 102, 241, 0.22);
  --color-primary-border: rgba(129, 140, 248, 0.28);
  --color-primary-border-strong: rgba(129, 140, 248, 0.45);
  --color-primary-glow: rgba(99, 102, 241, 0.35);
  --gradient-primary: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  --gradient-primary-soft: linear-gradient(135deg, var(--color-primary-muted), var(--color-primary-soft));

  /* Second brand color (violet / pink), for the logo, the avatar ring and "you" labels */
  --color-accent: #a855f7;
  --color-accent-strong: #7c3aed;
  --color-accent-text: #c4b5fd;
  --color-accent-pink: #d946ef;
  --color-accent-pink-text: #f0abfc;
  --color-accent-soft: rgba(168, 85, 247, 0.14);
  --color-accent-pink-soft: rgba(217, 70, 239, 0.14);
  --color-accent-border: rgba(168, 85, 247, 0.32);
  --color-accent-glow: rgba(168, 85, 247, 0.55);
  --gradient-brand: linear-gradient(135deg, var(--color-primary), var(--color-accent));

  /* ── States ──────────────────────────────────────────────────────────── */
  --color-success: #4ade80;
  --color-success-strong: #059669;
  --color-success-text: #86efac;
  --color-success-soft: rgba(74, 222, 128, 0.12);
  --color-success-border: rgba(74, 222, 128, 0.28);
  --color-success-glow: rgba(74, 222, 128, 0.6);

  --color-warning: #fbbf24;
  --color-warning-strong: #d97706;
  --color-warning-text: #fcd34d;
  --color-warning-soft: rgba(251, 191, 36, 0.12);
  --color-warning-border: rgba(251, 191, 36, 0.28);
  --color-warning-glow: rgba(251, 191, 36, 0.6);

  --color-error: #f87171;
  --color-error-strong: #dc2626;
  --color-error-text: #fca5a5;
  --color-error-text-2: #fecaca;
  --color-error-soft: rgba(239, 68, 68, 0.12);
  --color-error-border: rgba(239, 68, 68, 0.32);
  --color-error-glow: rgba(239, 68, 68, 0.55);

  --color-info: #38bdf8;
  --color-info-strong: #0284c7;
  --color-info-text: #7dd3fc;
  --color-info-text-2: #e0f2fe;
  --color-info-soft: rgba(56, 189, 248, 0.14);
  --color-info-border: rgba(56, 189, 248, 0.35);
  --color-info-glow: rgba(56, 189, 248, 0.7);

  /* ── Typography ──────────────────────────────────────────────────────── */
  --font-family: 'Segoe UI', 'Cairo', 'Tajawal', Tahoma, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: Consolas, 'Cascadia Mono', 'Courier New', monospace;

  --text-2xs: 10px;    /* tiny captions, counters */
  --text-xs: 11px;     /* hints, timestamps, badges */
  --text-sm: 12px;     /* secondary text, small buttons */
  --text-base: 13px;   /* body text, inputs, buttons */
  --text-md: 14px;     /* card titles */
  --text-lg: 15px;     /* section titles */
  --text-xl: 18px;     /* window titles */
  --text-2xl: 22px;    /* page titles */
  --text-3xl: 26px;    /* large numbers */
  --text-display: 36px; /* code input, hero */

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;

  /* ── Spacing (4px grid) ──────────────────────────────────────────────── */
  --space-0-5: 2px;
  --space-1: 4px;
  --space-1-5: 6px;
  --space-2: 8px;
  --space-2-5: 10px;
  --space-3: 12px;
  --space-3-5: 14px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* ── Radii: steps down from the window frame (22px) ──────────────────── */
  --radius-xs: 4px;     /* tiny marks, scrollbars */
  --radius-sm: 6px;     /* chips inside controls, tags */
  --radius-md: 10px;    /* buttons, inputs */
  --radius-lg: 14px;    /* boxes inside cards */
  --radius-xl: 18px;    /* cards, dialogs */
  --radius-window: 22px; /* the app window, the admin panels' outer frame */
  --radius-full: 999px; /* pills, circles */

  /* Which radius goes where:
     every rectangular control (buttons of all sizes, inputs, selects, filter chips) .. --radius-control
     round icon buttons (window controls, mic) ......................................... --radius-full
     badges and states (not clickable) .................................................. --radius-full
     a group of options (segmented switch) .. --radius-lg outside, --radius-control inside
     cards and dialogs .. --radius-xl;  the window .. --radius-window */
  --radius-control: var(--radius-md);

  /* ── Control sizes (buttons and inputs share them) ───────────────────── */
  --control-h-sm: 26px;
  --control-h: 32px;
  --control-h-lg: 40px;
  --control-px-sm: var(--space-2-5);
  --control-px: var(--space-3-5);
  --control-px-lg: var(--space-4);
  --icon-size-sm: 14px;
  --icon-size: 16px;
  --icon-size-lg: 20px;
  --icon-stroke: 2;

  /* ── Effects ─────────────────────────────────────────────────────────── */
  --shadow-sm: 0 4px 12px var(--color-shadow);
  --shadow-md: 0 12px 30px var(--color-shadow);
  --shadow-lg: 0 20px 50px var(--color-shadow);
  --glow-primary: 0 0 24px var(--color-primary-soft);
  --shadow-primary: 0 4px 14px var(--color-primary-glow);
  --focus-ring: 0 0 0 3px var(--color-primary-muted);
  --focus-ring-error: 0 0 0 3px var(--color-error-soft);

  --duration-fast: 0.15s;
  --duration: 0.2s;
  --duration-slow: 0.3s;
  --ease: ease;
  --blur: blur(6px);

  --z-dropdown: 50;
  --z-modal: 1000;
  --z-toast: 1100;
}
