/**
 * Theme Variables - Design Tokens for Light & Dark Mode
 * Core design system with CSS custom properties
 */

:root {
    /* ===== Color System ===== */
    /* Primary Colors */
    --primary-50: #f3f4ff;
    --primary-100: #e3e7ff;
    --primary-200: #c7ceff;
    --primary-300: #a5acff;
    --primary-400: #8881ff;
    --primary-500: #5957f9;
    --primary-500-rgb: 89, 87, 249; /* RGB version for rgba() */
    --primary-600: #4a48d8;
    --primary-700: #3936b0;
    --primary-800: #2d2b8c;
    --primary-900: #1f1e5c;
    
    /* Accent Colors */
    --accent-coral: #ff6f61;
    --accent-teal: #00d4aa;
    --accent-purple: #a855f7;
    --accent-orange: #fb923c;
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* ===== Light Mode (Default) ===== */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-elevated: #ffffff;
    
    /* Glass morphism backgrounds */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-bg-strong: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(0, 0, 0, 0.1);
    
    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #6b7280;
    --text-muted: #9ca3af;
    --text-inverse: #ffffff;
    
    /* Border Colors */
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    --border-strong: #9ca3af;
    
    /* Shadow System */
    --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);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Glass shadow */
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    
    /* Overlay */
    --overlay-light: rgba(0, 0, 0, 0.4);
    --overlay-dark: rgba(0, 0, 0, 0.6);
    
    /* ===== Spacing System ===== */
    --space-1: 0.25rem;  /* 4px */
    --space-2: 0.5rem;   /* 8px */
    --space-3: 0.75rem;  /* 12px */
    --space-4: 1rem;     /* 16px */
    --space-5: 1.5rem;   /* 24px */
    --space-6: 2rem;     /* 32px */
    --space-8: 3rem;     /* 48px */
    --space-10: 4rem;    /* 64px */
    --space-12: 6rem;    /* 96px */
    
    /* ===== Typography ===== */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 'Courier New', monospace;
    
    /* Font Sizes */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.875rem;   /* 14px */
    --text-base: 1rem;     /* 16px */
    --text-lg: 1.125rem;   /* 18px */
    --text-xl: 1.25rem;    /* 20px */
    --text-2xl: 1.5rem;    /* 24px */
    --text-3xl: 1.875rem;  /* 30px */
    --text-4xl: 2.25rem;   /* 36px */
    --text-5xl: 3rem;      /* 48px */
    
    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    
    /* Line Heights */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;
    
    /* ===== Border Radius ===== */
    --radius-sm: 0.25rem;   /* 4px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-2xl: 1.5rem;   /* 24px */
    --radius-full: 9999px;
    
    /* ===== Transitions ===== */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* ===== Z-Index Scale ===== */
    --z-base: 1;
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    
    /* ===== Layout Constants ===== */
    --navbar-height: 70px;
    --navbar-height-mobile: 60px;
    --navbar-height-small: 55px;
    
    /* ===== Backdrop Blur ===== */
    --blur-sm: 8px;
    --blur-md: 16px;
    --blur-lg: 24px;
}

/* ===== Dark Mode Theme ===== */
[data-theme="dark"] {
    /* Background Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-elevated: #1e293b;
    
    /* Glass morphism backgrounds for dark mode */
    --glass-bg: rgba(15, 23, 42, 0.85);
    --glass-bg-strong: rgba(15, 23, 42, 0.95);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;
    
    /* Border Colors */
    --border-light: #334155;
    --border-medium: #475569;
    --border-strong: #64748b;
    
    /* Adjusted shadows for dark mode */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.25);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
    
    /* Glass shadow for dark mode */
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    
    /* Overlay */
    --overlay-light: rgba(0, 0, 0, 0.6);
    --overlay-dark: rgba(0, 0, 0, 0.8);
}

/* ===== Smooth Theme Transition ===== */
html {
    transition: background-color var(--transition-base), color var(--transition-base);
}

* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: var(--transition-base);
}

/* Disable transitions on theme change for instant switch */
html.theme-transition-disabled * {
    transition: none !important;
}
