/* ==========================================================================
   THEME SYSTEM - Light & Dark Mode
   ========================================================================== */

:root {
    /* Color Palette */
    --construction-blue: #003DA5;
    --construction-orange: #FF8200;
    --dark-blue: #002a75;
    --light-blue: #C4D8E2;
    --accent-gold: #FFD700;

    /* Light Theme (Default) */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f0f0;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 25px rgba(0,0,0,0.15);

    /* Brand Colors */
    --primary: var(--construction-blue);
    --secondary: var(--construction-orange);
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Typography */
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-mono: 'Courier New', monospace;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 25px rgba(0,0,0,0.5);
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--construction-blue) 0%, var(--dark-blue) 100%);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle i {
    transition: all var(--transition-normal);
}

/* Smooth Theme Transition */
body,
.nav-header,
.card,
section {
    transition: background-color var(--transition-normal),
                color var(--transition-normal),
                border-color var(--transition-normal);
}

/* Theme-aware gradient overlays */
.gradient-overlay-light {
    background: linear-gradient(135deg, var(--construction-blue) 0%, var(--dark-blue) 100%);
}

[data-theme="dark"] .gradient-overlay-light {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e293b 100%);
}

/* Theme toggle animations */
@keyframes moonRise {
    from {
        transform: translateY(100px) rotate(0deg);
        opacity: 0;
    }
    to {
        transform: translateY(0) rotate(360deg);
        opacity: 1;
    }
}

@keyframes sunRise {
    from {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    to {
        transform: translateY(0) rotate(360deg);
        opacity: 1;
    }
}

.theme-icon-enter {
    animation: sunRise 0.5s ease-out;
}

[data-theme="dark"] .theme-icon-enter {
    animation: moonRise 0.5s ease-out;
}

/* Responsive theme toggle for mobile */
@media (max-width: 768px) {
    .theme-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
}
