/* Quiz Whiz - Navigation Styles | Header navbar, menu buttons, theme toggle, and basic navigation elements used across all pages */

/* Navigation Styles */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 1rem 2rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
}

.nav-brand h1 {
    margin: 0;
    color: white;
}

.nav-brand i {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.9);
}

.nav-menu {
    justify-self: center;
    display: flex;
    gap: 1rem;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    --mouse-x: 50%;
    --mouse-y: 50%;
    z-index: 1;
}

.nav-btn > * {
    position: relative;
    z-index: 2;
}

.nav-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle 150px at var(--mouse-x) var(--mouse-y),
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.05) 40%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.nav-btn:hover::after {
    opacity: 1;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-btn.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-btn i {
    font-size: 1.1rem;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .nav-btn {
        transition: none;
    }
    
    .nav-btn::after {
        display: none;
    }
    
    .nav-btn:hover {
        transform: none;
    }
}

/* Theme Picker Styles */
.theme-picker {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-icon {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    transition: var(--transition);
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.3);
    transition: var(--transition);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.theme-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .theme-slider {
    background-color: rgba(255, 255, 255, 0.5);
}

input:checked + .theme-slider:before {
    transform: translateX(26px);
    background-color: #2d3748;
}

.theme-picker:hover .theme-icon {
    color: white;
    transform: scale(1.1);
}

/* Mobile hamburger menu styles */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
    justify-self: end;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .navbar {
        grid-template-columns: 1fr auto;
        padding: 1rem;
        position: relative;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        flex-direction: column;
        gap: 0;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 100;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-btn {
        width: 100%;
        justify-content: flex-start;
        margin-bottom: 0.5rem;
        padding: 1rem;
        border-radius: var(--border-radius);
    }
    
    .nav-dropdown {
        width: 100%;
    }
    
    .nav-dropdown .dropdown-content {
        position: static;
        display: none;
        background: rgba(255, 255, 255, 0.1);
        box-shadow: none;
        border-radius: var(--border-radius);
        margin-top: 0.5rem;
        padding: 0.5rem;
        animation: slideDown 0.3s ease;
    }
    
    .nav-dropdown.active .dropdown-content {
        display: block;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .nav-dropdown .dropdown-content .nav-btn {
        padding: 0.75rem 1rem;
        margin-bottom: 0.25rem;
        background: rgba(255, 255, 255, 0.05);
    }
    
    .user-profile {
        position: absolute;
        top: 1rem;
        right: 4rem;
    }
    
    .user-dropdown-content {
        right: 0;
        left: auto;
        min-width: 200px;
    }
}