/* ═══════════════════════════════════════════════════════
   TradeFlare — Canonical Navigation (all pages)
   ═══════════════════════════════════════════════════════ */

.navbar,
.top-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 70px;
    background: rgba(42, 46, 57, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: background 0.3s;
    /* iOS Safari fix: force GPU layer so position:fixed works with backdrop-filter */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Scrolled state — same look */
.navbar.scrolled {
    background: rgba(42, 46, 57, 0.95);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

/* Logo / Brand */
.logo,
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
    font-size: inherit;
    font-weight: inherit;
    transform: none;
}

.logo:hover,
.brand:hover {
    transform: none;
    opacity: 0.9;
}

.logo svg,
.brand svg {
    height: 34px;
    width: auto;
    display: block;
}

/* Nav links wrapper */
.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
}

/* Individual links */
.nav-link {
    text-decoration: none;
    color: #9ca3af;
    font-size: 15px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    position: static;
    background: none;
    border: none;
}

.nav-link:hover {
    background: rgba(66, 165, 245, 0.1);
    color: #42a5f5;
}

.nav-link.active {
    background: #42a5f5;
    color: #ffffff;
    font-weight: 500;
}

/* Hamburger — hidden on desktop */
.hamburger {
    display: none;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 10px;
    line-height: 1;
    flex-shrink: 0;
    margin-left: 8px;
    transition: background 0.15s;
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .navbar,
    .top-nav {
        height: 58px;
        /* On mobile: solid background — backdrop-filter causes iOS fixed-position bug */
        background: rgba(13, 17, 27, 0.98);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    body {
        padding-top: 58px !important;
    }

    .nav-container {
        padding: 0 12px;
        height: 58px;
        position: relative;
    }

    .logo svg,
    .brand svg {
        height: 28px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 4px;
        padding: 10px 12px 14px;
        background: rgba(13, 17, 27, 0.98);
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
        z-index: 1001;
        box-sizing: border-box;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-link {
        font-size: 14px;
        padding: 10px 12px;
        width: 100%;
        box-sizing: border-box;
        border-radius: 8px;
    }

    .hamburger {
        display: flex;
    }
}
