/**
 * SmartQuant Design System
 * CSS Variables and Design Tokens
 * Implements 8px grid system and consistent color palette
 */

:root {
    /* ========================================
       COLOR PALETTE - LIGHT MODE (Default)
       ======================================== */
    
    /* Primary Colors */
    --color-primary: #1e40af;        /* Professional blue - trust, stability */
    --color-primary-hover: #1e3a8a;
    --color-primary-light: #3b82f6;
    --color-primary-dark: #1e3a8a;
    
    /* Secondary Colors */
    --color-secondary: #10b981;      /* Green accent for CTAs */
    --color-secondary-hover: #059669;
    --color-secondary-light: #34d399;
    --color-secondary-dark: #047857;
    
    /* Semantic Colors */
    --color-success: #059669;        /* Profits, gains */
    --color-warning: #f59e0b;        /* Alerts, caution */
    --color-danger: #dc2626;         /* Risk, losses */
    --color-info: #3b82f6;           /* Information */
    
    /* Neutral Colors - Light Mode */
    --color-bg-primary: #ffffff;     /* Page background */
    --color-bg-secondary: #f9fafb;   /* Light gray surface */
    --color-bg-tertiary: #f3f4f6;    /* Even lighter gray */
    --color-bg-card: #ffffff;        /* Card backgrounds */
    
    /* Text Colors - Light Mode */
    --color-text-primary: #111827;   /* Near black - high contrast */
    --color-text-secondary: #6b7280; /* Gray for less important */
    --color-text-tertiary: #9ca3af;  /* Lighter gray */
    --color-text-disabled: #d1d5db;  /* Disabled text */
    --color-text-inverse: #ffffff;   /* White text on dark backgrounds */
    
    /* Border Colors */
    --color-border: #e5e7eb;         /* Light gray borders */
    --color-border-dark: #d1d5db;
    --color-border-light: #f3f4f6;
    
    /* ========================================
       TYPOGRAPHY SYSTEM
       ======================================== */
    
    /* Font Families */
    --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-family-mono: 'SF Mono', 'Monaco', 'Consolas', monospace;
    
    /* Font Sizes */
    --font-size-xs: 0.75rem;       /* 12px */
    --font-size-sm: 0.875rem;      /* 14px */
    --font-size-base: 1rem;        /* 16px */
    --font-size-lg: 1.125rem;      /* 18px */
    --font-size-xl: 1.25rem;       /* 20px */
    --font-size-2xl: 1.5rem;       /* 24px */
    --font-size-3xl: 2rem;         /* 32px */
    --font-size-4xl: 2.5rem;       /* 40px */
    --font-size-5xl: 3rem;         /* 48px */
    
    /* Font Weights */
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    
    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* ========================================
       SPACING SYSTEM (8px Grid)
       ======================================== */
    
    --space-1: 0.5rem;   /* 8px */
    --space-2: 1rem;     /* 16px */
    --space-3: 1.5rem;   /* 24px */
    --space-4: 2rem;     /* 32px */
    --space-5: 2.5rem;   /* 40px */
    --space-6: 3rem;     /* 48px */
    --space-8: 4rem;     /* 64px */
    --space-10: 5rem;    /* 80px */
    --space-12: 6rem;    /* 96px */
    
    /* ========================================
       BORDER RADIUS
       ======================================== */
    
    --radius-sm: 0.25rem;   /* 4px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-full: 9999px;  /* Fully rounded */
    
    /* ========================================
       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), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* ========================================
       Z-INDEX LAYERS
       ======================================== */
    
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    
    /* ========================================
       TRANSITIONS
       ======================================== */
    
    --transition-fast: 150ms ease-in-out;
    --transition-base: 200ms ease-in-out;
    --transition-slow: 300ms ease-in-out;
    
    /* ========================================
       BREAKPOINTS (for JavaScript use)
       ======================================== */
    
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
}

/* ========================================
   DARK MODE VARIABLES
   ======================================== */

[data-theme="dark"] {
    /* Primary Colors (adjusted for dark mode) */
    --color-primary: #60a5fa;        /* Lighter blue for dark bg */
    --color-primary-hover: #3b82f6;
    
    /* Secondary Colors */
    --color-secondary: #34d399;      /* Lighter green */
    --color-secondary-hover: #10b981;
    
    /* Semantic Colors (adjusted contrast) */
    --color-success: #10b981;
    --color-warning: #fbbf24;
    --color-danger: #f87171;
    --color-info: #60a5fa;
    
    /* Neutral Colors - Dark Mode */
    --color-bg-primary: #0f172a;     /* Dark blue-gray (NOT pure black) */
    --color-bg-secondary: #1e293b;   /* Slightly lighter */
    --color-bg-tertiary: #334155;    /* Even lighter */
    --color-bg-card: #1e293b;        /* Card backgrounds */
    
    /* Text Colors - Dark Mode */
    --color-text-primary: #f1f5f9;   /* Off-white (NOT pure white) */
    --color-text-secondary: #94a3b8; /* Muted */
    --color-text-tertiary: #64748b;  /* More muted */
    --color-text-disabled: #475569;  /* Disabled text */
    --color-text-inverse: #0f172a;   /* Dark text on light backgrounds */
    
    /* Border Colors - Dark Mode */
    --color-border: #475569;         /* Subtle in dark mode */
    --color-border-dark: #334155;
    --color-border-light: #1e293b;
    
    /* Shadows - Dark Mode (more subtle) */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* ========================================
   GLOBAL RESETS
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
}

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

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

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

.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }
.text-disabled { color: var(--color-text-disabled); }

/* ========================================
   RESPONSIVE TYPOGRAPHY
   ======================================== */

@media (max-width: 768px) {
    :root {
        --font-size-3xl: 1.75rem;  /* 28px on mobile */
        --font-size-4xl: 2rem;     /* 32px on mobile */
        --font-size-5xl: 2.5rem;   /* 40px on mobile */
    }
}
