/* CSS Variables - Theme configuration */

:root {
    /* Colors - Base */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;
    
    --primary-color: var(--primary-500);
    --primary-light: var(--primary-400);
    --primary-dark: var(--primary-600);
    --primary-color-rgb: 99, 102, 241;

    --success-color: #10b981;
    --success-light: #34d399;
    --success-dark: #059669;
    --success-color-rgb: 16, 185, 129;

    --error-color: #ef4444;
    --error-light: #f87171;
    --error-dark: #dc2626;
    --error-color-rgb: 239, 68, 68;

    --warning-color: #f59e0b;
    --warning-light: #fbbf24;
    --warning-dark: #d97706;
    --warning-color-rgb: 245, 158, 11;

    /* Colors - Background */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-elevated: #334155;
    --bg-primary-rgb: 15, 23, 42;

    /* Colors - Text */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;

    /* Colors - Forms */
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-text: var(--text-primary);
    --input-placeholder: var(--text-tertiary);
    --focus-ring-color: var(--primary-color);
    --focus-ring-color-rgb: var(--primary-color-rgb);

    /* Typography */
    --font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
    --font-family-mono: ui-monospace, SFMono-Regular, Menlo, 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: 1.875rem; /* 30px */
    --font-size-4xl: 2.25rem;  /* 36px */

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

    /* Line Heights */
    --line-height-none: 1;
    --line-height-tight: 1.25;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;

    /* Spacing */
    --spacing-xs: 0.25rem;   /* 4px */
    --spacing-sm: 0.5rem;    /* 8px */
    --spacing-md: 1rem;      /* 16px */
    --spacing-lg: 1.5rem;    /* 24px */
    --spacing-xl: 2rem;      /* 32px */
    --spacing-2xl: 3rem;     /* 48px */
    --spacing-3xl: 4rem;     /* 64px */
    --spacing-4xl: 6rem;     /* 96px */

    /* Border Radius */
    --border-radius-sm: 0.25rem;  /* 4px */
    --border-radius: 0.5rem;      /* 8px */
    --border-radius-lg: 1rem;     /* 16px */
    --border-radius-xl: 1.5rem;   /* 24px */

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Z-Index Scale */
    --z-0: 0;
    --z-10: 10;
    --z-20: 20;
    --z-30: 30;
    --z-40: 40;
    --z-50: 50;

    /* Z-Index Elements */
    --z-header: 1000;
    --z-dropdown: 1500;
    --z-modal: 2000;
    --z-notification: 2500;
    --z-toast: 3000;
    --z-tooltip: 4000;
    --z-overlay: 1900;

    /* Modal */
    --modal-bg: var(--bg-secondary);
    --modal-border: var(--header-border);
    --modal-shadow: var(--shadow-xl);
    --modal-overlay: rgba(0, 0, 0, 0.75);

    /* Notifications */
    --notification-success-bg: rgba(var(--success-color-rgb), 0.1);
    --notification-error-bg: rgba(var(--error-color-rgb), 0.1);
    --notification-border: var(--header-border);
    --notification-shadow: var(--shadow-lg);
    
    /* Header Specific */
    --header-height: 64px;
    --header-bg: rgba(15, 23, 42, 0.95);
    --header-border: rgba(255, 255, 255, 0.1);

    /* Layout */
    --header-height: 64px;
    --max-width: 1280px;
    --sidebar-width: 280px;

    /* Container Max Widths */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;

    /* Grid */
    --grid-gap: var(--spacing-md);
    --grid-columns: 12;

    /* Forms */
    --input-height: 48px;
    --input-padding: 0.875rem 1rem;
    --input-radius: var(--border-radius);
    --input-shadow: var(--shadow-sm);
}

/* Dark Theme Overrides */
@media (prefers-color-scheme: dark) {
    :root {
        /* Already dark theme by default */
    }
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-elevated: #f1f5f9;
    --bg-primary-rgb: 255, 255, 255;

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-tertiary: #64748b;

    --input-bg: #ffffff;
    --input-border: #e2e8f0;
}

/* High Contrast Mode */
@media (forced-colors: active) {
    :root {
        --primary-color: Highlight;
        --primary-light: Highlight;
        --primary-dark: Highlight;
        
        --success-color: Mark;
        --error-color: Mark;
        --warning-color: Mark;
        
        --bg-primary: Canvas;
        --bg-secondary: Canvas;
        --bg-elevated: Canvas;
        
        --text-primary: CanvasText;
        --text-secondary: CanvasText;
        --text-tertiary: GrayText;
        
        --input-bg: Field;
        --input-border: ButtonText;
        --input-text: FieldText;
        
        --focus-ring-color: Highlight;
    }
}

/* Print */
@media print {
    :root {
        --bg-primary: #ffffff;
        --bg-secondary: #ffffff;
        --bg-elevated: #ffffff;
        
        --text-primary: #000000;
        --text-secondary: #333333;
        --text-tertiary: #666666;
        
        --shadow-sm: none;
        --shadow: none;
        --shadow-lg: none;
        --shadow-xl: none;
    }
}
