/* WebHostingM - CSS Custom Properties (Design Tokens) */

:root {
    /* Brand Colors - Modern Indigo */
    --primary-color: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #6366F1;
    --primary-lighter: #E0E7FF;

    /* Neutral Colors */
    --white: #FFFFFF;
    --black: #000000;
    --gray-50: #F8F9FA;
    --gray-100: #F1F3F5;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-400: #CED4DA;
    --gray-500: #ADB5BD;
    --gray-600: #6C757D;
    --gray-700: #495057;
    --gray-800: #343A40;
    --gray-900: #212529;

    /* Semantic Colors */
    --success: #28A745;
    --warning: #FFC107;
    --danger: #DC3545;
    --info: #17A2B8;

    /* Text Colors - WCAG AA Compliant (4.5:1 minimum contrast on white) */
    --text-primary: #1a1a1a;      /* 16.1:1 contrast - primary body text */
    --text-secondary: #4a5568;    /* 7.0:1 contrast - secondary text (was #666666 at 5.7:1) */
    --text-tertiary: #718096;     /* 5.0:1 contrast - subtle text (region labels, meta) */
    --text-muted: #64748b;        /* 4.6:1 contrast - minimum for body text */
    --text-light: #9ca3af;        /* 3.5:1 contrast - decorative text only */
    --text-inverse: #FFFFFF;

    /* Background Colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-dark: #1a1a1a;
    --bg-blue: #0066FF;

    /* Surface Colors - for cards, modals, sections that adapt to dark mode */
    --surface: #FFFFFF;           /* Primary surface (cards, panels) */
    --surface-alt: #F8F9FA;       /* Alternate surface (section backgrounds) */
    --surface-elevated: #FFFFFF;  /* Elevated elements (modals, dropdowns) */

    /* Border */
    --border-color: #E0E0E0;
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --border-radius-lg: 12px;

    /* 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);

    /* Typography - Inter Font Family */
    --font-family-base: "Inter", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-heading: "Inter", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-mono: 'Monaco', 'Courier New', monospace;

    /* Font Sizes - Golden Ratio Scale (1.618) with 16px MINIMUM
       WCAG Accessibility: No text smaller than 16px for readability */
    --font-size-base: 1rem;       /* 16px - MINIMUM (base) */
    --font-size-lg: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;      /* 20px */
    --font-size-2xl: 1.625rem;    /* 26px (16 × 1.618) */
    --font-size-3xl: 2.625rem;    /* 42px (26 × 1.618) */
    --font-size-4xl: 4.25rem;     /* 68px (42 × 1.618) */
    --font-size-5xl: 6.875rem;    /* 110px (68 × 1.618) */
    --font-size-6xl: 11.125rem;   /* 178px (110 × 1.618) */

    /* DEPRECATED - Do not use these for body text (kept for legacy compatibility) */
    --font-size-xs: 1rem;         /* Minimum 16px - was 10px */
    --font-size-sm: 1rem;         /* Minimum 16px - was 12px */
    --font-size-md: 1rem;         /* Minimum 16px - was 14px */

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

    /* Line Heights */
    --line-height-tight: 1.2;
    --line-height-normal: 1.6;
    --line-height-relaxed: 1.8;

    /* Spacing Scale (8px base) */
    --spacing-1: 0.25rem;   /* 4px */
    --spacing-2: 0.5rem;    /* 8px */
    --spacing-3: 0.75rem;   /* 12px */
    --spacing-4: 1rem;      /* 16px */
    --spacing-5: 1.25rem;   /* 20px */
    --spacing-6: 1.5rem;    /* 24px */
    --spacing-8: 2rem;      /* 32px */
    --spacing-10: 2.5rem;   /* 40px */
    --spacing-12: 3rem;     /* 48px */
    --spacing-16: 4rem;     /* 64px */
    --spacing-20: 5rem;     /* 80px */
    --spacing-24: 6rem;     /* 96px */

    /* Container Width */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1400px;

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;

    /* Z-index scale */
    --z-index-dropdown: 1000;
    --z-index-sticky: 1020;
    --z-index-fixed: 1030;
    --z-index-modal-backdrop: 1040;
    --z-index-modal: 1050;
    --z-index-popover: 1060;
    --z-index-tooltip: 1070;

    /* Border Radius Aliases */
    --radius-sm: var(--border-radius-sm);
    --radius-md: var(--border-radius);
    --radius-lg: var(--border-radius-lg);
    --radius-full: 9999px;
}

/* =====================================================
   DARK MODE
   Supports both system preference AND manual selection
   Manual: data-theme="dark" on <html> element
   System: data-theme="system" (default) uses media query
   Reference: web.dev theme switching pattern
   ===================================================== */

/* Dark mode variables (shared by both methods) */
:root[data-theme="dark"],
:root:not([data-theme="light"]):not([data-theme="dark"]) {
    /* Only apply if system prefers dark AND not manually set to light */
}

/* Manual dark mode selection */
:root[data-theme="dark"] {
    /* Background surfaces - adaptive for dark mode */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-dark: #020617;
    --surface: #0f172a;           /* Primary surface (replaces --white in cards) */
    --surface-alt: #1e293b;       /* Alternate surface (replaces --gray-50 in cards) */
    --surface-elevated: #1e293b;  /* Elevated elements (modals, dropdowns) */

    /* Text colors - light on dark */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-muted: #64748b;
    --text-light: #475569;
    --text-inverse: #0f172a;

    /* Border */
    --border-color: #334155;

    /* Gray scale - inverted for dark mode */
    --gray-50: #1e293b;
    --gray-100: #334155;
    --gray-200: #475569;
    --gray-300: #64748b;
    --gray-400: #94a3b8;
    --gray-500: #cbd5e1;
    --gray-600: #e2e8f0;
    --gray-700: #f1f5f9;
    --gray-800: #f8fafc;
    --gray-900: #ffffff;

    /* Shadows - darker for dark mode */
    --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.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);

    /* Brand colors - adjusted for dark mode contrast */
    --primary-lighter: #312e81;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    color-scheme: dark;
}

/* System preference dark mode (only when data-theme="system" or not set) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="dark"]) {
        /* Background surfaces - adaptive for dark mode */
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-dark: #020617;
        --surface: #0f172a;           /* Primary surface (replaces --white in cards) */
        --surface-alt: #1e293b;       /* Alternate surface (replaces --gray-50 in cards) */
        --surface-elevated: #1e293b;  /* Elevated elements (modals, dropdowns) */

        /* Text colors - light on dark */
        --text-primary: #f1f5f9;
        --text-secondary: #94a3b8;
        --text-tertiary: #64748b;
        --text-muted: #64748b;
        --text-light: #475569;
        --text-inverse: #0f172a;

        /* Border */
        --border-color: #334155;

        /* Gray scale - inverted for dark mode */
        --gray-50: #1e293b;
        --gray-100: #334155;
        --gray-200: #475569;
        --gray-300: #64748b;
        --gray-400: #94a3b8;
        --gray-500: #cbd5e1;
        --gray-600: #e2e8f0;
        --gray-700: #f1f5f9;
        --gray-800: #f8fafc;
        --gray-900: #ffffff;

        /* Shadows - darker for dark mode */
        --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.3);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);

        /* Brand colors - adjusted for dark mode contrast */
        --primary-lighter: #312e81;
        --success: #22c55e;
        --danger: #ef4444;
        --warning: #f59e0b;
        --info: #3b82f6;

        color-scheme: dark;
    }
}

/* Explicit light mode (overrides system preference) */
:root[data-theme="light"] {
    color-scheme: light;
}

/* =====================================================
   THEME-AWARE LOGOS
   Shows dark logo (black text) on light backgrounds
   Shows light logo (white text) on dark backgrounds
   ===================================================== */

/* Default (light mode): show dark logo, hide light logo */
.logo-light {
    display: none !important;
}
.logo-dark {
    display: block !important;
}

/* Dark mode: show light logo, hide dark logo */
:root[data-theme="dark"] .logo-light {
    display: block !important;
}
:root[data-theme="dark"] .logo-dark {
    display: none !important;
}

/* System preference dark mode */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="dark"]) .logo-light {
        display: block !important;
    }
    :root:not([data-theme="light"]):not([data-theme="dark"]) .logo-dark {
        display: none !important;
    }
}

/* =====================================================
   HIGH CONTRAST MODE
   For users who prefer more contrast
   ===================================================== */
@media (prefers-contrast: more) {
    :root {
        --text-primary: #000000;
        --text-secondary: #1a1a1a;
        --border-color: #000000;
    }
}

@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
    :root {
        --text-primary: #ffffff;
        --text-secondary: #f0f0f0;
        --border-color: #ffffff;
    }
}
