/* Master CSS Variables - Theme-Aware Architecture */

:root {
    /* Theme Colors - Dynamically set by ThemeService */
    /* These will be overridden by JavaScript when themes change */
    --theme-bg-primary: #ffffff;
    --theme-bg-secondary: #f8f9fa;
    --theme-bg-tertiary: #f0f2f5;

    --theme-text-primary: #212529;
    --theme-text-secondary: #6c757d;
    --theme-text-muted: #adb5bd;

    --theme-border-color: #e0e0e0;
    --theme-border-light: #f1f5f9;

    --theme-primary: #007bff;
    --theme-primary-hover: #0069d9;
    --theme-primary-active: #0062cc;

    --theme-success: #28a745;
    --theme-warning: #ffc107;
    --theme-danger: #dc3545;
    --theme-info: #17a2b8;

    --theme-card-bg: #ffffff;
    --theme-card-border: #e0e0e0;
    --theme-card-shadow: rgba(0, 0, 0, 0.05);

    --theme-modal-overlay: rgba(0, 0, 0, 0.5);
    --theme-dropdown-bg: #ffffff;

    --theme-header-bg: #ffffff;
    --theme-header-text: #212529;
    --theme-sidebar-bg: #ffffff;
    --theme-sidebar-text: #495057;

    /* Legacy Color Aliases - For Backwards Compatibility */
    /* Components still using old variable names will continue to work */
    --color-primary: var(--theme-primary);
    --color-primary-hover: var(--theme-primary-hover);
    --color-primary-active: var(--theme-primary-active);

    --color-danger: var(--theme-danger);
    --color-danger-hover: #c82333;
    --color-success: var(--theme-success);
    --color-warning: var(--theme-warning);
    --color-info: var(--theme-info);

    --color-white: var(--theme-bg-primary);
    --color-gray-50: var(--theme-bg-secondary);
    --color-gray-100: var(--theme-bg-tertiary);
    --color-gray-200: #e9ecef;
    --color-gray-300: #dee2e6;
    --color-gray-400: #ced4da;
    --color-gray-500: var(--theme-text-muted);
    --color-gray-600: var(--theme-text-secondary);
    --color-gray-700: #495057;
    --color-gray-800: #343a40;
    --color-gray-900: var(--theme-text-primary);

    /* Spacing Scale */
    --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: 2.5rem;
    /* 40px */
    --space-3xl: 3rem;
    /* 48px */

    /* Typography */
    --font-family-base: 'Inter', Arial, sans-serif;
    --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 */

    /* Border Radius */
    --radius-sm: 0.25rem;
    /* 4px */
    --radius-md: 0.5rem;
    /* 8px */
    --radius-lg: 0.75rem;
    /* 12px */
    --radius-xl: 1rem;
    /* 16px */

    /* 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);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-base: 0.2s ease-in-out;
    --transition-slow: 0.3s ease-in-out;
}

/* Smooth Theme Transitions */
* {
    transition: background-color var(--transition-base),
        color var(--transition-base),
        border-color var(--transition-base);
}

/* Disable transitions during theme switch for performance */
.theme-transitioning * {
    transition: none !important;
}

/* Exceptions - elements that should not transition */
button,
a,
input,
textarea,
select {
    transition: background-color var(--transition-fast),
        color var(--transition-fast),
        border-color var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}