/* ============================================
   CRAZYLIVE - Shared Components
   ============================================ */

/* ------------------------------------------
   Top Header
   ------------------------------------------ */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    transition: all 0.3s ease;
}

/* ------------------------------------------
   Navigation
   ------------------------------------------ */
html {
    scroll-padding-top: 6rem;
}

.main-nav {
    position: fixed;
    top: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1380px;
    z-index: 50;
    transition: all 0.3s ease;
}

body.nav-drawer-open {
    overflow: hidden;
    touch-action: none;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    line-height: 0.95;
    flex-shrink: 0;
}

.site-brand-wordmark {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    color: #0f172a;
    line-height: 0.9;
    white-space: nowrap;
}

.site-brand-cn {
    color: var(--brand-green);
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
}

.site-brand-wordmark-footer {
    color: #e2e8f0;
    font-size: 1.45rem;
    line-height: 0.9;
}

.site-logo-img {
    display: block;
    width: 40px;
    height: 40px;
    min-width: 40px;
    max-width: 40px;
    min-height: 40px;
    max-height: 40px;
    flex: 0 0 40px;
    object-fit: contain;
}

.site-logo-img-footer {
    width: 72px;
    height: 72px;
    min-width: 72px;
    max-width: 72px;
    min-height: 72px;
    max-height: 72px;
    flex: 0 0 72px;
}

@media (min-width: 768px) {
    .main-nav {
        top: 2.5rem;
    }

    .site-brand-wordmark {
        font-size: 1.38rem;
    }

    .site-brand-cn {
        font-size: 1.08rem;
    }

    .site-brand-wordmark-footer {
        font-size: 1.65rem;
    }

    .site-logo-img {
        width: 48px;
        height: 48px;
        min-width: 48px;
        max-width: 48px;
        min-height: 48px;
        max-height: 48px;
        flex-basis: 48px;
    }

    .site-logo-img-footer {
        width: 84px;
        height: 84px;
        min-width: 84px;
        max-width: 84px;
        min-height: 84px;
        max-height: 84px;
        flex-basis: 84px;
    }
}

@media (max-width: 420px) {
    .site-brand {
        gap: 0.45rem;
    }

    .site-brand-wordmark {
        font-size: 1rem;
        letter-spacing: 0.015em;
    }

    .site-brand-cn {
        font-size: 0.78rem;
    }

    .site-brand-wordmark-footer {
        font-size: 1.15rem;
    }
}

.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(15, 23, 42, 0.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 80;
    width: min(22rem, 86vw);
    height: 100vh;
    height: 100dvh;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.94);
    border-left: 1px solid rgba(226, 232, 240, 0.88);
    box-shadow: -28px 0 60px rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    transform: translateX(105%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    outline: none;
}

body.nav-drawer-open .mobile-nav-overlay {
    opacity: 1;
    pointer-events: auto;
}

body.nav-drawer-open .mobile-nav-drawer {
    transform: translateX(0);
}

.mobile-nav-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.78);
}

.mobile-nav-close {
    display: inline-flex;
    width: 2.6rem;
    height: 2.6rem;
    flex: 0 0 2.6rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #0f172a;
    background: rgba(241, 245, 249, 0.92);
    transition: background 0.2s ease, transform 0.2s ease;
}

.mobile-nav-close:hover {
    background: rgba(226, 232, 240, 0.96);
    transform: translateY(-1px);
}

.mobile-nav-drawer-body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding-top: 1rem;
    overflow-y: auto;
}

.mobile-nav-drawer-body a,
.mobile-nav-drawer-body button:not(.locale-switch-btn) {
    display: flex;
    width: 100%;
    align-items: center;
    min-height: 3rem;
    border-radius: 1rem;
    padding: 0.72rem 0.9rem;
    text-align: left;
    color: #334155;
    background: transparent;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.mobile-nav-drawer-body a:hover,
.mobile-nav-drawer-body button:not(.locale-switch-btn):hover {
    color: #047857;
    background: rgba(0, 209, 102, 0.1);
    transform: translateX(-2px);
}

/* ------------------------------------------
   Floating Contact Drawer
   ------------------------------------------ */
.floating-contact {
    position: fixed;
    right: 0;
    top: 50%;
    z-index: 75;
    display: flex;
    align-items: center;
    transform: translate(calc(100% - 3rem), -50%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.floating-contact.is-open,
.floating-contact:focus-within {
    transform: translate(0, -50%);
}

.floating-contact-toggle {
    width: 3rem;
    min-height: 8.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px 0 0 12px;
    background: #00d166;
    color: #fff;
    font-weight: 900;
    letter-spacing: 0.08em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    cursor: pointer;
    box-shadow: 0 18px 36px rgba(0, 148, 72, 0.26);
    appearance: none;
    border: 0;
}

.floating-contact-panel {
    width: min(18rem, calc(100vw - 4rem));
    padding: 1rem;
    border: 1px solid rgba(187, 247, 208, 0.95);
    border-right: 0;
    border-radius: 16px 0 0 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 22px 54px rgba(15, 23, 42, 0.18);
}

.floating-contact-image {
    display: block;
    width: 100%;
    border-radius: 10px;
    background: #fff;
}

@media (max-width: 767px) {
    html {
        scroll-padding-top: 5.75rem;
    }

    .main-nav {
        top: 1rem;
        width: calc(100% - 1.25rem);
        padding-left: 1.15rem !important;
        padding-right: 1.15rem !important;
        z-index: 60;
    }

    .floating-contact {
        top: auto;
        bottom: 5.25rem;
        transform: translateX(calc(100% - 2.75rem));
    }

    .floating-contact.is-open,
    .floating-contact:focus-within {
        transform: translateX(0);
    }

    .floating-contact-toggle {
        width: 2.75rem;
        min-height: 7.5rem;
        font-size: 0.9rem;
    }

    .floating-contact-panel {
        width: min(16.5rem, calc(100vw - 3.25rem));
        padding: 0.8rem;
    }
}

.nav-link {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--brand-green);
}

.nav-link.active {
    color: #0f172a;
}

/* ------------------------------------------
   Footer
   ------------------------------------------ */
.footer {
    background: #0A0F1E;
    color: white;
    border-radius: 3rem 3rem 0 0;
    padding-top: 5rem;
    padding-bottom: 2.5rem;
}

.footer-link {
    color: #94a3b8;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--brand-green);
}

.social-icon-img {
    width: 16px;
    height: 16px;
    display: block;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(100%);
}

/* ------------------------------------------
   Cards
   ------------------------------------------ */
.card-glass {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(25px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 2rem;
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.card-glass:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.65);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .card-glass {
        padding: 2rem;
        border-radius: 2.5rem;
    }
}

/* ------------------------------------------
   Section Headers
   ------------------------------------------ */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .section-header {
        margin-bottom: 4rem;
    }
}

.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--brand-green);
    margin-bottom: 0.75rem;
    display: block;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: #0f172a;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 3rem;
    }
}

.section-desc {
    font-size: 1.125rem;
    color: #64748b;
    margin-top: 1rem;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}

/* ------------------------------------------
   Breadcrumbs
   ------------------------------------------ */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1.5rem;
}

.breadcrumbs a {
    color: #64748b;
    transition: color 0.2s ease;
}

.breadcrumbs a:hover {
    color: var(--brand-green);
}

.breadcrumbs .current {
    color: #0f172a;
    font-weight: 500;
}

/* ------------------------------------------
   Page Hero (Inner Pages)
   ------------------------------------------ */
.page-hero {
    padding-top: 10rem;
    padding-bottom: 5rem;
    text-align: center;
}

@media (max-width: 767px) {
    .page-hero {
        padding-top: 8rem;
        padding-bottom: 4rem;
    }
}

@media (min-width: 768px) {
    .page-hero {
        padding-top: 12rem;
        padding-bottom: 6rem;
    }
}

/* ============================================
   Page Header Background - Overlay Design
   ============================================ */

/* Page Hero with Background Image as overlay on aurora */
main > section.page-hero-bg,
section.page-hero-bg,
.page-hero.page-hero-bg {
    position: relative !important;
    padding-bottom: 12rem !important;
    margin-bottom: -6rem !important;
    z-index: 1 !important;
}

/* Background image layer - floating above aurora */
main > section.page-hero-bg::before,
section.page-hero-bg::before,
.page-hero.page-hero-bg::before {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    background-image: url('../img/slider/bg.png') !important;
    background-size: cover !important;
    background-position: center bottom !important;
    background-repeat: no-repeat !important;
    z-index: 0 !important;
    opacity: 0.9 !important;
}

/* Ensure content is above background layers */
.page-hero-bg .container-custom,
.page-hero-bg .breadcrumbs,
.page-hero-bg h1,
.page-hero-bg p,
.page-hero-bg > div,
.page-hero-bg > * {
    position: relative !important;
    z-index: 1 !important;
}

/* Ticker anchor with background (for homepage) */
main > section.ticker-anchor-bg,
section.ticker-anchor-bg,
.ticker-anchor.ticker-anchor-bg,
body > main > section.ticker-anchor.ticker-anchor-bg {
    position: relative !important;
    padding-bottom: 12rem !important;
    margin-bottom: -6rem !important;
    z-index: 1 !important;
}

/* Background image layer - floating above aurora */
body > main > section.ticker-anchor.ticker-anchor-bg::before,
main > section.ticker-anchor-bg::before,
section.ticker-anchor-bg::before,
.ticker-anchor.ticker-anchor-bg::before {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    background-image: url('../img/slider/bg.png') !important;
    background-size: cover !important;
    background-position: center bottom !important;
    background-repeat: no-repeat !important;
    z-index: 0 !important;
    opacity: 0.9 !important;
}

/* Ensure content is above background layers */
.ticker-anchor-bg .demo-shell,
.ticker-anchor-bg > *,
.ticker-anchor-bg .strip-card,
.ticker-anchor-bg #marketTickerMeta {
    position: relative !important;
    z-index: 1 !important;
}

/* ------------------------------------------
   Feature Grid
   ------------------------------------------ */
.feature-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ------------------------------------------
   Mentor Card
   ------------------------------------------ */
.mentor-card {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 2rem;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.mentor-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.65);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

.mentor-avatar {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 1.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.mentor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ------------------------------------------
   Live Badge
   ------------------------------------------ */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.live-badge::before {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    background: white;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

/* ------------------------------------------
   View Counter
   ------------------------------------------ */
.view-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* ------------------------------------------
   Animations
   ------------------------------------------ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* ------------------------------------------
   Utility Classes
   ------------------------------------------ */
.container-custom {
    max-width: 1380px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 768px) {
    .container-custom {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container-custom {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

.text-gradient {
    background: linear-gradient(to bottom right, #0f172a, #475569, #64748b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
