/* ===== PROFESSIONAL NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    border-bottom-color: rgba(226, 232, 240, 1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

/* Brand */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary, #0f172a);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: all 0.3s ease;
    position: relative;
}

.nav-brand:hover {
    text-decoration: none;
}

.nav-brand .brand-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a, #0891b2);
    border-radius: 10px;
    font-size: 1.1rem;
    color: white;
    position: relative;
    transition: all 0.3s ease;
}

.nav-brand:hover .brand-icon {
    transform: rotate(-8deg) scale(1.05);
    box-shadow: 0 0 20px rgba(8, 145, 178, 0.3);
}

.nav-brand .brand-icon::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0891b2, #3b82f6);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: blur(8px);
}

.nav-brand:hover .brand-icon::after {
    opacity: 0.4;
}

/* Nav Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    color: var(--text-secondary, #475569);
    border-radius: 10px;
    transition: all 0.25s ease;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    position: relative;
    white-space: nowrap;
}

.nav-menu a i {
    font-size: 0.9rem;
    transition: transform 0.25s ease;
}

.nav-menu a:hover {
    color: var(--text-primary, #0f172a);
    background: rgba(8, 145, 178, 0.06);
    text-decoration: none;
}

.nav-menu a:hover i {
    transform: scale(1.15);
}

/* Active State */
.nav-menu a.active {
    color: var(--accent-cyan, #0891b2);
    background: rgba(8, 145, 178, 0.08);
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent-cyan, #0891b2);
    border-radius: 1px;
    animation: navActiveIndicator 0.3s ease forwards;
}

@keyframes navActiveIndicator {
    from { width: 0; opacity: 0; }
    to { width: 20px; opacity: 1; }
}

/* Nav Divider */
.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color, #e2e8f0);
    margin: 0 0.5rem;
    opacity: 0.5;
}

/* Auth Buttons (not logged in) */
.nav-auth {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.75rem;
}

.nav-auth .btn-login {
    padding: 0.5rem 1.15rem;
    color: var(--text-secondary, #475569);
    font-weight: 500;
    font-size: 0.92rem;
    border-radius: 10px;
    transition: all 0.25s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-auth .btn-login:hover {
    color: var(--text-primary, #0f172a);
    background: rgba(8, 145, 178, 0.06);
    text-decoration: none;
}

.nav-auth .btn-register {
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, #1e3a8a, #0891b2);
    color: white;
    font-weight: 600;
    font-size: 0.92rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 2px 10px rgba(30, 58, 138, 0.2);
}

.nav-auth .btn-register:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.3);
    text-decoration: none;
}

/* Auth Dropdown (logged in) */
.auth-dropdown {
    position: relative;
}

.auth-dropdown > a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border-radius: 10px;
    transition: all 0.25s ease;
}

.auth-dropdown .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a8a, #0891b2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.auth-dropdown:hover .user-avatar {
    box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.25);
}

.auth-dropdown .dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.auth-dropdown .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.95);
    border-left: 1px solid rgba(226, 232, 240, 0.8);
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    transform: rotate(45deg);
}

.auth-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    color: var(--text-secondary, #475569);
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    text-decoration: none;
}

.dropdown-menu a:hover {
    background: rgba(8, 145, 178, 0.06);
    color: var(--text-primary, #0f172a);
    text-decoration: none;
}

.dropdown-menu a i {
    width: 16px;
    text-align: center;
    font-size: 0.85rem;
}

.dropdown-menu .dropdown-divider {
    height: 1px;
    background: var(--border-color, #e2e8f0);
    margin: 0.35rem 0;
}

.dropdown-menu a.logout-link {
    color: var(--accent-red, #ef4444);
}

.dropdown-menu a.logout-link:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red, #ef4444);
}

/* Mobile Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    z-index: 100;
    transition: background 0.25s ease;
}

.nav-toggle:hover {
    background: rgba(8, 145, 178, 0.06);
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary, #0f172a);
    margin: 0 auto;
    position: relative;
    transition: all 0.3s ease;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary, #0f172a);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-toggle span::before,
.nav-toggle span::after {
    content: '';
    position: absolute;
    left: 0;
}

.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

/* Animated hamburger → X */
.nav-toggle.active span {
    background: transparent;
}

.nav-toggle.active span::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle.active span::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Nav Overlay */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: stretch;
        padding: 80px 1.5rem 2rem;
        gap: 0.25rem;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu a {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: 10px;
    }

    .nav-divider {
        display: none;
    }

    .nav-auth {
        flex-direction: column;
        margin-left: 0;
        margin-top: 0.5rem;
        gap: 0.5rem;
    }

    .nav-auth .btn-login,
    .nav-auth .btn-register {
        width: 100%;
        justify-content: center;
        padding: 0.75rem;
    }

    .auth-dropdown .dropdown-menu {
        position: static;
        background: rgba(0, 0, 0, 0.03);
        border: none;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        padding: 0.5rem 0;
    }

    .auth-dropdown .dropdown-menu::before {
        display: none;
    }
}

@media (max-width: 480px) {
    .navbar .container { height: 60px; }
    .nav-brand { font-size: 1.2rem; }
    .nav-brand .brand-icon { width: 34px; height: 34px; font-size: 0.95rem; }
}
