/**
 * Theme Variables — Aura Light (Single Theme)
 * Glassmorphism sidebar, clean white canvas
 *
 * Design: Light glassmorphism sidebar with blue accent
 * Usage: Single default theme, no theme switching
 */

/* ==================== Aura Light — Default ==================== */

:root,
[data-theme="zenith"] {
    --theme-name: "Calm Clarity";
    --theme-radius: 12px;

    /* Body Background */
    --body-bg: linear-gradient(135deg, #E5E7EB 0%, #93C5FD 33%, #3B82F6 66%, #1D4ED8 100%);

    /* Primary — Calm Clarity Blue */
    --color-primary: #3B82F6;
    --color-primary-hover: #2563EB;
    --color-primary-active: #1D4ED8;
    --color-primary-light: rgba(59, 130, 246, 0.10);
    --color-primary-rgb: 59, 130, 246;

    /* Backgrounds — Pure White Canvas */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F8FB;
    --bg-tertiary: #EBF1F6;
    --bg-elevated: #FFFFFF;
    --bg-overlay: rgba(0, 0, 0, 0.45);

    /* Text — Cool Slate */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-tertiary: #94A3B8;
    --text-inverse: #FFFFFF;

    /* Borders */
    --border-color: #E2E8F0;
    --border-hover: #CBD5E1;
    --border-focus: #3B82F6;

    /* Interactive */
    --interactive-default: #3B82F6;
    --interactive-hover: #2563EB;
    --interactive-active: #1D4ED8;
    --interactive-disabled: #E2E8F0;

    /* State */
    --state-success: #059669;
    --state-warning: #D97706;
    --state-error: #DC2626;
    --state-info: #3B82F6;

    /* Nav */
    --nav-bg: rgba(255, 255, 255, 0.95);
    --nav-border: rgba(0, 0, 0, 0.06);
    --nav-link-hover: #EBF1F6;
    --nav-link-active: rgba(59, 130, 246, 0.10);

    /* Card */
    --card-bg: #FFFFFF;
    --card-border: #E2E8F0;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);

    /* Input */
    --input-bg: #FFFFFF;
    --input-border: #E2E8F0;
    --input-focus-border: #3B82F6;
    --input-disabled-bg: #F1F5F9;

    /* Button */
    --button-primary-bg: #3B82F6;
    --button-primary-hover: #2563EB;
    --button-primary-text: #FFFFFF;
    --button-secondary-bg: rgba(59, 130, 246, 0.08);
    --button-secondary-hover: rgba(59, 130, 246, 0.15);
    --button-secondary-text: #2563EB;

    /* Scrollbar */
    --scrollbar-track: transparent;
    --scrollbar-thumb: rgba(0, 0, 0, 0.12);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.25);

    /* Sidebar — Aura Light Glassmorphism */
    --sidebar-bg: rgba(255, 255, 255, 0.85);
    --sidebar-border: rgb(229, 231, 235);
    --sidebar-text: rgb(55, 65, 81);
    --sidebar-text-muted: rgb(107, 114, 128);
    --sidebar-text-dim: rgb(156, 163, 175);
    --sidebar-hover-bg: rgb(243, 244, 246);
    --sidebar-active-bg: rgba(59, 130, 246, 0.12);
    --sidebar-active-text: rgb(59, 130, 246);
    --sidebar-submenu-bg: transparent;
    --sidebar-submenu-border: rgb(229, 231, 235);
    --sidebar-quick-access-bg: rgb(249, 250, 251);
    --sidebar-quick-access-hover: rgb(243, 244, 246);
    --sidebar-active-bg-subtle: rgba(59, 130, 246, 0.08);
    --sidebar-icon-bg: transparent;
    --sidebar-width: 280px;
    --sidebar-width-collapsed: 72px;
    --sidebar-primary: #3B82F6;
    --sidebar-primary-light: #60A5FA;

    /* Status */
    --status-success: #059669;
    --status-error: #DC2626;
    --loading-bar-color: #3B82F6;

    /* Alert */
    --color-success-light: rgba(5, 150, 105, 0.08);
    --color-warning-light: rgba(217, 119, 6, 0.08);
    --color-error-light: rgba(220, 38, 38, 0.08);
    --color-info-light: rgba(59, 130, 246, 0.08);

    /* Hover / Interactive */
    --hover-bg: rgba(0, 0, 0, 0.03);
    --hover-bg-strong: rgba(0, 0, 0, 0.06);
    --active-bg: rgba(0, 0, 0, 0.09);
    --selected-bg: rgba(59, 130, 246, 0.06);
    --selected-bg-strong: rgba(59, 130, 246, 0.12);

    /* OS-Specific */
    --theme-material-bg: rgba(255, 255, 255, 0.88);
    --theme-material-blur: blur(40px) saturate(180%);
    --theme-acrylic-bg: rgba(255, 255, 255, 0.92);
    --theme-acrylic-blur: blur(20px) saturate(150%);
    --theme-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05);
    --theme-shadow-flyout: 0 4px 12px rgba(0, 0, 0, 0.08);
    --theme-shadow-dialog: 0 16px 40px rgba(0, 0, 0, 0.12);
    --theme-title-bar-bg: var(--bg-elevated);
    --theme-title-bar-text: var(--text-primary);
    --theme-active-indicator-width: 3px;
    --theme-active-indicator-height: 16px;
    --theme-active-indicator-radius: 4px;
    --theme-input-focus-border: 1px solid var(--interactive-default);
    --theme-modal-radius: 12px;
    --theme-control-radius: 8px;
    --theme-scrollbar-width: 4px;
    --theme-font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --theme-font-text: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --theme-separator-height: 1px;
    --theme-separator-inset: 16px;

    /* Radius */
    --radius-sm: 4px;
    --radius-base: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
}

/* ==================== Dark Mode ==================== */

[data-theme="dark"] {
    --theme-name: "Midnight";
    --theme-radius: 12px;

    /* Body Background */
    --body-bg: #0F172A;

    /* Primary — Same blue, brighter in dark */
    --color-primary: #60A5FA;
    --color-primary-hover: #3B82F6;
    --color-primary-active: #2563EB;
    --color-primary-light: rgba(96, 165, 250, 0.15);
    --color-primary-rgb: 96, 165, 250;

    /* Backgrounds — Slate Dark */
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;
    --bg-elevated: #1E293B;
    --bg-overlay: rgba(0, 0, 0, 0.65);

    /* Text — Light Slate */
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-tertiary: #64748B;
    --text-inverse: #0F172A;

    /* Borders */
    --border-color: #334155;
    --border-hover: #475569;
    --border-focus: #60A5FA;

    /* Interactive */
    --interactive-default: #60A5FA;
    --interactive-hover: #3B82F6;
    --interactive-active: #2563EB;
    --interactive-disabled: #334155;

    /* State */
    --state-success: #34D399;
    --state-warning: #FBBF24;
    --state-error: #F87171;
    --state-info: #60A5FA;

    /* Nav */
    --nav-bg: rgba(15, 23, 42, 0.95);
    --nav-border: rgba(255, 255, 255, 0.08);
    --nav-link-hover: #1E293B;
    --nav-link-active: rgba(96, 165, 250, 0.15);

    /* Card */
    --card-bg: #1E293B;
    --card-border: #334155;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);

    /* Input */
    --input-bg: #1E293B;
    --input-border: #334155;
    --input-focus-border: #60A5FA;
    --input-disabled-bg: #0F172A;

    /* Button */
    --button-primary-bg: #3B82F6;
    --button-primary-hover: #2563EB;
    --button-primary-text: #FFFFFF;
    --button-secondary-bg: rgba(96, 165, 250, 0.12);
    --button-secondary-hover: rgba(96, 165, 250, 0.20);
    --button-secondary-text: #60A5FA;

    /* Scrollbar */
    --scrollbar-track: transparent;
    --scrollbar-thumb: rgba(255, 255, 255, 0.15);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.30);

    /* Sidebar — Dark Glassmorphism */
    --sidebar-bg: rgba(15, 23, 42, 0.90);
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-text: #E2E8F0;
    --sidebar-text-muted: #94A3B8;
    --sidebar-text-dim: #64748B;
    --sidebar-hover-bg: #1E293B;
    --sidebar-active-bg: rgba(96, 165, 250, 0.15);
    --sidebar-active-text: #60A5FA;
    --sidebar-submenu-bg: transparent;
    --sidebar-submenu-border: #334155;
    --sidebar-quick-access-bg: #1E293B;
    --sidebar-quick-access-hover: #334155;
    --sidebar-active-bg-subtle: rgba(96, 165, 250, 0.10);
    --sidebar-icon-bg: transparent;
    --sidebar-width: 280px;
    --sidebar-width-collapsed: 72px;
    --sidebar-primary: #60A5FA;
    --sidebar-primary-light: #93C5FD;

    /* Status */
    --status-success: #34D399;
    --status-error: #F87171;
    --loading-bar-color: #60A5FA;

    /* Alert */
    --color-success-light: rgba(52, 211, 153, 0.12);
    --color-warning-light: rgba(251, 191, 36, 0.12);
    --color-error-light: rgba(248, 113, 113, 0.12);
    --color-info-light: rgba(96, 165, 250, 0.12);

    /* Hover / Interactive */
    --hover-bg: rgba(255, 255, 255, 0.05);
    --hover-bg-strong: rgba(255, 255, 255, 0.10);
    --active-bg: rgba(255, 255, 255, 0.15);
    --selected-bg: rgba(96, 165, 250, 0.08);
    --selected-bg-strong: rgba(96, 165, 250, 0.15);

    /* OS-Specific */
    --theme-material-bg: rgba(15, 23, 42, 0.92);
    --theme-material-blur: blur(40px) saturate(180%);
    --theme-acrylic-bg: rgba(15, 23, 42, 0.95);
    --theme-acrylic-blur: blur(20px) saturate(150%);
    --theme-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3);
    --theme-shadow-flyout: 0 4px 12px rgba(0, 0, 0, 0.4);
    --theme-shadow-dialog: 0 16px 40px rgba(0, 0, 0, 0.5);
    --theme-title-bar-bg: var(--bg-elevated);
    --theme-title-bar-text: var(--text-primary);
    --theme-active-indicator-width: 3px;
    --theme-active-indicator-height: 16px;
    --theme-active-indicator-radius: 4px;
    --theme-input-focus-border: 1px solid var(--interactive-default);
    --theme-modal-radius: 12px;
    --theme-control-radius: 8px;
    --theme-scrollbar-width: 4px;
    --theme-font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --theme-font-text: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --theme-separator-height: 1px;
    --theme-separator-inset: 16px;

    /* Radius */
    --radius-sm: 4px;
    --radius-base: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
}

/* ==================== OS Preference Auto Detection ==================== */

@media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
        --bg-primary: #FFFFFF;
        --bg-secondary: #F8FAFF;
        --text-primary: #0F172A;
        --text-secondary: #475569;
    }
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg-primary: #0F172A;
        --bg-secondary: #1E293B;
        --bg-tertiary: #334155;
        --bg-elevated: #1E293B;
        --text-primary: #F1F5F9;
        --text-secondary: #94A3B8;
        --text-tertiary: #64748B;
        --border-color: #334155;
        --card-bg: #1E293B;
        --card-border: #334155;
        --input-bg: #1E293B;
        --input-border: #334155;
        --nav-bg: rgba(15, 23, 42, 0.95);
        --sidebar-bg: rgba(15, 23, 42, 0.90);
    }
}

/* ==================== High Contrast Mode ==================== */

@media (prefers-contrast: high) {
    :root,
    [data-theme] {
        --border-color: currentColor;
        --text-secondary: var(--text-primary);
    }
}

/* ==================== Reduced Motion ==================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
