/* Global Theme Variables - Bridged with Design System */
:root {
    /* Light Theme (Default) */
    --theme-bg-page: var(--bg-main);
    --theme-bg-surface: var(--bg-card);
    --theme-text-primary: var(--text-main);
    --theme-text-secondary: var(--text-muted);
    --theme-border: rgba(0, 0, 0, 0.05);
    --theme-shadow: var(--shadow-soft);
    --theme-nav-bg: rgba(255, 255, 255, 0.7);
    
    /* Brand Colors (Constant) */
    --theme-primary: var(--primary);
    --theme-primary-hover: var(--primary-dark);
    --theme-accent: var(--warning);
    --theme-danger: var(--danger);
}

[data-theme="dark"] {
    /* Dark Theme */
    --theme-border: rgba(255, 255, 255, 0.05);
    --theme-nav-bg: rgba(30, 41, 59, 0.7);
}

/* Base Transition for Theme Switching */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
    background-color: var(--theme-bg-page);
    color: var(--theme-text-primary);
}

/* Utility classes to use these tokens */
.bg-surface { background-color: var(--theme-bg-surface); }
.text-primary { color: var(--theme-text-primary); }
.text-secondary { color: var(--theme-text-secondary); }
.border-theme { border: 1px solid var(--theme-border); }

/* View Transitions API - Custom Theme Switch Animation */
::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
    display: block;
    position: fixed;
    inset: 0;
}

::view-transition-old(root) {
    z-index: 1;
}

::view-transition-new(root) {
    z-index: 2147483647;
}
