/**
 * JayLex Design Tokens
 * Sprint 2: Design System Foundation
 * Single source of truth for typography, spacing, and colors
 */

:root {
    /* ===== TYPOGRAPHY SCALE ===== */
    /* 8-step modular scale for consistent text sizing */
    --text-xs: 0.75rem;      /* 12px - Small labels, captions */
    --text-sm: 0.875rem;     /* 14px - Secondary text, metadata */
    --text-base: 1rem;       /* 16px - Body text, default */
    --text-lg: 1.125rem;     /* 18px - Emphasized body, small headings */
    --text-xl: 1.25rem;      /* 20px - H4, card titles */
    --text-2xl: 1.5rem;      /* 24px - H3, section headings */
    --text-3xl: 2rem;        /* 32px - H2, page titles */
    --text-4xl: 3rem;        /* 48px - H1, hero text */

    /* Font weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* Line heights */
    --leading-tight: 1.25;   /* Headings */
    --leading-normal: 1.5;   /* Body text */
    --leading-relaxed: 1.75; /* Spaced content */

    /* ===== SPACING SCALE ===== */
    /* 8-step scale based on 4px base unit */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;
    --space-24: 96px;

    /* ===== COLOR SYSTEM ===== */
    /* Primary accent color */
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-light: #a78bfa;
    --accent-dark: #6d28d9;
    --accent-glow: rgba(139, 92, 246, 0.25);

    /* Background colors (preserved from existing system) */
    --bg-primary: #030014;
    --bg-secondary: rgba(17, 24, 39, 0.7);
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.08);

    /* Text colors (preserved from existing system) */
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    /* Semantic colors */
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --danger: #ef4444;
    --danger-light: #f87171;
    --info: #3b82f6;
    --info-light: #60a5fa;

    /* Border colors */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(139, 92, 246, 0.3);

    /* ===== BORDER RADIUS ===== */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* ===== SHADOWS ===== */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.5);

    /* ===== TRANSITIONS ===== */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ===== LIGHT THEME OVERRIDES ===== */
body.light-theme {
    /* Light mode colors */
    --bg-primary: #fdfcff;
    --bg-secondary: rgba(248, 250, 252, 0.9);
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #475569;

    --border-color: rgba(15, 23, 42, 0.18);
    --border-accent: rgba(139, 92, 246, 0.4);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.25);
}

/* ===== UTILITY CLASSES ===== */

/* Typography utilities */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }

.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

/* Spacing utilities */
.space-y-4 > * + * { margin-top: var(--space-4); }
.space-y-6 > * + * { margin-top: var(--space-6); }
.space-y-8 > * + * { margin-top: var(--space-8); }

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
