/* ========== CSS Variables / Design Tokens (Premium B&W Edition) ========== */
:root {
    /* Light Theme (Premium Default) */
    --header-bg-top: transparent;
    --header-bg-scrolled: rgba(255, 255, 255, 0.85);
    --header-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
    --header-border: transparent;
    --header-border-scrolled: rgba(0, 0, 0, 0.08);

    --text-color: #111111;
    --text-muted: #666666;
    --menu-hover-bg: rgba(0, 0, 0, 0.05);
    /* Soft pill */
    --menu-hover-text: #000000;

    --toggle-bg: rgba(0, 0, 0, 0.04);
    --toggle-hover: rgba(0, 0, 0, 0.08);

    --body-bg: #fafafa;
    
    /* Missing Tokens for Cards and Inputs */
    --primary-color: #4f46e5;
    --glass-bg: #ffffff;
    --glass-border: #f1f5f9;
    --input-bg: #f8fafc;
    --input-border: #e2e8f0;

    /* Mobile Menu */
    --mobile-menu-bg: rgba(255, 255, 255, 0.98);
    --hamburger-color: #111111;

    /* Modal */
    --modal-bg: rgba(255, 255, 255, 0.85);
    --modal-border: rgba(255, 255, 255, 0.5);

    /* Effects */
    --logo-glow: rgba(0, 0, 0, 0.1);
    --transition-speed: 0.4s;
}

[data-theme="dark"] {
    /* Dark Theme (Premium) */
    --header-bg-top: transparent;
    --header-bg-scrolled: rgba(10, 10, 10, 0.85);
    --header-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    --header-border: transparent;
    --header-border-scrolled: rgba(255, 255, 255, 0.08);

    --text-color: #f5f5f5;
    --text-muted: #999999;
    --menu-hover-bg: rgba(255, 255, 255, 0.08);
    /* Soft pill */
    --menu-hover-text: #ffffff;

    --toggle-bg: rgba(255, 255, 255, 0.06);
    --toggle-hover: rgba(255, 255, 255, 0.12);

    --body-bg: #050505;

    /* Missing Tokens for Cards and Inputs Dark Mode */
    --primary-color: #818cf8;
    --glass-bg: #111111;
    --glass-border: #222222;
    --input-bg: #0a0a0a;
    --input-border: #333333;

    --mobile-menu-bg: rgba(15, 15, 15, 0.98);
    --hamburger-color: #f5f5f5;

    /* Modal Dark */
    --modal-bg: rgba(15, 15, 15, 0.85);
    --modal-border: rgba(255, 255, 255, 0.1);

    --logo-glow: rgba(255, 255, 255, 0.15);
}

/* ========== Reset & Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-color);
}

    /* ========== Header (Glassmorphism Bóng Bóng + Viền gradient chạy) ========== */
    .vudev-header {
        position: fixed;
        top: 24px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 48px);
        max-width: 1280px;
        z-index: 1000;

        /* Background kính chính bên trong */
        background: var(--header-bg-top);
        backdrop-filter: blur(20px) saturate(150%);
        -webkit-backdrop-filter: blur(20px) saturate(150%);

        /* Hiệu ứng bóng bóng (Glossy Bubble) */
        box-shadow:
            inset 0 2px 10px rgba(255, 255, 255, 0.4),
            inset 0 -2px 10px rgba(0, 0, 0, 0.05),
            0 10px 40px rgba(0, 0, 0, 0.08);
        border-radius: 20px; /* Bo tròn vừa khít hiện đại */
        transition: all var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* Khi có bg từ theme tối / sáng */
    [data-theme="dark"] .vudev-header {
        box-shadow:
            inset 0 2px 10px rgba(255, 255, 255, 0.05),
            0 10px 40px rgba(0, 0, 0, 0.5);
    }

    .vudev-header.scrolled {
        top: 16px;
        background: var(--header-bg-scrolled);
        backdrop-filter: blur(30px) saturate(200%);
        -webkit-backdrop-filter: blur(30px) saturate(200%);
    }

    /* Khối Animated Border được Mask để loại bỏ ruột */
    .animated-border {
        position: absolute;
        inset: 0;
        border-radius: 20px; /* Bo đồng bộ Header */
        padding: 1.5px;
        /* Độ dày của viền */
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        pointer-events: none;
        z-index: -1;
        overflow: hidden;
        /* Quan trọng để cắt gọn góc tròn */
    }

    /* Khối gradient khổng lồ xoay bên dưới mask */
    .animated-border::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        /* Khối hình vuông cực lớn để xoay thành vòng tròn hoàn hảo không bị vát góc */
        width: 4000px;
        height: 4000px;
        background: conic-gradient(from 0deg, transparent 70%, #0ea5e9, #ec4899, #f59e0b, #10b981);
        transform-origin: center;
        transform: translate(-50%, -50%) rotate(0deg);
        animation: rotateBorder 4s linear infinite;
    }

    @keyframes rotateBorder {
        to {
            transform: translate(-50%, -50%) rotate(360deg);
        }
    }

    .header-container {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 40px;
        height: 68px;
    }

    /* ========== Logo ========== */
    .vudev-logo {
        display: flex;
        align-items: center;
        text-decoration: none;
        position: relative;
        z-index: 1001;
    }

    .vudev-logo .logo-text {
        font-size: 28px;
        font-weight: 800;
        letter-spacing: -0.5px;
        background: linear-gradient(to right, #0ea5e9, #ec4899, #f59e0b, #10b981, #0ea5e9);
        background-size: 200% 100%;
        background-position: 0% 50%;
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
        animation: logoColorShift 3s linear infinite;
        transition: transform 0.3s ease, filter 0.3s ease;
    }

    .vudev-logo:hover .logo-text {
        transform: scale(1.02);
        filter: drop-shadow(0 0 10px var(--logo-glow));
    }

    @keyframes logoColorShift {
        0% { background-position: 0% 50%; }
        100% { background-position: 200% 50%; }
    }

    /* ========== Navigation Area (Right) ========== */
    .header-right {
        display: flex;
        align-items: center;
        gap: 8px; /* Giảm gap để sát nhau hơn */
    }

    .nav-menu {
        display: flex;
        align-items: center;
        list-style: none;
        gap: 0; /* Bỏ gap nhỏ để không chừa khoảng trống */
        position: relative;
    }

    /* Sliding Background Highlight (Premium Effect) */
    .nav-highlight {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        background: rgba(14, 165, 233, 0.08);
        border-radius: 12px;
        z-index: 0;
        opacity: 0;
        pointer-events: none;
        transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
            width 0.4s cubic-bezier(0.25, 1, 0.5, 1),
            opacity 0.3s ease;
        box-shadow: 0 4px 15px rgba(14, 165, 233, 0.15);
    }

    .nav-link {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 16px;
        font-size: 14.5px;
        font-weight: 500;
        color: var(--text-color);
        text-decoration: none;
        border-radius: 12px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        z-index: 1;
        /* Đè lên trên Highlight Background */
    }

    .nav-link::after {
        content: '';
        position: absolute;
        bottom: 2px;
        left: 50%;
        transform: translateX(-50%) scaleX(0);
        width: 0;
        height: 2.5px;
        background: linear-gradient(90deg, #0ea5e9, #ec4899);
        border-radius: 2px;
        transition: transform 0.3s ease, width 0.3s ease;
        opacity: 0;
    }

    .nav-icon {
        width: 16px;
        height: 16px;
        opacity: 0.6;
        transition: all 0.3s ease;
    }

    .nav-link:hover,
    .nav-link.active {
        color: #0ea5e9;
        text-shadow: 0 0 8px rgba(14, 165, 233, 0.3);
    }

    .nav-link:hover::after,
    .nav-link.active::after {
        transform: translateX(-50%) scaleX(1);
        width: 60%;
        opacity: 1;
    }

    /* ========== User Avatar Header ========== */
    .avatar-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        overflow: hidden;
        border: 2px solid transparent;
        transition: all 0.3s ease;
        background: linear-gradient(135deg, #0ea5e9, #ec4899);
        padding: 2px;
    }

    .user-avatar {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        object-fit: cover;
        background-color: #fff;
    }

    .nav-avatar-btn {
        padding: 6px 12px 6px 6px; /* Cách padding để ôm trọn hình tròn avatar và mũi tên */
    }

    .nav-avatar-btn:hover .avatar-wrapper,
    .nav-avatar-btn.active .avatar-wrapper {
        box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
        transform: scale(1.05);
    }

    .nav-link:hover .nav-icon,
    .nav-link.active .nav-icon {
        opacity: 1;
        transform: scale(1.1);
        stroke: #ec4899;
    }

    /* ========== Avatar Outer (Ngoài cùng bên phải Header) ========== */
    .header-avatar-outer {
        position: relative;
        margin-left: 4px;
    }
    .header-avatar-outer .nav-avatar-btn {
        padding: 4px 8px 4px 4px;
    }
    .header-avatar-outer .avatar-wrapper {
        width: 34px;
        height: 34px;
    }

    /* ========== Tools (Theme, Lang) Premium Hover ========== */
    .header-tools {
        display: flex;
        align-items: center;
        gap: 12px;
        border-left: none;
        padding-left: 8px;
        position: relative;
        z-index: 10;
    }

    .tool-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border: 1px solid var(--header-border-scrolled);
        border-radius: 50%;
        background: var(--toggle-bg);
        color: var(--text-color);
        cursor: pointer;
        backdrop-filter: blur(10px);
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        position: relative;
        overflow: hidden;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
    }

    /* Ánh sáng tỏa ra từ bên trong khi hover */
    .tool-btn::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 50%;
        background: radial-gradient(circle at center, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
        opacity: 0;
        transform: scale(0.5);
        transition: all 0.4s ease;
    }

    .tool-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
        border-color: rgba(14, 165, 233, 0.3);
    }

    .tool-btn:hover::before {
        opacity: 1;
        transform: scale(1.5);
    }

    .tool-btn:active {
        transform: translateY(1px) scale(0.95);
    }

    /* Theme SVG Icons Hào Quang */
    .theme-toggle svg {
        width: 18px;
        height: 18px;
        position: absolute;
        transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        z-index: 1;
    }

    .theme-toggle:hover .icon-sun {
        filter: drop-shadow(0 0 6px #f59e0b);
        color: #f59e0b;
        /* Mặt trời phát sáng vàng cam */
    }

    .theme-toggle:hover .icon-moon {
        filter: drop-shadow(0 0 6px #0ea5e9);
        color: #0ea5e9;
        /* Mặt trăng phát sáng xanh */
    }

    .theme-toggle .icon-sun {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }

    .theme-toggle .icon-moon {
        opacity: 0;
        transform: rotate(-90deg) scale(0.5);
    }

    [data-theme="dark"] .theme-toggle .icon-sun {
        opacity: 0;
        transform: rotate(90deg) scale(0.5);
    }

    [data-theme="dark"] .theme-toggle .icon-moon {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }

    /* Language Toggle Gradient Hover */
    .lang-toggle {
        font-size: 16px;
        font-weight: 800;
        letter-spacing: 0.5px;
    }

    .lang-toggle .lang-text {
        z-index: 1;
        position: relative;
        transition: all 0.3s ease;
    }

    .lang-toggle:hover .lang-text {
        background: linear-gradient(135deg, #0ea5e9, #ec4899);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        filter: drop-shadow(0 0 4px rgba(236, 72, 153, 0.4));
    }

    /* ========== Mobile Bottom Navigation ========== */
    .mobile-bottom-nav {
        display: none;
        position: fixed;
        bottom: 16px;
        left: 16px;
        width: calc(100% - 32px);
        height: 64px;
        background: var(--header-bg-top);
        backdrop-filter: blur(20px) saturate(150%);
        -webkit-backdrop-filter: blur(20px) saturate(150%);
        z-index: 1000;
        box-shadow:
            inset 0 2px 10px rgba(255, 255, 255, 0.4),
            inset 0 -2px 10px rgba(0, 0, 0, 0.05),
            0 10px 40px rgba(0, 0, 0, 0.08);
        border-radius: 20px;
        padding: 0;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
    }

    [data-theme="dark"] .mobile-bottom-nav {
        box-shadow:
            inset 0 2px 10px rgba(255, 255, 255, 0.05),
            0 10px 40px rgba(0, 0, 0, 0.5);
    }

    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100%;
        color: var(--text-color);
        opacity: 0.5;
        text-decoration: none;
        position: relative;
        transition: all 0.3s ease;
        min-width: 0; /* cho phép shrink */
    }

    .bottom-nav-item span {
        font-size: 9px;
        margin-top: 3px;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .bottom-nav-item svg {
        width: 20px;
        height: 20px;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.3s ease;
        flex-shrink: 0;
    }

    .bottom-nav-item.active,
    .bottom-nav-item:hover {
        opacity: 1;
        color: var(--text-color);
    }

    .bottom-nav-item.active svg {
        stroke: #ec4899;
        transform: translateY(-2px);
    }

    .bottom-nav-item.active::after {
        content: '';
        position: absolute;
        bottom: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 24px;
        height: 3px;
        border-radius: 4px;
        background: linear-gradient(90deg, #0ea5e9, #ec4899);
        box-shadow: 0 2px 10px rgba(236, 72, 153, 0.4);
    }

    /* ========== Responsive Điện Thoại - Máy Tính Bảng ========== */
    @media (min-width: 861px) {
        .mobile-only {
            display: none !important;
        }
    }

    @media (max-width: 1060px) {
        .header-right { gap: 12px; flex-grow: 1; justify-content: flex-end; min-width: 0; }
        .nav-menu {
            flex-grow: 1;
            justify-content: flex-end;
            overflow-x: auto;
            scrollbar-width: none; /* Ẩn thanh cuộn */
            -ms-overflow-style: none; /* Ẩn thanh cuộn IE */
            padding: 4px;
        }
        .nav-menu::-webkit-scrollbar { display: none; }
        
        .nav-link { padding: 8px 10px; flex-shrink: 0; }
        .nav-link span { display: none; /* Trên màn hình 1060px đổ xuống chỉ hiển thị 100% icon */ }
        .nav-link svg { width: 22px; height: 22px; margin: 0; opacity: 1; }
    }

    @media (max-width: 860px) {
        /* Ẩn hiện các Component đặc thù Mobile */
        .desktop-only {
            display: none !important;
        }
        .mobile-only {
            display: flex !important;
        }
        
        .header-topbar {
            padding: 6px 0;
            border-bottom: 1px solid var(--header-border-scrolled);
        }
        
        .topbar-inner {
            padding: 0; 
        }

        /* Xóa nav menu ngang trên header */
        .nav-menu { 
            display: none !important;
        }

        .mobile-bottom-nav {
            display: flex;
        }

        body {
            padding-bottom: 70px;
        }
        
        /* Giữ toàn bộ công cụ tiện ích hiển thị */
        .header-tools {
            display: flex;
            padding-left: 0;
            gap: 6px;
            flex-shrink: 0;
        }

        .header-right { border: none; padding-left: 0; gap: 6px; }

        /* Vẫn duy trì form bo tròn viên dọc */
        .vudev-header {
            width: calc(100% - 24px);
            top: 16px;
            border-radius: 20px;
        }

        .animated-border { border-radius: 20px; }

        .header-container { padding: 0 24px; height: 60px; }

        .vudev-header.scrolled { top: 8px; padding: 0; }

        /* Thu nhỏ khối công cụ tiện ích để nhường không gian cho Menu nhưng vẫn to rõ */
        .tool-btn {
            width: 38px; height: 38px;
        }
        
        .theme-toggle svg { width: 18px; height: 18px; }
        .lang-toggle { font-size: 13px; }
    }

    @media (max-width: 480px) {
        .vudev-header {
            width: calc(100% - 12px);
            top: 10px;
            border-radius: 20px;
        }
        
        .animated-border { border-radius: 20px; }
        
        .vudev-header.scrolled { top: 6px; }

        .header-container {
            padding: 0 20px;
            height: 52px;
        }

        /* Kích thước Logo to rõ trên Mobile */
        .vudev-logo .logo-text { font-size: 22px; }
        
        .tool-btn {
            width: 36px; height: 36px;
            border-width: 0.5px;
        }
        
        .theme-toggle svg { width: 18px; height: 18px; }
        .lang-toggle { font-size: 12px; }

        .header-tools { gap: 4px; padding-left: 4px; }
        .header-right { gap: 4px; }
        .nav-link { padding: 6px; }
        .nav-link svg { width: 20px; height: 20px; }
    }

    /* ========== Cửa Hàng Premium Modal ========== */
    .store-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        z-index: 2000;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s ease;
    }

    .store-modal-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .store-modal {
        background: var(--modal-bg);
        border: 1px solid var(--modal-border);
        border-radius: 28px;
        padding: 40px;
        max-width: 420px;
        width: 90%;
        text-align: center;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), inset 0 2px 10px rgba(255, 255, 255, 0.05);
        transform: scale(0.9) translateY(20px);
        transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .store-modal-overlay.active .store-modal {
        transform: scale(1) translateY(0);
    }

    .modal-icon-premium {
        width: 64px;
        height: 64px;
        margin: 0 auto 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: rgba(14, 165, 233, 0.1);
        color: #0ea5e9;
        box-shadow: 0 0 20px rgba(14, 165, 233, 0.3);
    }

    .modal-icon-premium svg {
        width: 32px;
        height: 32px;
    }

    .modal-title {
        font-size: 22px;
        font-weight: 800;
        margin-bottom: 12px;
        color: var(--text-color);
    }

    .modal-desc {
        font-size: 15px;
        color: var(--text-muted);
        line-height: 1.7;
        margin-bottom: 32px;
    }

    .premium-text-vudev {
        display: inline-block;
        font-size: 26px;
        font-weight: 900;
        margin: 8px 0;
        letter-spacing: 1px;
        background: linear-gradient(to right, #0ea5e9 0%, #a855f7 33%, #ec4899 66%, #0ea5e9 100%);
        background-size: 300% auto;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: #0ea5e9;
        animation: premiumShine 3s linear infinite;
    }

    @keyframes premiumShine {
        to {
            background-position: 300% center;
        }
    }

    .modal-actions-premium {
        display: flex;
        gap: 16px;
    }

    .btn-premium-no,
    .btn-premium-yes {
        flex: 1;
        padding: 14px;
        border-radius: 14px;
        font-size: 16px;
        font-weight: 700;
        cursor: pointer;
        border: none;
        transition: all 0.3s ease;
    }

    .btn-premium-no {
        background: var(--toggle-bg);
        color: var(--text-color);
    }

    .btn-premium-no:hover {
        background: var(--toggle-hover);
    }

    .btn-premium-yes {
        background: linear-gradient(135deg, #0ea5e9, #ec4899);
        color: #fff;
        box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
    }

    .btn-premium-yes:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(236, 72, 153, 0.6);
    }

    /* ========== VUDEV SHOP Header Upgrade ========== */
    .header-topbar {
        border-bottom: 1px solid var(--header-border-scrolled);
        padding: 8px 0;
    }

    .topbar-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 0 40px;
        font-size: 12px;
    }

    /* VUDEV Ticker (Chữ chạy Topbar) */
    .topbar-left, .topbar-right {
        flex-shrink: 0;
        white-space: nowrap;
        z-index: 2; /* Tránh bị chữ đè lên khi chạy */
    }

    .topbar-center.topbar-ticker {
        flex: 1;
        overflow: hidden;
        position: relative;
        display: flex;
        align-items: center;
        /* Áp dụng gradient fade (blur biên) để chữ trôi ra vô mượt hơn */
        -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
        mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
        padding: 0 10px;
    }

    .ticker-track {
        display: inline-flex;
        white-space: nowrap;
        animation: marquee 20s linear infinite;
        align-items: center;
    }

    .ticker-track:hover {
        animation-play-state: paused;
    }

    .ticker-item {
        padding-right: 80px;
        font-weight: 600;
        color: var(--text-color);
        opacity: 0.9;
    }

    /* Hiệu ứng gradient đẹp lên chữ chạy */
    .ticker-item {
        background: linear-gradient(135deg, #0ea5e9, #ec4899, #f59e0b);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        display: inline-block;
    }

    @keyframes marquee {
        0% { transform: translateX(0); }
        100% { transform: translateX(-33.33333%); } /* Vì có 3 đoạn giống hệt nhau, dịch chuyển -33.3% sẽ khớp hoàn hảo để lặp */
    }

    .topbar-left a,
    .topbar-link,
    .topbar-greeting {
        color: var(--text-color);
        text-decoration: none;
        opacity: 0.85;
        font-weight: 600;
    }

    .topbar-link {
        position: relative;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 2px 0;
        transition: color 0.25s ease, opacity 0.25s ease;
    }

    .topbar-link::after {
        content: '';
        position: absolute;
        left: 50%;
        bottom: -2px;
        width: 0;
        height: 2px;
        border-radius: 999px;
        transform: translateX(-50%);
        background: linear-gradient(90deg, #0ea5e9, #ec4899);
        transition: width 0.25s ease;
    }

    .topbar-link:hover {
        color: #0ea5e9;
        opacity: 1;
    }

    .topbar-link:hover::after {
        width: 100%;
    }

    .topbar-right {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .topbar-btn {
        border: 0;
        background: transparent;
        cursor: pointer;
    }

    .topbar-phone {
        border: 0;
        background: transparent;
        cursor: pointer;
        font: inherit;
        line-height: 1.2;
    }

    .copy-status {
        min-width: 104px;
        font-size: 11px;
        color: #0ea5e9;
        opacity: 0;
        transition: opacity 0.25s ease;
    }

    .copy-status.visible {
        opacity: 1;
    }

    .logout-form {
        margin: 0;
    }

    .nav-item {
        position: relative;
    }

    .nav-link-button {
        border: 0;
        background: transparent;
        font: inherit;
        cursor: pointer;
    }

    .mega-arrow {
        width: 14px;
        height: 14px;
        transition: transform 0.25s ease;
    }

    .mega-menu {
        position: absolute;
        top: calc(100% + 10px);
        right: -10px;
        width: max-content;
        max-width: 90vw;
        padding: 24px 32px;
        border-radius: 16px;
        border: 1px solid var(--header-border-scrolled);
        background: var(--mobile-menu-bg);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
        opacity: 0;
        visibility: hidden;
        transform: translateY(8px);
        transition: all 0.25s ease;
        z-index: 1002;
    }

    .has-mega:hover .mega-menu,
    .has-mega:focus-within .mega-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .has-mega:hover .mega-arrow,
    .has-mega:focus-within .mega-arrow {
        transform: rotate(180deg);
    }

    .mega-grid {
        display: flex;
        gap: 48px;
    }

    .mega-col {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mega-col h5 {
        margin: 0 0 4px;
        font-size: 13px;
        color: var(--text-color);
    }

    .mega-col a {
        color: var(--text-muted);
        text-decoration: none;
        font-size: 13px;
    }

    .mega-col a:hover {
        color: #0ea5e9;
    }

    .mobile-bottom-nav .bottom-nav-item span {
        font-size: 11px;
        font-weight: 600;
    }

    @media (max-width: 1060px) {
        .topbar-inner,
        .header-container {
            padding-left: 20px;
            padding-right: 20px;
        }

        .mega-menu {
            right: 0;
        }
    }

    @media (max-width: 860px) {
        /* Topbar giữ nguyên để hiển thị Mobile Auth (Xin chào + Số dư) */

        .topbar-inner {
            font-size: 11px;
            flex-wrap: wrap;
            justify-content: center;
        }

        .topbar-right {
            gap: 8px;
        }
        
        .mega-menu {
            right: -10px !important;
            padding: 20px !important;
            width: 250px !important; /* Vừa vặn điện thoại */
            max-width: calc(100vw - 40px) !important;
            max-height: 70vh !important;
            overflow-y: auto !important;
            box-shadow: 0 15px 40px rgba(0,0,0,0.15) !important;
        }

        .mega-grid {
            flex-direction: column !important;
            gap: 20px !important;
        }
        
        .mega-col {
            gap: 10px !important;
        }
        
        .mega-col h5 {
            font-size: 13px !important;
            border-bottom: 1px solid var(--glass-border);
            padding-bottom: 6px;
            margin-bottom: 4px !important;
            font-weight: 700 !important;
        }
        
        .mega-col a {
            font-size: 13px !important;
            padding: 6px 0;
        }
        
        .mega-col a svg {
            width: 16px !important;
            height: 16px !important;
            margin-right: 10px !important;
        }
    }