/* =============================================================
   🧭 Navbar — HorizonX-Inspired Design
   ============================================================= */

header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 64px;
    display: flex;
    align-items: center;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
}

.logo img {
    height: 36px;
    width: auto;
}

.logo a {
    color: #4c51bf;
    text-decoration: none;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.logo a:hover {
    opacity: 0.85;
}

/* Desktop Nav Links */
.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.nav-links li a {
    text-decoration: none;
    color: #555;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-links li a:hover {
    color: #4c51bf;
    background: rgba(76, 81, 191, 0.06);
}

/* Active page indicator */
.nav-links li a.active {
    color: #4c51bf;
    background: rgba(76, 81, 191, 0.08);
    font-weight: 600;
}

/* Login button (pill-shaped CTA) */
.nav-login-btn {
    padding: 8px 24px !important;
    border-radius: 999px !important;
    border: 1.5px solid #4c51bf !important;
    color: #4c51bf !important;
    font-weight: 600 !important;
    background: transparent !important;
    transition: all 0.25s ease !important;
}

.nav-login-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border-color: transparent !important;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3) !important;
    transform: translateY(-1px);
}

/* Authenticated User Section */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.user-info span {
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Back buttons for authenticated pages */
.header-actions .btn {
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(107, 114, 128, 0.08);
    color: #555;
}

.header-actions .btn:hover {
    background: rgba(107, 114, 128, 0.15);
    transform: translateY(-1px);
}

/* Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: 48px;
    right: 0;
    background: white;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    min-width: 170px;
    z-index: 200;
    border: 1px solid rgba(0, 0, 0, 0.04);
    padding: 4px;
}

.user-dropdown a {
    padding: 10px 16px;
    color: #444;
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.user-dropdown a:hover {
    background: rgba(76, 81, 191, 0.06);
    color: #4c51bf;
}

/* Hamburger Menu - Desktop Hidden */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 8px;
    transition: background 0.2s;
}

.menu-toggle:hover {
    background: rgba(0, 0, 0, 0.04);
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: #555;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile Styles */
@media (max-width: 768px) {
    header {
        padding: 0 1rem;
        height: 60px;
    }

    .logo a {
        font-size: 1.1rem;
    }

    .logo img {
        height: 30px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        width: 100%;
        flex-direction: column;
        align-items: center;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        padding: 1rem;
        gap: 0.25rem;
        display: none;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
        z-index: 999;
        border-top: 1px solid rgba(0, 0, 0, 0.04);
    }

    .nav-links.show {
        display: flex;
        animation: slideDown 0.25s ease;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links li a {
        display: block;
        width: 100%;
        text-align: center;
        padding: 12px 16px;
        font-size: 1rem;
        border-radius: 10px;
    }

    .nav-login-btn {
        margin-top: 8px;
        text-align: center;
    }

    .user-info span {
        display: none;
    }

    .header-actions .btn {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
