/* =======================================================
   1. LOGO & NUT HAMBURGER
   ======================================================= */
.header-logo {
    position: fixed;
    top: 5vh;
    left: calc(4vw + 40px + 16px);
    /* Canh vi tri theo nut hamburger */
    height: 40px;
    z-index: 10001;
    /* Luon noi len tren cung */
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-logo-img {
    width: 32px;
    height: auto;
    object-fit: contain;
    display: block;
}

.header-logo-text {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Nut mo menu (3 gach) */
.header-menu-btn {
    position: fixed;
    top: 5vh;
    left: 4vw;
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    z-index: 1000;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.hamburger-line {
    height: 2px;
    background: #fff;
    display: block;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Chinh do dai ngan khac nhau cho dep */
.hamburger-line:nth-child(1),
.hamburger-line:nth-child(3) {
    width: 28px;
}

.hamburger-line:nth-child(2) {
    width: 20px;
}

.header-menu-btn:hover .hamburger-line:nth-child(2) {
    width: 28px;
}

/* =======================================================
   2. LOP PHU MENU (OVERLAY)
   ======================================================= */
.menu-overlay {
    position: fixed;
    inset: 0;
    /* Phu kin man hinh */
    z-index: 9999;
    background-color: rgba(5, 5, 5, 0.4);
    /* Mau den mo */
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    /* Lam mo nen sau lung */
    opacity: 0;
    visibility: hidden;
    /* Mac dinh an */
}

.menu-overlay-inner {
    height: 100%;
    width: 100%;
    display: grid;
    grid-template-columns: 0.5fr 0.5fr;
    /* Chia doi man hinh trai phai */
    gap: 10vw;
    padding-left: 8vw;
    padding-right: 8vw;
    align-items: center;
    box-sizing: border-box;
}

/* =======================================================
   3. COT TRAI (NAVIGATION LINKS)
   ======================================================= */
.menu-left {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6vh;
}

.menu-left-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    text-decoration: none;
}

.menu-left-chapter {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #fff;
    opacity: 0.6;
    letter-spacing: 2px;
    display: block;
}

/* Chu Tieu De Menu Lon */
.menu-left-title {
    font-size: 3.5rem;
    text-transform: uppercase;
    font-weight: 400;
    line-height: 1.1;
    color: #fff;
    display: block;
    transition: transform 0.3s ease, color 0.3s ease;
}

/* Hieu ung hover day chu sang phai */
.menu-left-item:hover .menu-left-title {
    transform: translateX(20px);
    color: #4ade80;
}

/* =======================================================
   4. COT PHAI (BUTTONS & SOCIALS)
   ======================================================= */
.menu-right {
    display: flex;
    flex-direction: column;
    gap: 22px;
    justify-content: center;
    align-items: flex-start;
}

/* Cac nut bam chu nhat */
.menu-action-btn {
    width: 70%;
    padding: 16px 0;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 1px;
    color: #fff;
    text-decoration: none;
    text-align: center;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.menu-action-btn:hover {
    background: transparent;
    border-color: #fff;
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    /* Phat sang nhe */
}

/* Icon Mang xa hoi (FB, YT, TikTok) */
.menu-socials {
    display: flex;
    gap: 24px;
    margin-top: 5px;
    width: 70%;
    justify-content: center;
    padding: 0;
}

.social-link {
    display: block;
    width: 24px;
    height: 24px;
    opacity: 0;
    transform: translateY(20px);
    /* An di de cho GSAP */
    transition: all 0.3s ease;
}

.social-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: brightness(0) invert(1);
    opacity: 0.6;
    /* Chuyen icon thanh mau trang */
    transition: all 0.3s ease;
}

.social-link:hover {
    transform: translateY(-3px) scale(1.1);
}

.social-link:hover img {
    opacity: 1;
    filter: brightness(0) invert(1) drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

/* =======================================================
   5. CAC NUT DIEU KHIEN (CLOSE & LANG)
   ======================================================= */
/* Nut Dong (Hinh tron chu X) */
.menu-close-btn {
    position: absolute;
    top: 5vh;
    right: 3vw;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    transition: background 0.3s ease, border-color 0.3s ease;
    opacity: 0;
    transform: scale(0.9);
}

.close-icon-line {
    position: absolute;
    width: 18px;
    height: 2px;
    background: #fff;
    display: block;
}

.close-icon-line:nth-child(1) {
    transform: rotate(45deg);
}

.close-icon-line:nth-child(2) {
    transform: rotate(-45deg);
}

/* Animation bong bong nay */
@keyframes bubbleBounce {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

.menu-close-btn:hover {
    animation: bubbleBounce 0.8s cubic-bezier(0.3, 0, 0.7, 1) forwards;
}

/* Nut Doi Ngon Ngu (Gat sang trai/phai) */
.lang-wrapper {
    position: absolute;
    top: 5vh;
    right: calc(3vw + 60px);
    height: 48px;
    display: flex;
    align-items: center;
    z-index: 20000 !important;
    cursor: pointer;
    pointer-events: auto;
    background-color: transparent;
    opacity: 0;
    transform: translateY(-10px);
}

/* Khung ranh truot */
.lang-toggle-track {
    position: relative;
    width: 52px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Vien bi tron */
.lang-toggle-circle {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
    transition: transform 0.3s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

.lang-text {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    user-select: none;
    transition: opacity 0.3s ease;
}

.text-en {
    right: 8px;
    opacity: 1;
}

.text-vn {
    left: 8px;
    opacity: 0;
}

.lang-wrapper:hover .lang-toggle-track {
    border-color: #fff;
}

/* TRANG THAI TIENG VIET (Bi gat sang phai) */
.lang-wrapper.vn-mode .lang-toggle-circle {
    transform: translateX(22px);
}

.lang-wrapper.vn-mode .text-vn {
    opacity: 1;
}

.lang-wrapper.vn-mode .text-en {
    opacity: 0;
}

/* =======================================================
   6. GIAO DIEN MOBILE (Header)
   ======================================================= */
@media (max-width: 768px) {
    .menu-overlay-inner {
        grid-template-columns: 1fr;
        padding-top: 15vh;
        gap: 5vh;
    }

    /* 1 Cot */
    .menu-left-title {
        font-size: 3rem;
    }

    .menu-right {
        align-items: stretch;
    }

    .menu-action-btn {
        width: 100%;
        text-align: center;
    }

    /* Nut rong 100% */
    .menu-socials {
        width: 100%;
    }

    .header-logo {
        left: 20px;
    }
}