.global-navbar {
    position: sticky;
    top: 0;
    z-index: 9999;
    width: 100%;
    background: rgba(19, 19, 22, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #27272a;
    box-sizing: border-box;
}
.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.logo-icon-img { border-radius: 6px; flex-shrink: 0; }
.logo-text { color: #ffffff; font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }
.logo-accent { color: #10b981; }
.logo-badge {
    background: #1c1c21;
    color: #a1a1aa;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #27272a;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.nav-item {
    color: #a1a1aa;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.nav-item:hover,
.nav-item.active { color: #10b981; }
.github-link {
    background: #18181b;
    border: 1px solid #27272a;
    padding: 6px 12px;
    border-radius: 6px;
    color: #cbd5e1;
}
.github-link:hover {
    background: #27272a;
    color: #ffffff !important;
    border-color: #3f3f46;
}
.gh-icon { width: 14px; height: 14px; }
@media (max-width: 640px) {
    .navbar-container {
        flex-direction: column;
        align-items: center;
        padding: 8px 12px;
        gap: 6px;
    }
    .brand-logo {
        margin-bottom: 2px;
    }
    .logo-badge,
    .github-link { display: none; }
    .nav-links {
        display: flex;
        flex-direction: row;
        justify-content: flex-start; /* Safe alignment for scrolling */
        align-items: center;
        flex-wrap: nowrap;
        width: 100%;
        gap: 8px;
        margin: 0;
        padding: 2px 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-links::-webkit-scrollbar {
        display: none;
    }
    /* Center items on viewport if there's enough space */
    @media (min-width: 320px) {
        .nav-links {
            justify-content: center;
        }
    }
    .nav-item {
        font-size: 11px;
        font-weight: 600;
    }
    .nav-label-long {
        display: none;
    }
}

/* Focus Ring Accessibility (a11y) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 4px;
}

/* Navigation Dropdown styling */
.nav-dropdown {
    position: relative;
    display: inline-block;
}
.nav-dropdown-toggle {
    cursor: pointer;
    user-select: none;
}
.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #131316;
    min-width: 170px;
    box-shadow: 0px 8px 30px rgba(0, 0, 0, 0.7);
    border: 1px solid #27272a;
    border-radius: 8px;
    z-index: 10000;
    margin-top: 8px;
    padding: 6px 0;
}
.nav-dropdown-content::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
    background: transparent;
}
.nav-dropdown-content a {
    color: #a1a1aa;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
    text-align: left;
}
.nav-dropdown-content a:hover {
    background-color: #1c1c21;
    color: #10b981;
}
/* Trigger Dropdown on Hover on Desktop */
@media (min-width: 641px) {
    .nav-dropdown:hover .nav-dropdown-content {
        display: block;
    }
}
/* Adapt to mobile collapsible/inline list */
@media (max-width: 640px) {
    .nav-dropdown {
        display: inline-block;
        width: auto;
    }
    .nav-dropdown-content {
        position: static;
        display: flex; /* Display items horizontally inline! */
        flex-direction: row;
        gap: 8px;
        background: transparent;
        border: none;
        box-shadow: none;
        transform: none;
        margin-top: 0;
        padding: 0;
    }
    .nav-dropdown-content a {
        padding: 0;
        text-align: center;
        font-size: 11px;
        font-weight: 600;
    }
    .nav-dropdown-toggle {
        display: none; /* Hide the dropdown toggle text e.g. "GBA Hacks ▾" on mobile since the links are shown directly! */
    }
}
