.top-navbar {
    background-color: rgba(11, 18, 31, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0 1rem;
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    /* ✅ STEP 2: Apply the defined height */
    height: var(--top-nav-height);
    display: flex; /* Helps vertically align content if needed */
    align-items: center;
    justify-content: flex-end;
}

nav.navbar.is-fixed-top {
    background-color: rgba(11, 18, 31, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
    padding: 0 1.5rem;
    /* ✅ STEP 4: Position the main nav directly below the top nav */
    top: var(--top-nav-height);
    /* ✅ STEP 2: Apply the defined height */
    height: var(--main-nav-height);
}

.top-nav-links {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.5rem;
}

.top-nav-links a {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
}

.top-nav-links a:hover {
    color: var(--text-color);
}

.top-nav-links .icon {
    margin-right: 0.5em;
}

.navbar.is-scrolled {
    border-bottom-color: var(--primary-color);
    box-shadow: 0 5px 20px rgba(13, 148, 233, 0.15);
}

.navbar-item,
.navbar-link {
    color: var(--text-muted);
    font-weight: 500;
}

/* --- Corrected Code --- */
.navbar-item:hover,
.navbar-link:hover,
.navbar-item:focus,
.navbar-link:focus,
.navbar-item:focus-visible,
.navbar-link:focus-visible,
.navbar-item.is-active {
    background-color: transparent !important;
    color: var(--primary-color) !important;
    outline: none; /* Also remove the default browser outline */
}
/*
  This rule ensures the "Client Area" button itself stays styled correctly
  when its dropdown is open, either by hovering on desktop or by being
  active on mobile.
*/
.navbar-item.has-dropdown:hover > .navbar-link,
.navbar-item.has-dropdown.is-active > .navbar-link {
    background-color: transparent !important;
    color: var(--primary-color) !important;
}

.navbar-brand .navbar-item {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.pixel-logo {
    width: 20px;
    height: 20px;
    fill: var(--primary-color);
    margin-right: 0.75rem;
    transition: transform 0.3s ease;
}

.navbar-brand .navbar-item:hover .pixel-logo {
    transform: rotate(180deg);
}

.navbar-item.has-dropdown .navbar-link::after {
    border-color: var(--text-muted);
}

.navbar-dropdown {
    background-color: #161c27;
    border: 1px solid var(--border-color);
}

.navbar-dropdown a.navbar-item {
    background-color: transparent;
}

.navbar-dropdown a.navbar-item:hover,
.navbar-dropdown a.navbar-item:focus {
    background-color: var(--background-light) !important;
    color: var(--primary-color) !important;
    outline: none;
}

.client-dropdown {
    min-width: 320px;
    padding: 0.5rem;
}

.client-dropdown .navbar-item {
    padding: 0.75rem;
    border-radius: 6px;
}

.client-dropdown .media {
    align-items: center;
}

.client-dropdown .media-left {
    margin-right: 1rem;
}

.client-dropdown .icon {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.client-dropdown .media-content .title {
    color: var(--text-color);
    margin-bottom: 0.25rem !important;
}

.client-dropdown .media-content .subtitle {
    color: var(--text-muted);
    margin-top: 0 !important;
}

/* --- Fix for Mobile Client Area Dropdown Behavior --- */
@media screen and (max-width: 1023px) {
    /* By default, the dropdown menu is hidden on mobile */
    .navbar-item.has-dropdown .navbar-dropdown {
        display: none;
    }

    /* ONLY show the dropdown menu if the parent item is clicked (becomes .is-active) */
    .navbar-item.has-dropdown.is-active .navbar-dropdown {
        display: block;
    }
}

/* --- Fix for Mobile Navbar Menu Background --- */
@media screen and (max-width: 1023px) {
    /*
      When the mobile menu is active, override Bulma's default white
      background with one from our dark theme.
    */
    .navbar-menu.is-active {
        background-color: var(--background-dark);
    }
}