/* ============================================
   NAVIGATION & THEME TOGGLE
   ============================================ */

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 1000;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all var(--transition-base);
}

.theme-toggle-track {
    position: relative;
    width: 70px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.theme-toggle-icon {
    position: relative;
    z-index: 2;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.sun-icon .icon {
    transform: translateX(1px);
}

.moon-icon {
    background: transparent;
}

.moon-icon .icon {
    color: #764ba2;
}

.sun-icon {
    background: transparent;
}

.sun-icon .icon {
    color: #fbbf24;
}

/* Dark mode - moon selected */
[data-theme="dark"] .theme-toggle-track {
    background: rgba(118, 75, 162, 0.3);
}

[data-theme="dark"] .moon-icon {
    opacity: 1;
}

[data-theme="dark"] .moon-icon .icon {
    color: #764ba2;
}

[data-theme="dark"] .sun-icon {
    opacity: 0;
    pointer-events: none;
}

/* Light mode - sun selected */
[data-theme="light"] .theme-toggle-track {
    background: rgba(251, 191, 36, 0.3);
}

[data-theme="light"] .sun-icon {
    opacity: 1;
}

[data-theme="light"] .sun-icon .icon {
    color: #fbbf24;
}

[data-theme="light"] .moon-icon {
    opacity: 0;
    pointer-events: none;
}

.theme-toggle-slider {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: transform var(--transition-bounce);
    z-index: 1;
    left: 4px;
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .theme-toggle-slider {
    transform: translateX(34px);
}

.theme-toggle:hover .theme-toggle-track {
    box-shadow: var(--shadow-lg);
    transform: scale(1.05);
}

/* Scroll-to-top Button */
.fab-top {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 1000;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    font-size: 1.25rem;
}

.fab-top {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.fab-top.visible {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

.fab-top:hover {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    transform: scale(1.1) translateY(-4px);
}

@media (max-width: 1024px) {
    .theme-toggle {
        top: var(--space-md);
        right: var(--space-md);
    }
    
    .theme-toggle-track {
        width: 60px;
        height: 32px;
    }
    
    .theme-toggle-icon {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    .theme-toggle-slider {
        width: 24px;
        height: 24px;
    }
    
    [data-theme="light"] .theme-toggle-slider {
        transform: translateX(28px);
    }
    
    .fab-top {
        bottom: var(--space-md);
        right: var(--space-md);
        width: 50px;
        height: 50px;
    }
}
