/* ===================================
   Header Dropdown Menu
   =================================== */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Nav Link overrides for dropdown trigger */
.nav-link.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.dropdown-toggle i {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    margin-top: 2px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 8px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1001;
    list-style: none;
    /* Reset UL */
}

/* Show dropdown on hover (Desktop) */
@media (min-width: 769px) {
    .dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(10px);
        /* Slight offset from bottom of nav */
    }

    .dropdown:hover .dropdown-toggle i {
        transform: rotate(180deg);
    }
}

.dropdown-item {
    display: block;
    padding: 10px 20px;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--color-accent);
    border-left-color: var(--color-accent);
    padding-left: 24px;
}

/* Mobile Dropdown Styling - Override Desktop behaviors */
@media (max-width: 768px) {
    .dropdown {
        display: block;
        width: 100%;
    }

    .nav-link.dropdown-toggle {
        justify-content: center;
        width: 100%;
        gap: 10px;
    }

    .dropdown-menu {
        position: static;
        /* Flow naturally in document */
        width: 100%;
        display: none;
        /* Hidden by default */
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background-color: rgba(0, 0, 0, 0.2);
        padding: 0;
        margin-top: 10px;
        border-radius: var(--radius-sm);
    }

    /* Toggle class for mobile */
    .dropdown.active .dropdown-menu {
        display: block;
        animation: fadeIn 0.3s ease;
    }

    .dropdown.active .dropdown-toggle {
        color: var(--color-accent);
    }

    .dropdown.active .dropdown-toggle i {
        transform: rotate(180deg);
    }

    .dropdown.active .nav-link::after {
        width: 100%;
        /* Keep underline if active */
    }

    .dropdown-item {
        padding: 12px 20px;
        font-size: 0.9rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .dropdown-item:last-child {
        border-bottom: none;
    }
}