/* ==================================================
   ECOMNIGHTHQ — SHARED NAVBAR STYLESHEET
   Single source of truth for all pages
   ================================================== */

/* ==================================================
   TEXT SELECTION / COPY (works alongside the custom cursor)
   The custom cursor sets `cursor:none`, which hid the native I-beam and
   made selecting/copying text feel broken. Restore the I-beam over real
   text + give selection a visible highlight — only on fine-pointer devices.
   ================================================== */
::selection { background: rgba(77, 124, 255, 0.35); }
::-moz-selection { background: rgba(77, 124, 255, 0.35); }
@media (hover: hover) and (pointer: fine) {
    p, h1, h2, h3, h4, h5, h6, li, blockquote, td, th, dd, dt,
    figcaption, .pol-body, .pol-body *, .course-gate .gate-terms,
    .course-item-title, .testimonial-text, .hero-desc, .section-desc {
        cursor: text;
    }
}

/* ==================================================
   SAFARI-SAFE BUTTON ICON ALIGNMENT
   Force icon + text to stay centered inside buttons (matches Chrome).
   Safari can drop flex-gap / mis-size inline SVGs, so pin the essentials.
   ================================================== */
.btn, .card-link, .svc-card-cta, .sc-plan-btn, .cd-buy-btn,
.section-btn, .course-item-btn, .form-submit-btn, .gs-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn > svg, .btn .icon-sm, .btn .icon-xs, .btn-arrow, .btn-play-icon,
.card-link svg, .svc-card-cta svg, .sc-plan-btn svg, .cd-buy-btn svg,
.section-btn svg, .course-item-btn svg {
    flex: 0 0 auto;
}
.btn-arrow > svg, .btn-play-icon > svg { width: 16px; height: 16px; display: block; }

/* Utility */
.desktop-only { display: flex; }
.mobile-only  { display: none !important; }

/* ==================================================
   NAV ICONS
   ================================================== */
.nav-icon {
    width: 15px;
    height: 15px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
    opacity: 0.7;
    transition: opacity 0.3s;
}
.nav-link:hover .nav-icon { opacity: 1; }
.nav-link.active .nav-icon { opacity: 1; color: var(--accent); }

.mobile-nav-icon {
    width: 22px;
    height: 22px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 12px;
    opacity: 0.6;
    flex-shrink: 0;
}

/* ==================================================
   THEME TOGGLE
   ================================================== */
.theme-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--btn-ghost-bg);
    border: 1px solid var(--border-glass);
    transition: all 0.3s var(--ease-out-expo);
    cursor: pointer;
    flex-shrink: 0;
}
.theme-toggle:hover {
    background: var(--btn-ghost-hover-bg);
    border-color: var(--border-hover);
    transform: scale(1.05);
}
.theme-toggle:active { transform: scale(0.95); }

.theme-icon {
    width: 18px;
    height: 18px;
    position: absolute;
    transition: all 0.4s var(--ease-out-expo);
    color: var(--text-primary);
}
[data-theme="dark"]  .sun-icon  { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="dark"]  .moon-icon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
[data-theme="light"] .sun-icon  { opacity: 0; transform: rotate(90deg) scale(0.5); }
[data-theme="light"] .moon-icon { opacity: 1; transform: rotate(0deg) scale(1); }

.theme-toggle-mobile { width: 36px; height: 36px; }
.theme-toggle-mobile .theme-icon { width: 16px; height: 16px; }

/* ==================================================
   NAVBAR
   ================================================== */
.navbar {
    position: fixed;
    top: var(--ticker-height);
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 100;
    transition: all 0.7s var(--ease-out-expo);
    border-bottom: 1px solid transparent;
}
.navbar.scrolled {
    height: 64px;
    background: var(--nav-scrolled-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 48px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.3px;
    color: var(--text-primary);
}
.logo-mark {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--btn-ghost-bg);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    transition: all 0.3s;
    color: var(--logo-svg-color);
}
.nav-logo:hover .logo-mark {
    border-color: var(--border-hover);
    box-shadow: 0 0 20px var(--accent-dim);
}
.logo-text { opacity: 0.95; }

/* Nav Links */
.nav-links { display: flex; gap: 24px; }
.nav-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    position: relative;
    padding: 4px 0;
    transition: color 0.3s var(--ease-out-expo);
    display: inline-flex;
    align-items: center;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--accent);
    transition: width 0.4s var(--ease-out-expo);
}
.nav-link:hover { color: var(--text-primary); }
.nav-link:hover::after { width: 100%; }
.nav-link.active { color: var(--text-primary); }
.nav-link.active::after { width: 100%; background: var(--text-primary); }

/* Nav Actions */
.nav-actions { display: flex; align-items: center; gap: 20px; }
.lang-switch {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-glass);
    background: var(--btn-ghost-bg);
    transition: all 0.3s;
}
.lang-switch:hover {
    background: var(--btn-ghost-hover-bg);
    border-color: var(--border-hover);
}
.lang-active  { color: var(--text-primary); }
.lang-divider { color: var(--border-subtle); }
.lang-dim     { color: var(--text-muted); transition: color 0.3s; }
.lang-switch:hover .lang-dim { color: var(--text-secondary); }
.login-link   { font-size: 0.82rem; font-weight: 500; color: var(--text-secondary) !important; }
.login-link:hover { color: var(--text-primary) !important; }

/* ==================================================
   MOBILE HAMBURGER & NAV RIGHT
   ================================================== */
.nav-right-mobile {
    display: none !important;
    align-items: center;
    gap: 10px;
}
/* Compact language toggle in the mobile top bar (next to the theme toggle) */
.lang-switch-topbar {
    font-size: 0.72rem;
    padding: 0 10px;
    height: 36px;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
}
.mobile-menu-toggle {
    z-index: 1001;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hamburger {
    width: 22px;
    height: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.hamburger span {
    display: block;
    width: 100%;
    height: 1.5px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.4s var(--ease-out-expo);
    transform-origin: center;
}
.mobile-menu-toggle.active .hamburger span:nth-child(1) { transform: translateY(7.25px)  rotate(45deg);  }
.mobile-menu-toggle.active .hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mobile-menu-toggle.active .hamburger span:nth-child(3) { transform: translateY(-7.25px) rotate(-45deg); }
/* Hamburger button carries .active directly (id="hamburgerBtn") */
.hamburger.active span:nth-child(1) { transform: translateY(7.25px)  rotate(45deg);  }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: translateY(-7.25px) rotate(-45deg); }

/* ==================================================
   FULLSCREEN MOBILE MENU
   ================================================== */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.mobile-menu-bg {
    position: absolute;
    inset: 0;
    background: var(--mobile-menu-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.mobile-menu.active {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}
.mobile-menu-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0 24px;
}
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    height: 64px;
    border-bottom: 1px solid var(--border-subtle);
}
.mobile-menu-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--btn-ghost-bg);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    transition: all 0.3s ease;
    cursor: pointer;
}
.mobile-menu-close:hover {
    background: var(--btn-ghost-hover-bg);
    border-color: var(--border-hover);
}
.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    justify-content: center;
    padding: 30px 0;
}
.mobile-link-wrap { overflow: hidden; }
.mobile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    font-weight: 500;
    color: var(--text-primary);
    transform: translateY(110%);
    transition: color 0.3s, transform 0.5s var(--ease-out-expo);
    padding: 8px 0;
    line-height: 1.2;
}
/* Reveal links when the menu opens — works with or without GSAP */
.mobile-menu.active .mobile-link { transform: translateY(0); }
.mobile-link::before {
    content: attr(data-index);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0.5;
    min-width: 20px;
}
.mobile-link:hover  { color: var(--accent); }
.mobile-link.active { color: var(--accent); }
.mobile-link .mobile-nav-icon       { color: var(--text-secondary); }
.mobile-link:hover .mobile-nav-icon { color: var(--accent); }

.mobile-nav-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    padding: 24px 0;
    opacity: 0;
    transform: translateY(20px);
}
.mobile-footer-left   { display: flex; align-items: center; gap: 24px; }
.mobile-link-small    { font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); }
.lang-switch-mobile   { font-size: 0.9rem; font-weight: 500; color: var(--text-primary); cursor: pointer; user-select: none; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border-glass); background: var(--btn-ghost-bg); transition: all 0.3s; }
.lang-switch-mobile .lang-dim { color: var(--text-muted); }

/* ==================================================
   RESPONSIVE
   ================================================== */
@media (max-width: 1200px) {
    .nav-container { padding: 0 32px; }
    .nav-links     { gap: 16px; }
    .nav-link      { font-size: 0.75rem; }
    .nav-icon      { width: 13px; height: 13px; }
}

@media (max-width: 1024px) {
    .desktop-only    { display: none !important; }
    .mobile-only     { display: flex !important; }
    .nav-right-mobile { display: flex !important; }
}

@media (max-width: 768px) {
    /* Every page reserves top-padding for the ticker via --ticker-height,
       but the ticker itself is hidden on mobile — zero the variable here
       (loaded after each page's own stylesheet) so no page is left with an
       empty gap under the navbar where the ticker used to be. */
    :root { --ticker-height: 0px !important; }

    .desktop-only    { display: none !important; }
    .mobile-only     { display: flex !important; }
    .nav-right-mobile { display: flex !important; }

    /* Hide the ticker on mobile (matches the home page) so it never overlaps
       the navbar/hamburger on pages that load their own stylesheet. */
    .top-ticker { display: none !important; }

    .navbar {
        top: 0;
        height: 64px;
        background: var(--nav-scrolled-bg);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border-subtle);
    }
    .navbar.scrolled { top: 0; height: 58px; }
    .nav-container   { padding: 0 16px; display: flex; justify-content: space-between; align-items: center; height: 100%; }
    .nav-logo { gap: 8px; }
    .logo-text { display: none; }
    .nav-right-mobile { gap: 8px !important; }
    .lang-switch-topbar { padding: 0 8px; font-size: 0.65rem; }
    .theme-toggle-mobile { width: 32px; height: 32px; }
    .theme-toggle-mobile .theme-icon { width: 14px; height: 14px; }
}

@media (max-width: 480px) {
    .nav-container { padding: 0 16px; }
}
