﻿.topnav {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 15, 20, 0.85);
    backdrop-filter: blur(12px);
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 999;
}

    /* Brand */
    .topnav .brand {
        font-size: 1.4rem;
        font-weight: 600;
        color: var(--color-blue-light);
    }

/* Main link groups */
.nav-links,
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Links */
.topnav a {
    color: var(--color-text);
    font-weight: 500;
    text-decoration: none;
}

    .topnav a:hover {
        color: var(--color-cyan);
    }

/* Dropdown container */
.dropdown {
    position: relative;
}

    .dropdown > span {
        cursor: pointer;
        color: var(--color-text);
    }

        .dropdown > span:hover {
            color: var(--color-cyan);
        }

/* Hidden by default */
.dropdown-menu {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--color-bg-panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    z-index: 1000;
}

/* ✅ Show menu when .open is applied from Blazor */
.dropdown.open > .dropdown-menu {
    display: flex;
}

/* SECOND LEVEL DROPDOWN */
.dropdown-sub {
    position: relative;
    padding-left: 0.5rem;
}

    .dropdown-sub .dropdown-menu {
        left: 100%;
        top: 0;
    }

/* MOBILE TOGGLE */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.7rem;
    color: white;
    cursor: pointer;
}

/* MOBILE MODE */
@media (max-width: 900px) {
    .mobile-toggle {
        display: block;
    }

    .nav-links,
    .nav-actions {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-top: 1rem;
    }

    .topnav.nav-open .nav-links,
    .topnav.nav-open .nav-actions {
        display: flex;
    }

    /* ✅ In mobile, dropdowns expand inline when .open is toggled */
    .dropdown-menu {
        position: relative;
        box-shadow: none;
        background: none;
        padding-left: 1rem;
    }
}
