:root {
    --primary-font: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ═══════════════════════════════════════════
   PERFORMANCE HELPERS (dùng chung toàn site)
═══════════════════════════════════════════ */
/* Section nào nằm ngoài viewport (JS gắn .is-offscreen) thì tạm dừng mọi
   animation bên trong — máy yếu không phải render 26 animation vô hạn cùng lúc */
.is-offscreen,
.is-offscreen *,
.is-offscreen *::before,
.is-offscreen *::after {
    animation-play-state: paused !important;
}

/* Các section dài phía dưới: trình duyệt bỏ qua layout/paint khi chưa cuộn tới */
.qh-cv {
    content-visibility: auto;
    contain-intrinsic-size: auto 900px;
}

/* Global reset — without this the browser's default 8px body margin
   shows as a white frame around the page and pushes full-width
   sections beyond the viewport on mobile */
html, body {
    margin: 0;
    padding: 0;
    background: #000;
}

/* Sections scope their own box-sizing reset except these: */
#coop-wp-root, #coop-wp-root *,
#site-footer, #site-footer * {
    box-sizing: border-box;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--primary-font) !important;
}

/* ═══════════════════════════════════════════
   LANGUAGE SWITCHER (Blue Theme)
═══════════════════════════════════════════ */
.lang-switcher {
    position: fixed !important;
    top: 24px !important;
    right: 28px !important;
    z-index: 10000000 !important;
    display: flex !important;
    align-items: center !important;
    background: rgba(7, 19, 29, .92) !important;
    border: 1px solid rgba(0, 242, 255, .2) !important;
    border-radius: 100px !important;
    padding: 4px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .5), 0 0 0 1px rgba(0, 242, 255, .08) !important;
    font-family: 'Be Vietnam Pro', sans-serif !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    /* Visibility state */
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-10px) !important;
    transition: opacity 0.6s ease, transform 0.6s ease !important;
}

.lang-switcher.is-visible {
    opacity: 1 !important;
    pointer-events: all !important;
    transform: translateY(0) !important;
}

.lang-btn {
    position: relative !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: .12em !important;
    padding: 7px 18px !important;
    border-radius: 100px !important;
    border: none !important;
    background: transparent !important;
    color: rgba(200, 245, 255, .4) !important;
    cursor: pointer !important;
    transition: color .35s ease !important;
    z-index: 1 !important;
    white-space: nowrap !important;
    outline: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    min-width: 0 !important;
    line-height: 1 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.lang-btn.active {
    color: #000 !important;
}

.lang-pill {
    position: absolute !important;
    top: 4px !important;
    left: 4px !important;
    height: calc(100% - 8px) !important;
    border-radius: 100px !important;
    background: #00f2ff !important;
    box-shadow: 0 0 14px rgba(0, 242, 255, .6) !important;
    pointer-events: none !important;
    transition: transform .4s cubic-bezier(.34, 1.56, .64, 1),
        width .4s cubic-bezier(.34, 1.56, .64, 1) !important;
}

/* ─── LANG TRANSITION OVERLAY ───────────── */
.lang-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-overlay-stage {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

.lang-overlay-circle,
.lang-overlay-glow1,
.lang-overlay-glow2 {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    transform: scale(0);
    transform-origin: center center;
}

.lang-overlay-circle {
    background: radial-gradient(circle at center, #041b2d 0%, #000 100%);
    border: 1px solid rgba(0, 242, 255, 0.1);
    will-change: transform;
}

.lang-overlay-glow1 {
    background: linear-gradient(to right, transparent, rgba(0, 242, 255, 0.4), transparent);
    box-shadow: 0 0 50px rgba(0, 242, 255, 0.2);
    will-change: transform, opacity;
    opacity: 0.6;
}

.lang-overlay.animating .lang-overlay-glow1 {
    animation: aiScanBlue 3s linear infinite;
}

@keyframes aiScanBlue {
    0% {
        transform: translateY(-100%) scale(1.2) rotate(0deg);
    }

    100% {
        transform: translateY(100%) scale(1.2) rotate(5deg);
    }
}

.lang-overlay-glow2 {
    background: radial-gradient(circle,
            rgba(0, 242, 255, 0) 50%,
            rgba(0, 242, 255, .15) 65%,
            rgba(0, 162, 255, .08) 75%,
            rgba(0, 242, 255, .04) 86%,
            transparent 100%);
    will-change: transform;
    animation: aiRotateBlue 10s linear infinite;
}

@keyframes aiRotateBlue {
    from {
        rotate: 0deg;
    }

    to {
        rotate: 360deg;
    }
}

.lang-overlay-text {
    position: relative;
    z-index: 2;
    font-size: clamp(40px, 10vw, 110px);
    font-weight: 900;
    letter-spacing: -.04em;
    color: #00f2ff;
    text-shadow: 0 0 40px rgba(0, 242, 255, 0.5), 0 0 80px rgba(0, 162, 255, 0.2);
    opacity: 0;
    transform: scale(.82);
    pointer-events: none;
    user-select: none;
    transition: opacity .22s, transform .32s cubic-bezier(.34, 1.56, .64, 1);
    font-family: var(--primary-font);
}

.lang-overlay-text.visible {
    opacity: 1;
    transform: scale(1);
}

.lang-overlay-text span {
    display: block;
    text-align: center;
    line-height: 1;
}

.lang-overlay-text .sub {
    font-size: .27em;
    font-weight: 500;
    letter-spacing: .28em;
    opacity: .55;
    margin-top: 10px;
}

/* ═══════════════════════════════════════════
   SIDE MENU — đối xứng với language switcher (trái ↔ phải)
   Hover (desktop) hoặc chạm/click (mobile) để mở bảng liên kết.
═══════════════════════════════════════════ */
.side-menu {
    position: fixed;
    top: 24px;
    left: 28px;
    z-index: 10000000;
    font-family: 'Be Vietnam Pro', sans-serif;
    /* Cùng trạng thái hiện/ẩn với .lang-switcher */
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.side-menu.is-visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.side-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 34px;
    padding: 0;
    margin: 0;
    border-radius: 100px;
    background: rgba(7, 19, 29, .92);
    border: 1px solid rgba(0, 242, 255, .2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .5), 0 0 0 1px rgba(0, 242, 255, .08);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    transition: border-color .3s ease, background .3s ease;
}

.side-menu-bars {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 16px;
}

.side-menu-bars i {
    display: block;
    height: 1.5px;
    border-radius: 2px;
    background: rgba(200, 245, 255, .75);
    transition: background .3s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1), width .35s ease;
}

.side-menu-bars i:nth-child(1) { width: 16px; }
.side-menu-bars i:nth-child(2) { width: 11px; }
.side-menu-bars i:nth-child(3) { width: 14px; }

.side-menu-btn:hover,
.side-menu-btn:focus-visible {
    border-color: rgba(0, 242, 255, .5);
    background: rgba(7, 19, 29, 1);
}

.side-menu-btn:hover .side-menu-bars i,
.side-menu.is-open .side-menu-bars i {
    background: #00f2ff;
    width: 16px;
}

/* Bảng liên kết */
.side-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 208px;
    padding: 8px;
    border-radius: 16px;
    background: #060f18;   /* đục hoàn toàn — chữ phía sau không lộ qua panel */
    border: 1px solid rgba(0, 242, 255, .18);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .6), 0 0 0 1px rgba(0, 242, 255, .06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(.97);
    transform-origin: 18px top;
    transition: opacity .28s ease, transform .28s cubic-bezier(.22, 1, .36, 1), visibility .28s;
}

/* Vùng đệm vô hình để chuột đi từ nút xuống bảng không bị mất hover */
.side-menu-panel::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

.side-menu.is-open .side-menu-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.side-menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    color: rgba(255, 255, 255, .72);
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: .01em;
    text-decoration: none;
    transition: color .22s ease, background .22s ease;
}

.side-menu-link svg { flex: none; opacity: .7; transition: opacity .22s ease; }

.side-menu-link:hover,
.side-menu-link:focus-visible {
    color: #fff;
    background: rgba(0, 242, 255, .08);
    outline: none;
}

.side-menu-link:hover svg { opacity: 1; }

.side-menu-sep {
    height: 1px;
    margin: 7px 12px;
    background: rgba(255, 255, 255, .09);
}

/* Hàng icon mạng xã hội — phẳng, tinh tế */
.side-menu-socials {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px 4px;
}

.side-menu-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 32px;
    border-radius: 9px;
    color: rgba(255, 255, 255, .5);
    text-decoration: none;
    transition: color .22s ease, background .22s ease;
}

.side-menu-socials a:hover,
.side-menu-socials a:focus-visible {
    color: #00f2ff;
    background: rgba(0, 242, 255, .08);
    outline: none;
}

@media (max-width: 600px) {
    .side-menu { top: 20px; left: 16px; }
    .side-menu-panel { min-width: 196px; }
}

@media (prefers-reduced-motion: reduce) {
    .side-menu,
    .side-menu-panel,
    .side-menu-bars i { transition-duration: .01ms !important; }
}
