/* =============================================
   Navigation — Vested Finance Style
   ============================================= */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
    padding: 10px 0;
}

.nav-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    text-decoration: none;
    z-index: 1001;
}

.navbar:not(.scrolled) .logo-text {
    color: #fff;
}

.navbar:not(.scrolled) .logo-mark {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-spacer {
    height: 80px;
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    white-space: nowrap;
}

.navbar.scrolled .nav-link {
    color: var(--text-body);
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.navbar.scrolled .nav-link:hover,
.navbar.scrolled .nav-link.active {
    color: var(--accent-dark);
    background: rgba(0, 184, 148, 0.06);
}

.dropdown-arrow {
    transition: transform var(--transition);
}

/* Dropdown */
.has-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 580px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.25s ease;
}

.dropdown-menu-sm {
    min-width: 220px;
    padding: 12px;
}

.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.has-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition);
}

.dropdown-item:hover {
    background: var(--bg-light);
}

.dropdown-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(0, 184, 148, 0.08), rgba(26, 31, 113, 0.06));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
}

.dropdown-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.dropdown-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.dropdown-item-simple {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-body);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition);
}

.dropdown-item-simple:hover {
    background: var(--bg-light);
    color: var(--accent-dark);
}

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-actions .btn {
    font-size: 13px;
}

.navbar:not(.scrolled) .nav-actions .btn-primary {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.navbar:not(.scrolled) .nav-actions .btn-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.nav-cta-mobile {
    display: none;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.navbar.scrolled .hamburger span {
    background: var(--text-dark);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* =============================================
   Mobile Navigation
   ============================================= */

@media (max-width: 1024px) {
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-white);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 100px 24px 40px;
        gap: 0;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        z-index: 999;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-link {
        color: var(--text-dark);
        padding: 14px 0;
        font-size: 16px;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-link:hover,
    .nav-link.active {
        color: var(--accent);
        background: transparent;
    }

    .dropdown-menu {
        position: static;
        transform: none;
        min-width: auto;
        border: none;
        box-shadow: none;
        padding: 0 0 0 16px;
        display: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .has-dropdown.mobile-open .dropdown-menu {
        display: block;
    }

    .has-dropdown.mobile-open .dropdown-arrow {
        transform: rotate(180deg);
    }

    .dropdown-grid {
        grid-template-columns: 1fr;
    }

    .dropdown-item {
        padding: 10px 0;
    }

    .dropdown-icon {
        width: 32px;
        height: 32px;
    }

    .nav-cta-mobile {
        display: block;
        padding-top: 16px;
        border-bottom: none;
    }

    .nav-cta-mobile .btn {
        width: 100%;
    }

    .hamburger {
        display: flex;
    }

    .nav-actions .btn {
        display: none;
    }

    /* When menu is open, hamburger should be dark */
    .hamburger.active span {
        background: var(--text-dark);
    }
}
