/* ============================================================
   HFThot Research Lab — Shared Site Stylesheet
   New color palette (distinct from Binance), navbar, dark/light mode
   ============================================================ */

/* ── CSS Variables ── */
:root {
    /* Brand identity — cyan/teal replaces Binance-like yellow as primary */
    --primary:      #22d3ee;   /* cyan-400 */
    --primary-dark: #0891b2;   /* cyan-600 */
    --primary-glow: rgba(34, 211, 238, 0.22);
    --cta:          #f97316;   /* orange-500 — CTA buttons */
    --cta-dark:     #ea6c0a;
    --cta-glow:     rgba(249, 115, 22, 0.25);
    --logo-gold:    #d4af37;   /* kept ONLY for the Thot logo mark */
    --logo-gold-glow: rgba(212, 175, 55, 0.35);

    /* Dark mode (default) */
    --page-bg:      #06091a;
    --card-bg:      rgba(14, 20, 40, 0.8);
    --card-hover:   rgba(22, 32, 60, 0.95);
    --text:         #e2e8f0;
    --text-muted:   #94a3b8;
    --text-light:   #e2e8f0;
    --text-gray:    #94a3b8;
    --border:       rgba(34, 211, 238, 0.12);
    --border-hover: rgba(34, 211, 238, 0.35);
    --glass-bg:     rgba(255, 255, 255, 0.03);
    --glass-border: rgba(34, 211, 238, 0.15);
    --shadow:       rgba(0, 0, 0, 0.5);
    --nav-bg:       transparent;
    --nav-scrolled: rgba(6, 9, 26, 0.9);
    --darker-bg:    #06091a;
    --dark-bg:      #0c1222;
    /* legacy compat aliases */
    --primary-gold: #d4af37;
    --accent-gold:  #22d3ee;
}

/* Light mode */
[data-theme="light"] {
    --page-bg:      #f8fafc;
    --card-bg:      #ffffff;
    --card-hover:   #f0f9ff;
    --text:         #0f172a;
    --text-muted:   #475569;
    --text-light:   #0f172a;
    --text-gray:    #475569;
    --border:       rgba(8, 145, 178, 0.2);
    --border-hover: rgba(8, 145, 178, 0.5);
    --glass-bg:     rgba(8, 145, 178, 0.04);
    --glass-border: rgba(8, 145, 178, 0.2);
    --shadow:       rgba(15, 23, 42, 0.1);
    --nav-bg:       transparent;
    --nav-scrolled: rgba(248, 250, 252, 0.92);
    --darker-bg:    #f8fafc;
    --dark-bg:      #f1f5f9;
    /* legacy compat */
    --primary-gold: #0891b2;
    --accent-gold:  #0891b2;
}

/* ── Global Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Inter', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--page-bg);
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
}

[data-theme="light"] body {
    background: var(--page-bg);
}

/* Ambient background glows */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 15% 40%, rgba(34, 211, 238, 0.06) 0%, transparent 55%),
        radial-gradient(circle at 85% 70%, rgba(249, 115, 22, 0.04) 0%, transparent 55%);
    z-index: -1;
    pointer-events: none;
}
[data-theme="light"] body::before {
    background:
        radial-gradient(circle at 15% 40%, rgba(34, 211, 238, 0.04) 0%, transparent 55%),
        radial-gradient(circle at 85% 70%, rgba(249, 115, 22, 0.03) 0%, transparent 55%);
}

/* ============================================================
   NAVIGATION BAR
   ============================================================ */
.main-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--nav-bg);
    transition: background 0.35s ease, backdrop-filter 0.35s ease, box-shadow 0.35s ease;
    padding: 0.35rem 0 !important;
    /* no border by default */
}

/* Scrolled state — added via JS */
.main-nav.scrolled {
    background: var(--nav-scrolled);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    box-shadow: 0 1px 0 var(--border), 0 4px 24px var(--shadow);
}

/* ╔═══════════════════════════════════════════════════════════╗
   ║  LOCKED NAV VALUES — DO NOT MODIFY WITHOUT FULL AUDIT   ║
   ║  All !important flags are intentional to prevent any     ║
   ║  inline CSS, page-specific styles, or later rules from   ║
   ║  breaking the navbar layout. Test ALL pages before edit. ║
   ╚═══════════════════════════════════════════════════════════╝ */
.nav-container {
    max-width: 100% !important;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem !important;
    gap: 0.5rem !important;
}

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

.nav-logo img {
    height: 56px !important;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.4));
    transition: filter 0.3s ease, transform 0.3s ease;
}

.nav-logo .nav-logo-mark {
    height: 88px !important;
    width: 88px;
    object-fit: contain;
    filter: drop-shadow(0 0 14px rgba(212, 175, 55, 0.48));
}

.nav-logo .nav-logo-wordmark {
    height: 72px !important;
    width: auto;
    filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.32));
}

.nav-logo:hover img {
    transform: scale(1.06);
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.75));
}

.nav-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.nav-logo-text .brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--primary);
    text-shadow: 0 0 14px var(--primary-glow);
}
.nav-logo-text .brand-sub {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    text-transform: uppercase;
}
[data-theme="light"] .nav-logo-text .brand-name {
    color: var(--primary-dark);
    text-shadow: none;
}

@media (max-width: 768px) {
    .nav-logo .nav-logo-mark {
        height: 68px !important;
        width: 68px;
    }

    .nav-logo .nav-logo-wordmark {
        height: 52px !important;
    }
}

/* ── Nav Menu ── */
.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.25rem !important;
    flex-wrap: nowrap;
    margin-left: 0.5rem;
    margin-right: 0.25rem;
    flex: 0 1 auto;
    min-width: 0;
}
.nav-menu li { display: flex; align-items: center; }

.nav-menu a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem !important;
    font-weight: 500;
    padding: 4px 6px !important;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
    position: relative;
}

.nav-menu a[data-i18n="nav.foryou"],
.nav-menu a[data-i18n="nav.for_you"] {
    white-space: normal;
    text-align: center;
    line-height: 1.12;
    min-width: 5.5rem;
}
.nav-menu a:hover,
.nav-menu a.active {
    color: var(--text);
    background: var(--glass-bg);
}
[data-theme="light"] .nav-menu a:hover,
[data-theme="light"] .nav-menu a.active {
    color: var(--primary-dark);
    background: rgba(8, 145, 178, 0.07);
}

/* Underline active */
.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 11px;
    right: 11px;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
}

/* Demo CTA button */
.nav-btn-cta {
    background: var(--cta);
    color: #fff !important;
    padding: 4px 10px !important;
    border-radius: 16px !important;
    font-weight: 600 !important;
    font-size: 0.78rem !important;
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s !important;
    white-space: nowrap;
    margin-left: 0.15rem;
}
.nav-btn-cta:hover {
    background: var(--cta-dark) !important;
    box-shadow: 0 4px 16px var(--cta-glow) !important;
    transform: translateY(-1px) !important;
    color: #fff !important;
}
.nav-btn-cta:hover::after { display: none; }
.nav-btn-cta.active::after { display: none; }

/* ── Nav Right controls ── */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 6px !important;
    flex-shrink: 0;
    margin-left: 0.25rem;
}

.nav-controls .nav-demo-btn {
    display: none !important;
}

/* Language toggle */
.nav-lang {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px;
}
.nav-lang button {
    background: transparent;
    border: none;
    padding: 4px 10px;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-muted);
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-lang button.active {
    background: var(--primary);
    color: var(--page-bg);
}
[data-theme="light"] .nav-lang button.active {
    background: var(--primary-dark);
    color: #fff;
}

/* Hide the i18n.js fallback lang-toggle injected into nav-menu */
#lang-toggle,
.lang-toggle {
    display: none !important;
}
.nav-lang button:hover:not(.active) {
    color: var(--text);
    background: var(--glass-bg);
}

/* Dark/Light mode toggle */
.theme-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.25s;
    display: none !important;
}
.theme-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-glow);
}

/* ── Mobile hamburger ── */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
}

@media (max-width: 900px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        width: 100%;
        background: var(--dark-bg);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border);
        gap: 0.25rem;
    }
    .nav-menu.active { display: flex; }
    .nav-menu a { width: 100%; padding: 10px 12px; }
    .mobile-menu-toggle { display: flex; }
}

/* ============================================================
   SHARED TYPOGRAPHY & UTILITIES
   ============================================================ */
h1, h2, h3, h4, h5, h6 { line-height: 1.25; }

/* Gradient text — primary color (cyan) */
.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Legacy gold gradient — kept for backward compat */
.text-gradient-gold {
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass cards */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
    backdrop-filter: blur(12px);
}
.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 32px var(--shadow), 0 0 0 1px var(--border-hover);
    transform: translateY(-3px);
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--cta);
    color: #fff;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
    white-space: nowrap;
}
.btn-primary:hover {
    background: var(--cta-dark);
    box-shadow: 0 6px 24px var(--cta-glow);
    transform: translateY(-2px);
    color: #fff;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--primary);
    padding: 0.73rem 1.8rem;
    border: 2px solid var(--primary);
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-secondary:hover {
    background: var(--primary-glow);
    box-shadow: 0 4px 20px var(--primary-glow);
}

/* Section titles */
.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}
.section-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 3rem;
    text-align: center;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Section spacing */
.section { padding: 80px 0; }
.section-header { text-align: center; margin-bottom: 3rem; }

/* ── Footer ── */
footer.site-footer {
    background: var(--dark-bg);
    border-top: 1px solid var(--border);
    padding: 3rem 2rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}
footer.site-footer a {
    color: var(--primary);
    text-decoration: none;
}
footer.site-footer a:hover { text-decoration: underline; }
.footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

/* ── Scroll JS helper ── */
/* Applied via JS: when page > 10px scroll adds .scrolled to .main-nav */

/* ── Mega-menu Dropdowns ── */
.nav-menu li.has-dropdown { position: relative; }

.nav-dropdown {
    position: absolute;
    top: 100%;                  /* flush with parent — no dead zone */
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    background: rgba(6, 9, 26, 0.97);
    border: 1px solid rgba(34, 211, 238, 0.22);
    border-radius: 12px;
    padding: 12px 0.35rem 0.5rem; /* 12px top padding replaces position gap */
    min-width: 210px;
    list-style: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.65), 0 0 0 1px rgba(34,211,238,0.08);
    z-index: 9999;
}

/* Arrow caret centered above dropdown content */
.nav-dropdown::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: rgba(6, 9, 26, 0.97);
    border-left: 1px solid rgba(34, 211, 238, 0.22);
    border-top: 1px solid rgba(34, 211, 238, 0.22);
}

.nav-menu li.has-dropdown:hover .nav-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* Rightmost items: align dropdown to the right to prevent viewport overflow */
.nav-menu > li:nth-last-child(-n+3).has-dropdown .nav-dropdown {
    left: auto;
    right: -1rem;
    transform: translateY(-6px);
}
.nav-menu > li:nth-last-child(-n+3).has-dropdown:hover .nav-dropdown {
    transform: translateY(0);
}
.nav-menu > li:nth-last-child(-n+3).has-dropdown .nav-dropdown::before {
    left: auto;
    right: 1.5rem;
    transform: rotate(45deg);
}

.nav-dropdown > li > a {
    display: flex !important;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.8rem;
    border-radius: 7px;
    color: var(--text-muted) !important;
    font-size: 0.82rem !important;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s !important;
}

.nav-dropdown > li > a::after { display: none !important; }

.nav-dropdown > li > a:hover {
    background: rgba(34, 211, 238, 0.09) !important;
    color: var(--primary) !important;
}

.nav-dropdown > li > a .dd-icon { font-size: 0.9rem; flex-shrink: 0; opacity: 0.8; }

@media (max-width: 768px) {
    .nav-dropdown { display: none; }
}
