/* =============================================================
   HFThot Research Lab — Navigation Bar
   Gold + dark theme — shared across ALL pages
   ============================================================= */

/* ── Navigation Bar ────────────────────────────────────────── */
.main-nav {
    background: #0f0f1e;
    padding: 0.35rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    width: 100%;
    max-width: 100vw;
}

.nav-container {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
}

/* ── Logo ───────────────────────────────────────────────────── */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo .nav-logo-mark {
    height: 56px;
    width: 56px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5)) brightness(1.15);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.nav-logo .nav-logo-wordmark {
    height: 26px;
    width: auto;
    object-fit: contain;
    /* Make wordmark bright white so it pops on dark bg */
    filter: brightness(0) invert(1) drop-shadow(0 0 6px rgba(255, 255, 255, 0.15));
    transition: filter 0.3s ease, transform 0.3s ease;
}

.nav-logo:hover .nav-logo-mark {
    transform: scale(1.05);
    filter: drop-shadow(0 0 16px rgba(212, 175, 55, 0.8)) brightness(1.3);
}

.nav-logo:hover .nav-logo-wordmark {
    filter: brightness(0) invert(1) drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

@media (max-width: 768px) {
    .nav-logo .nav-logo-mark {
        height: 44px;
        width: 44px;
    }
    .nav-logo .nav-logo-wordmark {
        height: 20px;
    }
}

/* ── Nav Menu ───────────────────────────────────────────────── */
.nav-menu {
    list-style: none;
    display: flex;
    gap: 0.15rem;
    align-items: center;
    margin: 0;
    padding: 0;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
    position: relative;
    white-space: nowrap;
    font-size: 0.82rem;
    padding: 0.6rem 0.5rem;
    display: block;
}

.nav-menu > li > a:hover,
.nav-menu > li > a.active {
    color: #d4af37;
}

.nav-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 0.3rem;
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
    height: 2px;
    background: #d4af37;
    transform: scaleX(0);
    transition: transform 0.3s;
}

.nav-menu > li > a:hover::after,
.nav-menu > li > a.active::after {
    transform: scaleX(1);
}

/* ── Dropdown Menus ─────────────────────────────────────────── */
.has-dropdown > a::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-top: 4px solid currentColor;
    margin-left: 4px;
    vertical-align: middle;
    opacity: 0.6;
    transition: transform 0.2s;
    position: relative;
    top: -0.5px;
    float: right;
    margin-top: 0.55em;
}

/* Base dropdown styles — site.css overrides with opacity/pointer-events approach.
   Keep minimal fallback here for pages that only load nav.css. */
.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 220px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    list-style: none;
    margin: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.has-dropdown:hover > .nav-dropdown {
    opacity: 1;
    pointer-events: auto;
}

.nav-dropdown li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.45rem 1rem;
    color: #ccc;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 400;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.nav-dropdown li a:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
}

/* no underline on dropdown items */
.nav-dropdown li a::after {
    display: none;
}

.dd-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

/* ── Nav Controls (right side) ──────────────────────────────── */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

/* ── CTA Button (Gamification / Rewards) ────────────────────── */
.nav-btn-cta {
    background: linear-gradient(135deg, #d4af37, #f4d03f) !important;
    color: #0f0f1e !important;
    -webkit-text-fill-color: #0f0f1e !important;
    padding: 0.35rem 0.75rem !important;
    border-radius: 20px;
    font-weight: 700 !important;
    font-size: 0.78rem !important;
    text-decoration: none !important;
    white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s;
}

.nav-btn-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.5);
}

/* override underline on CTA */
.nav-btn-cta::after {
    display: none !important;
}

/* ── Auth Button ────────────────────────────────────────────── */
#nav-auth-btn {
    padding: 6px 16px;
    border-radius: 20px;
    white-space: nowrap;
    background: #d4af37;
    color: #0f0f1e;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.82rem;
    display: inline-block;
    transition: transform 0.2s, box-shadow 0.2s;
}

#nav-auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.5);
}

/* ── Demo Button ────────────────────────────────────────────── */
.nav-demo-btn {
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    color: #0f0f1e !important;
    font-weight: 700;
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 20px;
    display: inline-block;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
}

.nav-demo-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.5);
    color: #0f0f1e !important;
}

/* ── Language Toggle ────────────────────────────────────────── */
.nav-lang {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-lang button {
    background: transparent;
    border: 1px solid transparent;
    padding: 5px 10px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    color: #e0e0e0;
    transition: all 0.3s;
    white-space: nowrap;
}

.nav-lang button.active {
    background: #d4af37;
    color: #0f0f1e;
}

.nav-lang button:hover:not(.active) {
    background: rgba(212, 175, 55, 0.15);
}

/* ── Mobile Toggle ──────────────────────────────────────────── */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: 2px solid #d4af37;
    color: #d4af37;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2rem;
}

/* ── Legacy / compat classes ────────────────────────────────── */
.nav-demo-item { margin-left: 0.4rem; }
.theme-toggle  { display: none !important; }

.btn-primary {
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    color: #0f0f1e !important;
    font-weight: 600;
    text-decoration: none;
    padding: 5px 14px;
    border-radius: 20px;
    display: inline-block;
    transition: all 0.3s;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.5);
    color: #0f0f1e !important;
}

/* ── Mobile Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: #1a1a2e;
        flex-direction: column;
        padding: 1.5rem 2rem;
        gap: 0.15rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    }

    .nav-menu.active {
        display: flex;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .nav-controls {
        display: none;
    }

    .nav-menu.active ~ .nav-controls {
        display: flex;
        width: 100%;
        justify-content: center;
        padding: 0.5rem 0;
    }

    /* Dropdowns in mobile = always visible */
    .nav-dropdown {
        position: static;
        transform: none;
        display: none;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0 0 0 1rem;
        min-width: auto;
    }

    .has-dropdown:hover > .nav-dropdown,
    .has-dropdown.open > .nav-dropdown {
        display: block;
        animation: none;
    }

    .nav-dropdown li a {
        padding: 0.3rem 0.5rem;
        font-size: 0.76rem;
    }
}
