/* ── Global Navigation ── */
:root {
    --nav-height: 56px;
    --nav-bg: rgba(5, 5, 5, 0.95);
    --nav-border: rgba(0, 242, 255, 0.1);
    --nav-text: #ffffff;
    --nav-hover: #00f2ff;
    --nav-active: #00f2ff;
}

.global-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    transition: transform 0.3s ease;
}

.global-nav.hidden {
    transform: translateY(-100%);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--nav-text);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.nav-brand:hover {
    color: var(--nav-hover);
}

/* Search button */
.nav-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--nav-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    margin-right: 8px;
}

.nav-search-btn:hover {
    background: rgba(0, 242, 255, 0.1);
    border-color: var(--nav-hover);
}

.nav-brand-icon {
    font-size: 20px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--nav-text);
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.nav-links a:hover {
    background: rgba(0, 242, 255, 0.1);
    color: var(--nav-hover);
    opacity: 1;
}

.nav-links a.active {
    background: rgba(0, 242, 255, 0.15);
    color: var(--nav-active);
    opacity: 1;
    font-weight: 500;
}

.nav-links .nav-icon {
    font-size: 16px;
}

/* Mobile hamburger */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 10002;
}

.nav-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--nav-text);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.nav-hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.open span:nth-child(2) {
    opacity: 0;
}

.nav-hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu */
@media (max-width: 768px) {
    .nav-hamburger {
        display: flex;
    }

    /* Backdrop overlay when menu is open */
    .nav-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 9999;
    }

    .nav-backdrop.active {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        background: #050505;
        flex-direction: column;
        padding: 0;
        gap: 0;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        z-index: 10001;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    }

    .nav-links::before {
        content: '';
        height: var(--nav-height);
        background: var(--nav-bg);
        border-bottom: 1px solid var(--nav-border);
        display: block;
    }

    .nav-links.open {
        transform: translateX(0);
    }

    .nav-links a {
        font-size: 16px;
        padding: 14px 20px;
        width: 100%;
        border-radius: 0;
        border-left: 3px solid transparent;
    }

    .nav-links a:hover {
        padding-left: 16px;
        border-left-color: var(--nav-hover);
    }

    .nav-links a.active {
        border-left-color: var(--nav-active);
        background: rgba(0, 242, 255, 0.1);
    }

    /* Lock body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }

    /* Ensure nav stays on top of everything */
    .global-nav {
        padding: 0 16px;
    }
}

/* Body padding to account for fixed nav */
body.has-nav {
    padding-top: var(--nav-height);
}

/* ── Version Badge ── */
.version-badge {
    position: fixed;
    bottom: 8px;
    right: 12px;
    z-index: 9999;
    font-size: 0.55rem;
    letter-spacing: 1.5px;
    opacity: 0.15;
    color: var(--nav-text, #ffffff);
    font-family: 'Courier New', monospace;
    user-select: none;
    pointer-events: none;
}

/* ── Scroll-to-top button ── */
.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 242, 255, 0.2);
    border: 1px solid rgba(0, 242, 255, 0.3);
    color: var(--nav-hover);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: rgba(0, 242, 255, 0.3);
    transform: translateY(-2px);
}
