/* ============ TUBELIGHT NAVIGATION ============ */
/* Shared nav styles — included by all site pages */

/* CSS variables (pages should define these in their own :root, but fallbacks here) */
:root {
    --accent: #22B285;
    --accent-dark: #18926C;
    --blue: #0285FF;
    --accent-rgb: 34, 178, 133;
    --blue-rgb: 2, 133, 255;
}

/* ---- Scroll Progress Bar ---- */
#scrollProgress {
    position: fixed; top: 0; left: 0; height: 2px; z-index: 100;
    background: linear-gradient(90deg, var(--accent), var(--blue));
    width: 0; transition: width 0.1s;
}

/* ---- Main Nav Bar ---- */
.tubelight-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 20px 0;
    transition: background 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                padding 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                backdrop-filter 0.8s ease;
}
.tubelight-nav.scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 12px 0;
}

/* Subpages: nav always has background (no transparent hero) */
.tubelight-nav.subpage {
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 12px 0;
}

.tubelight-nav-inner {
    max-width: 2400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    padding: 0 4rem;
    transition: max-width 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                padding 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.tubelight-nav.scrolled .tubelight-nav-inner,
.tubelight-nav.subpage .tubelight-nav-inner {
    max-width: 1280px;
    padding: 0 24px;
}

/* ---- Logo ---- */
.tubelight-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
    opacity: 0;
    width: 0;
    margin-right: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateX(-20px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                width 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                margin-right 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.tubelight-nav.scrolled .tubelight-logo,
.tubelight-nav.subpage .tubelight-logo {
    opacity: 1;
    width: 200px;
    margin-right: auto;
    pointer-events: auto;
    transform: translateX(0);
}
.tubelight-logo img {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    transition: transform 0.3s;
}
.tubelight-logo:hover img { transform: scale(1.1); }
.tubelight-logo span {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

/* ---- Pill Container ---- */
.tubelight-pill {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(17, 17, 24, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 9999px;
    padding: 6px;
    position: relative;
    transition: padding 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.tubelight-nav.scrolled .tubelight-pill,
.tubelight-nav.subpage .tubelight-pill {
    padding: 4px;
}

/* ---- Indicator (background highlight) ---- */
.tubelight-indicator {
    position: absolute;
    height: calc(100% - 12px);
    top: 6px;
    border-radius: 9999px;
    background: rgba(255,255,255,0.06);
    opacity: 0;
    transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.25s ease,
                height 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                top 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 0;
    pointer-events: none;
}
.tubelight-nav.scrolled .tubelight-indicator,
.tubelight-nav.subpage .tubelight-indicator {
    height: calc(100% - 8px);
    top: 4px;
}

/* ---- Glow (tubelight effect) ---- */
.tubelight-glow {
    position: absolute;
    top: -1px;
    height: 3px;
    border-radius: 9999px;
    background: var(--accent);
    filter: blur(6px);
    opacity: 0;
    transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.25s ease;
    z-index: 1;
    pointer-events: none;
}
.tubelight-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent);
    border-radius: 9999px;
    filter: blur(12px);
    opacity: 0.5;
}

/* ---- Nav Links ---- */
.tubelight-link {
    position: relative;
    z-index: 1;
    padding: 14px 26px;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.3s,
                padding 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                font-size 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}
.tubelight-nav.scrolled .tubelight-link,
.tubelight-nav.subpage .tubelight-link {
    padding: 10px 20px;
    font-size: 14px;
}
.tubelight-link:hover { color: rgba(255,255,255,0.9); }
.tubelight-link.active { color: white; }

/* ---- CTA Button ---- */
.tubelight-nav-cta {
    font-size: 15px;
    font-weight: 600;
    color: white;
    text-decoration: none;
    padding: 14px 28px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: 9999px;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 12px rgba(var(--accent-rgb),0.3);
    border: 1px solid rgba(var(--accent-rgb),0.4);
}
.tubelight-nav.scrolled .tubelight-nav-cta,
.tubelight-nav.subpage .tubelight-nav-cta {
    font-size: 14px;
    padding: 10px 24px;
}
.tubelight-nav-cta:hover { transform: scale(1.05); box-shadow: 0 4px 20px rgba(34,178,133,0.4); }

/* ---- Hamburger Button (mobile only) ---- */
.tubelight-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 51;
}
.tubelight-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: rgba(255,255,255,0.8);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
.tubelight-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.tubelight-hamburger.open span:nth-child(2) { opacity: 0; }
.tubelight-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Mobile Slide-Down Menu ---- */
.tubelight-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 49;
    background: rgba(10, 10, 15, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 80px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.3s ease;
    pointer-events: none;
}
.tubelight-mobile-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.tubelight-mobile-menu-link {
    display: block;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 12px;
    transition: color 0.2s, background 0.2s;
    min-height: 44px;
}
.tubelight-mobile-menu-link:hover,
.tubelight-mobile-menu-link.active {
    color: white;
    background: rgba(255,255,255,0.05);
}

/* ---- Focus Visible ---- */
.tubelight-link:focus-visible,
.tubelight-mobile-menu-link:focus-visible,
.tubelight-nav-cta:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---- Mobile Breakpoint ---- */
@media (max-width: 768px) {
    .tubelight-nav-inner .tubelight-pill,
    .tubelight-nav-inner .tubelight-nav-cta-desktop { display: none; }
    .tubelight-hamburger { display: flex; }
    .tubelight-nav,
    .tubelight-nav.subpage {
        background: rgba(10, 10, 15, 0.9);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 10px 0;
    }
    .tubelight-nav-inner { justify-content: space-between; padding: 0 20px; }
    .tubelight-logo,
    .tubelight-nav.subpage .tubelight-logo {
        opacity: 1;
        width: auto;
        pointer-events: auto;
        transform: none;
        margin-right: 0;
    }
}
