.top-nav {
    width: min(calc(100% - 2rem), 1100px);
    margin: 0 auto;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 0.75rem 0;
}

.nav-link,
.dropdown-toggle {
    appearance: none;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.03);
    color: #f7f2ff;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    transition: 0.2s ease;
}

.nav-link:hover,
.dropdown-toggle:hover,
.dropdown:hover .dropdown-toggle,
.dropdown-item:hover {
    background: rgba(142, 46, 255, 0.18);
    border-color: rgba(142, 46, 255, 0.28);
}

.nav-link.active,
.dropdown.active .dropdown-toggle,
.dropdown-item.active {
    background: linear-gradient(135deg, #8e2eff, #ff2e7a);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 8px 22px rgba(142, 46, 255, 0.28);
}

.dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    padding: 0.75rem 1rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    display: none;
    flex-direction: column;
    padding: 0.5rem 0;
    margin-top: 0;
    z-index: 1000;
}

/* Keep menu open on hover */
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    display: flex;
}

.caret {
    font-size: 0.9em;
    margin-left: 0.35rem;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    display: none;
    background: rgba(18, 19, 35, 0.98);
    border: 1px solid rgba(142, 46, 255, 0.28);
    border-radius: 16px;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.35);
    padding: 0.5rem;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    text-decoration: none;
    color: #f7f2ff;
    font-weight: 700;
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    transition: 0.2s ease;
}

.dropdown::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 12px;
}

@media (max-width: 720px) {
    .top-nav {
        width: min(calc(100% - 1rem), 1100px);
        gap: 0.35rem;
        min-height: auto;
        padding: 0.6rem 0;
    }

    .nav-link,
    .dropdown-toggle {
        padding: 0.7rem 0.9rem;
        font-size: 0.95rem;
    }

    .dropdown-menu {
        left: 0;
        right: 0;
        transform: none;
        min-width: 100%;
    }
}
