/**
 * Dark Mode Navbar Toggle Styles - Consistent with Menu Items
 * Integrated theme switcher that matches navigation design
 */

/* Hide the floating toggle button */
.theme-toggle-float {
    display: none !important;
}

/* Desktop Navbar Theme Toggle Container */
.nav-theme-toggle {
    padding: 0;
    margin-top: 20px;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(94, 92, 127, 0.1);
    padding-bottom: 15px;
}

/* Style as menu item */
.theme-toggle-nav {
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.25s ease;
    position: relative;
    color: #5e5c7f;
    font-size: 16px;
    font-family: "Rubik", sans-serif;
    font-weight: 700;
    text-align: left;
}

/* Icon container matching menu items */
.theme-toggle-icon-wrapper {
    display: inline-flex;
    align-items: center;
    width: 100%;
}

.theme-toggle-icon-wrapper i {
    font-size: 16px;
    margin-right: 20px;
    transition: all 0.25s ease;
    min-width: 16px;
    text-align: left;
    color: #FF4C60;
}

.theme-toggle-label {
    flex: 1;
}

/* Mini toggle switch */
.theme-switch {
    width: 42px;
    height: 24px;
    background: rgba(94, 92, 127, 0.1);
    border-radius: 24px;
    position: relative;
    transition: all 0.3s ease;
    margin-left: 30px;
    margin-right: 10px;
    border: 1px solid rgba(94, 92, 127, 0.2);
}

.theme-switch::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #FF4C60;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Hover state matching menu items */
.theme-toggle-nav:hover {
    color: #FF4C60;
}

.theme-toggle-nav:hover .theme-toggle-icon-wrapper i {
    color: #FFD15C;
    transform: rotate(180deg);
}

.theme-toggle-nav:hover .theme-switch {
    border-color: rgba(255, 76, 96, 0.3);
}

/* Active/Dark state */
[data-theme="dark"] .theme-switch {
    background: rgba(108, 108, 229, 0.2);
    border-color: rgba(108, 108, 229, 0.4);
}

[data-theme="dark"] .theme-switch::before {
    left: 20px;
    background: #6C6CE5;
    box-shadow: 0 2px 6px rgba(108, 108, 229, 0.3);
}

[data-theme="dark"] .theme-toggle-nav {
    color: #a8a8b8;
}

[data-theme="dark"] .theme-toggle-nav:hover {
    color: #FFD15C;
}

[data-theme="dark"] .theme-toggle-nav:hover .theme-toggle-icon-wrapper i {
    color: #FFD15C;
    transform: rotate(-180deg);
}

[data-theme="dark"] .theme-toggle-nav .theme-toggle-icon-wrapper i {
    color: #6C6CE5;
}

[data-theme="dark"] .theme-toggle-nav:hover .theme-switch {
    border-color: rgba(108, 108, 229, 0.5);
}

/* Remove old icon styles */
.theme-toggle-nav .sun-icon,
.theme-toggle-nav .moon-icon {
    display: none;
}

/* Mobile Header Theme Toggle */
.mobile-theme-toggle {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
}

.mobile-header-1 .theme-toggle-nav {
    padding: 0;
    width: auto;
    background: transparent;
    display: flex;
    align-items: center;
}

.mobile-header-1 .theme-toggle-label {
    display: none;
}

.mobile-header-1 .theme-toggle-icon-wrapper {
    width: auto;
    margin: 0;
    display: flex;
    align-items: center;
}

.mobile-header-1 .theme-toggle-icon-wrapper i {
    display: none;
}

.mobile-header-1 .theme-switch {
    width: 44px;
    height: 26px;
    margin: 0;
    background: rgba(94, 92, 127, 0.15);
    border: 1px solid rgba(94, 92, 127, 0.25);
}

.mobile-header-1 .theme-switch::before {
    width: 20px;
    height: 20px;
    top: 2px;
    left: 2px;
}

[data-theme="dark"] .mobile-header-1 .theme-switch {
    background: rgba(108, 108, 229, 0.25);
    border-color: rgba(108, 108, 229, 0.4);
}

[data-theme="dark"] .mobile-header-1 .theme-switch::before {
    left: 20px;
}

[data-theme="dark"] .mobile-header-1 .theme-toggle-icon-wrapper i {
    color: #e4e4e9;
}

/* Focus styles for accessibility */
.theme-toggle-nav:focus {
    outline: none;
}

/* Responsive */
@media (max-width: 991px) {
    .nav-theme-toggle {
        display: none;
    }
    
    .mobile-theme-toggle {
        display: block;
    }
}

@media (min-width: 992px) {
    .mobile-theme-toggle {
        display: none;
    }
}

/* Animation for toggle switch */
@keyframes toggleSlide {
    0% { transform: scale(1); }
    50% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

@keyframes iconRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.theme-switch.switching::before {
    animation: toggleSlide 0.3s ease;
}

.theme-toggle-nav.switching .theme-toggle-icon-wrapper i {
    animation: iconRotate 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Add subtle glow effect on dark mode */
[data-theme="dark"] .theme-switch::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 24px;
    background: radial-gradient(circle, rgba(108, 108, 229, 0.2) 0%, transparent 70%);
    animation: pulse 2s infinite;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

/* Integration with existing nav - position above footer */
.desktop-header-1 nav {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.desktop-header-1 .vertical-menu {
    flex: 1;
    margin-bottom: 20px;
}

.desktop-header-1 .nav-theme-toggle {
    border-bottom: 1px solid rgba(94, 92, 127, 0.1);
    order: -1;
}

[data-theme="dark"] .desktop-header-1 .nav-theme-toggle {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

/* Ensure footer stays at bottom */
.desktop-header-1 .footer {
    margin-top: 15px;
}