/* === Design System Tokens === */
:root {
    /* === Color System === */
    /* Primary Gradients - Crimson Neural System */
    --gradient-primary: linear-gradient(135deg, #DC2626 0%, #B91C1C 50%, #6B21A8 100%);
    --gradient-primary-horizontal: linear-gradient(to right, #DC2626, #B91C1C, #6B21A8);
    --gradient-secondary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(220, 38, 38, 0.1) 0%, rgba(185, 28, 28, 0.1) 50%, rgba(107, 33, 168, 0.1) 100%);
    
    /* Alternative AI-Focused Gradients */
    --gradient-neural-ember: linear-gradient(135deg, #EF4444 0%, #EA580C 50%, #065F46 100%);
    --gradient-adobe-midnight: linear-gradient(135deg, #DC2626 0%, #991B1B 50%, #0F172A 100%);

    /* Brand Colors - Crimson Neural Palette */
    --color-crimson: #DC2626;
    --color-deep-red: #B91C1C;
    --color-neural-purple: #6B21A8;
    --color-adobe-red: #E1251B; /* Legacy compatibility */
    
    /* AI-Native Color Extensions */
    --color-ai-primary: #DC2626;
    --color-ai-secondary: #B91C1C;
    --color-ai-accent: #6B21A8;
    
    /* Semantic Colors */
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-error: #dc3545;
    --color-info: #17a2b8;
    
    /* Neutral Palette */
    --color-white: #ffffff;
    --color-gray-50: #f8f9fa;
    --color-gray-100: #e9ecef;
    --color-gray-200: #dee2e6;
    --color-gray-300: #ced4da;
    --color-gray-400: #adb5bd;
    --color-gray-500: #6c757d;
    --color-gray-600: #495057;
    --color-gray-700: #343a40;
    --color-gray-800: #2c3e50;
    --color-gray-900: #1a1a1a;
    
    /* Text Colors */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #888888;
    --text-inverse: #ffffff;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-dark: #2c3e50;
    --bg-overlay: rgba(0, 0, 0, 0.5);

    /* === Typography System === */
    /* Font Families */
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-monospace: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
    
    /* Font Weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Font Sizes - Desktop */
    --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-size-5xl: 3rem;      /* 48px */
    --font-size-6xl: 3.75rem;   /* 60px */
    
    /* Line Heights */
    --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 System === */
    --space-xs: 0.25rem;    /* 4px */
    --space-sm: 0.5rem;     /* 8px */
    --space-md: 1rem;       /* 16px */
    --space-lg: 1.5rem;     /* 24px */
    --space-xl: 2rem;       /* 32px */
    --space-2xl: 3rem;      /* 48px */
    --space-3xl: 4rem;      /* 64px */
    --space-4xl: 5rem;      /* 80px */
    --space-5xl: 6rem;      /* 96px */

    /* === Border System === */
    --border-width-thin: 1px;
    --border-width-medium: 2px;
    --border-width-thick: 4px;
    
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --border-radius-full: 9999px;

    /* === Shadow System === */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.06);

    /* === Animation System === */
    --timing-fast: 150ms;
    --timing-base: 250ms;
    --timing-slow: 350ms;
    --timing-slower: 500ms;
    
    --ease-linear: linear;
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

    /* === Layout System === */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1440px;
    --container-3xl: 1600px;
    
    /* === Z-Index Scale === */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
}

/* Mobile Font Size Overrides */
@media (max-width: 768px) {
    :root {
        --font-size-4xl: 2rem;      /* 32px */
        --font-size-5xl: 2.5rem;    /* 40px */
        --font-size-6xl: 3rem;      /* 48px */
    }
}

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

/* === Base Styles === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
}

body {
    font-family: var(--font-primary);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Ensure body never creates scrollbar */
body.auth-pending,
body:not(.auth-pending),
body.authenticated,
body.content-loaded {
    overflow-y: visible !important;
}

/* Even more specific for authenticated state */
body.authenticated.content-loaded {
    overflow-y: visible !important;
}

/* Force single scrollbar - html element only */
html {
    overflow-y: scroll !important;
}

/* Completely disable body scrolling */
body,
body * {
    overflow-y: visible !important;
}

/* Force page to only use html scrollbar */
html {
    height: 100% !important;
}

body {
    height: 100% !important;
    overflow: visible !important;
}

/* === Global Utility Classes === */
.hidden {
    display: none !important;
}

/* === Authentication States === */
.auth-pending .main-content {
    display: none;
}

.authenticated .auth-overlay {
    display: none;
}