/* Main Stylesheet */
body {
    font-family: 'Be Vietnam Pro', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #000;
    line-height: 1.6;
    /* Increased for better readability */
    color: #e5e7eb;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.8;
    /* Adjusted for Vietnamese accents and multi-line */
    margin-bottom: 1rem;
    padding-top: 0.8rem;
    /* Prevent clipping of accents */
    padding-bottom: 0.8rem;
}

/* 3D Hero Section Styles */
.hero-3d {
    position: relative;
    width: 100%;
    height: 100vh;
    /* Full viewport height */
    overflow: hidden;
    /* Hide scrollbars caused by iframe */
    z-index: 1;
    /* Ensure it's above background but below header if needed, or just handle z-index in HTML */
}

.hero-3d iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    /* Remove iframe border */
    display: block;
    /* Remove extra space below iframe */
    z-index: 1;
    /* Ensure iframe is on top */
}

/* Bottom gradient overlay to blend with dark background */
.hero-3d::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 25%;
    /* Adjust height as needed */
    background: linear-gradient(to top, #000 0%, #000 10%, transparent 100%);
    /* Matches brand-dark */
    pointer-events: none;
    /* Allow clicks to pass through to iframe */
    z-index: 2;
    /* Above iframe */
}

/* Logo Marquee Section */
.logo-marquee-section {
    padding: 0;
    background: transparent;
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 100%;
    overflow: hidden;
    height: 50px;
    display: flex;
    align-items: center;
}

.logo-marquee-container {
    display: flex;
    white-space: nowrap;
    width: max-content;
    animation: marquee 30s linear infinite;
}

.logo-marquee-item {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 40px;
    height: 25px;
    flex-shrink: 0;
    /* Prevent shrinking */
}

.logo-marquee-item img {
    height: auto;
    max-height: 25px;
    /* Force height but allow natural aspect ratio */
    width: auto;
    max-width: none;
    /* Override Tailwind max-width if any */
    filter: brightness(0) invert(1);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.logo-marquee-item img:hover {
    opacity: 1;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Fading edge overlays */
.logo-marquee-section::before,
.logo-marquee-section::after {
    content: "";
    position: absolute;
    top: 0;
    width: 15%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.logo-marquee-section::before {
    left: 0;
    background: linear-gradient(to right, #000 0%, transparent 100%);
}

.logo-marquee-section::after {
    right: 0;
    background: linear-gradient(to left, #000 0%, transparent 100%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-3d {
        display: none;
    }

    .hero-3d-mobile {
        position: relative;
        width: 100%;
        height: 100vh;
        /* Full mobile height */
        overflow: hidden;
        z-index: 1;
        background: #000;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .hero-3d-mobile iframe {
        position: absolute;
        width: 1080px;
        height: 1920px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(calc(100vw / 1080));
        transform-origin: center center;
        border: none;
        display: block;
        z-index: 1;
    }

    .hero-3d-mobile::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 25%;
        background: linear-gradient(to top, #000 0%, #000 10%, transparent 100%);
        pointer-events: none;
        z-index: 2;
    }

    .logo-marquee-section {
        height: 40px;
        padding: 5px 0;
    }

    .logo-marquee-item {
        margin: 0 20px;
        height: 20px;
        flex-shrink: 0;
    }

    .logo-marquee-item img {
        height: auto;
        max-height: 20px;
        width: auto;
        max-width: none;
    }
}

/* === Language Switcher === */
#lang-switcher {
    position: fixed;
    bottom: 9rem;
    left: 1.5rem;
    z-index: 999;
}

#lang-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0; /* Remove padding for circular shape */
}

#lang-toggle:hover {
    border-color: rgba(20, 184, 166, 0.4);
    background: rgba(0, 0, 0, 0.85);
    box-shadow: 0 4px 20px rgba(20, 184, 166, 0.15);
}

#lang-toggle.lang-toggle-active {
    border-color: rgba(20, 184, 166, 0.5);
    box-shadow: 0 4px 20px rgba(20, 184, 166, 0.2);
}

#lang-toggle img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

#lang-active-label,
.lang-toggle-active .lang-chevron,
.lang-chevron {
    display: none !important;
}

.lang-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    min-width: 180px;
    padding: 6px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.96);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.lang-dropdown-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #d1d5db;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Be Vietnam Pro', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.lang-option:hover {
    background: rgba(20, 184, 166, 0.1);
    color: #fff;
}

.lang-option-active {
    background: rgba(20, 184, 166, 0.12);
    color: #14b8a6;
}

.lang-option-active:hover {
    background: rgba(20, 184, 166, 0.18);
}

.lang-option-flag {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.lang-check {
    margin-left: auto;
    color: #14b8a6;
}

/* Mobile overrides moved to the bottom of the file for priority */

/* === Mobile Navigation Drawer Styles === */
#mobile-menu-drawer {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-open #mobile-menu-drawer {
    transform: translateX(0);
}

.mobile-nav-link {
    position: relative;
    padding-left: 0;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover {
    padding-left: 8px;
}

.mobile-nav-link::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    width: 8px;
    height: 2px;
    background: #14b8a6;
    opacity: 0;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover::before {
    opacity: 1;
    left: -12px;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Theme Toggle Switch                                           */
/* ═══════════════════════════════════════════════════════════════ */
#theme-toggle-wrapper {
    position: fixed;
    bottom: 5.25rem;
    left: 1.5rem;
    z-index: 999;
}

/* No mobile override here, handled in the common media query above */

#theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fbbf24;
    font-size: 18px;
    padding: 0;
    outline: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

#theme-toggle-btn:hover {
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(0, 0, 0, 0.9);
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.2);
    transform: scale(1.1) rotate(15deg);
}

#theme-toggle-btn .theme-icon {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#theme-toggle-btn .icon-sun {
    display: none;
}

#theme-toggle-btn .icon-moon {
    display: flex;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Light Theme — html.light overrides                            */
/* ═══════════════════════════════════════════════════════════════ */

/* Smooth theme transition */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
    transition: background-color 0.5s ease,
                color 0.4s ease,
                border-color 0.4s ease,
                box-shadow 0.4s ease,
                background 0.5s ease !important;
}

/* Light Theme Body */
html.light body {
    background-color: #f8f9fa;
    color: #1a1a2e;
}

/* Light Theme Toggle Button */
html.light #theme-toggle-btn {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
    color: #6366f1;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

html.light #theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

html.light #theme-toggle-btn .icon-sun {
    display: flex;
}

html.light #theme-toggle-btn .icon-moon {
    display: none;
}

/* Language Switcher in Light */
html.light #lang-toggle {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a2e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Stronger shadow in light mode */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

html.light #lang-toggle:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(20, 184, 166, 0.4);
    box-shadow: 0 4px 20px rgba(20, 184, 166, 0.12);
}

html.light .lang-dropdown {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

html.light .lang-option {
    color: #374151;
}

html.light .lang-option:hover {
    background: rgba(20, 184, 166, 0.08);
    color: #0d9488;
}

html.light .lang-option-active {
    background: rgba(20, 184, 166, 0.1);
    color: #0d9488;
}

/* Sections backgrounds */
html.light section,
html.light main#hero,
html.light footer#footer,
html.light #inventory-check {
    background-color: #f8f9fa;
}

/* Background overrides in light */
html.light .bg-black,
html.light .bg-brand-dark {
    background-color: #f8f9fa !important;
}

/* Force Dark Mode aesthetic for cards inside GDrive and Docs sections */
html.light #gdrive .max-w-6xl > div,
html.light #docs .max-w-7xl > div {
    border-color: rgba(255, 255, 255, 0.05) !important;
}

html.light #gdrive h2,
html.light #gdrive p,
html.light #gdrive span,
html.light #gdrive a,
html.light #gdrive .text-white,
html.light #docs h3,
html.light #docs p,
html.light #docs span,
html.light #docs a,
html.light #docs .text-white {
    color: #ffffff !important;
}

/* Section titles for #gdrive and #docs should be dark on light bg */
html.light #docs h2,
html.light #gdrive h2 {
    color: #1a1a2e !important;
}


html.light #gdrive .text-gray-400,
html.light #docs .text-gray-400 {
    color: #9ca3af !important;
}

html.light #gdrive .bg-gradient-to-br {
    background-image: linear-gradient(to bottom right, #0a1f1a, #040d0a, #020805) !important;
}

html.light #docs .bg-gradient-to-t {
    background-image: linear-gradient(to top, #000 0%, rgba(0,0,0,0.4) 100%) !important;
}

/* Alternate section bands for visual depth */
html.light #lookup,
html.light #ecosystem,
html.light #leadership {
    background-color: #ffffff;
}

html.light #products,
html.light #docs,
html.light #achievements {
    background-color: #f1f3f5;
}

/* Text colors */
html.light h1:not(#gdrive *):not(#docs *),
html.light h2:not(#gdrive *):not(#docs *),
html.light h3:not(#gdrive *):not(#docs *),
html.light h4:not(#gdrive *):not(#docs *),
html.light h5:not(#gdrive *):not(#docs *),
html.light h6:not(#gdrive *):not(#docs *) {
    color: #1a1a2e;
}

html.light p:not(#gdrive *):not(#docs *),
html.light span:not(#gdrive *):not(#docs *),
html.light li:not(#gdrive *):not(#docs *) {
    color: #374151;
}

html.light .text-gray-100:not(#gdrive *):not(#docs *),
html.light .text-white:not(#gdrive *):not(#docs *):not([data-purpose="floating-contacts"] *) {
    color: #1a1a2e !important;
}

html.light .text-gray-400:not(#gdrive *):not(#docs *),
html.light .text-gray-500:not(#gdrive *):not(#docs *),
html.light [class*="text-[#84889c]"]:not(#gdrive *):not(#docs *) {
    color: #6b7280 !important;
}

html.light .text-gray-600 {
    color: #9ca3af !important;
}

/* Glass effect in light */
html.light .glass-effect {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.06);
}

/* Cards — teal gradient */
html.light .card-teal-gradient:not(#docs *) {
    background: linear-gradient(135deg, #f0fdfa 0%, #e6fffa 100%);
    border-color: rgba(20, 184, 166, 0.15);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

html.light .card-teal-gradient:hover {
    box-shadow: 0 8px 32px rgba(20, 184, 166, 0.1);
}

/* Cards — gold gradient */
html.light .card-gold-gradient {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: rgba(212, 175, 55, 0.15);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

html.light .card-gold-gradient:hover {
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.12);
}

/* Inventory card */
html.light .inventory-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 30%, #fef9e7 60%, #fffbeb 100%);
    border-color: rgba(212, 175, 55, 0.2);
    box-shadow: 0 4px 24px rgba(212, 175, 55, 0.06);
}

html.light .inventory-card:hover {
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 0 8px 40px rgba(212, 175, 55, 0.1);
}

/* Hover lift in light */
html.light .hover-lift:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 0 30px rgba(20, 184, 166, 0.05);
}

/* Glow border in light */
html.light .glow-border::after {
    opacity: 0.15;
}

/* Ambient orbs in light — more subtle */
html.light .orb-ambient {
    opacity: 0.3;
}

/* Background mesh in light */
html.light .bg-mesh {
    background-image: radial-gradient(circle at 50% 50%, rgba(13, 148, 136, 0.05) 0%, transparent 60%),
        radial-gradient(circle at 80% 20%, rgba(20, 184, 166, 0.03) 0%, transparent 40%);
}

/* Bullet navigation in light */
html.light .bullet-dot {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.08);
}

html.light .bullet-dot:hover {
    background: rgba(20, 184, 166, 0.4);
}

html.light .bullet-dot.active {
    background: #14b8a6;
    border-color: rgba(20, 184, 166, 0.5);
}

html.light .bullet-dot::before {
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a2e;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Scroll to top button in light */
html.light #scrollTop {
    background: rgba(20, 184, 166, 0.12);
    border-color: rgba(0, 0, 0, 0.08);
}

html.light #scrollTop svg {
    color: #0d9488;
}

/* Footer in light */
html.light footer#footer {
    background-color: #ffffff;
    border-top-color: rgba(0, 0, 0, 0.06);
}

html.light footer .border-t {
    border-top-color: rgba(0, 0, 0, 0.06);
}

/* Marquee logos in light — dark logos */
html.light .logo-marquee-item img {
    filter: brightness(0);
    opacity: 0.5;
}

html.light .logo-marquee-item img:hover {
    opacity: 0.85;
}

/* Marquee fade gradients in light */
html.light .logo-marquee-section::before {
    background: linear-gradient(to right, #f8f9fa 0%, transparent 100%);
}

html.light .logo-marquee-section::after {
    background: linear-gradient(to left, #f8f9fa 0%, transparent 100%);
}

/* Hero 3D section overlay in light */
html.light .hero-3d::after {
    background: linear-gradient(to top, #f8f9fa 0%, #f8f9fa 10%, transparent 100%);
}

/* Border utilities in light */
html.light .border-white\/5,
html.light .border-white\/10 {
    border-color: rgba(0, 0, 0, 0.06) !important;
}

/* Background overrides in light */
html.light .bg-black:not(#gdrive),
html.light .bg-brand-dark:not(#gdrive) {
    background-color: #f8f9fa !important;
}

/* White/opacity backgrounds in light */
html.light .bg-white\/20 {
    background-color: rgba(0, 0, 0, 0.06) !important;
}

/* Contact floating buttons keep their colors */
html.light [data-purpose="floating-contacts"] a {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

html.light [data-purpose="floating-contacts"] a span,
html.light [data-purpose="floating-contacts"] a p {
    color: #fff !important;
}

/* Leader card in light */
html.light .leader-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

/* Achievement card in light */
html.light .achievement-card {
    background: linear-gradient(135deg, #f0fdfa 0%, #e6fffa 100%);
    border-color: rgba(20, 184, 166, 0.1);
}

/* SVG icons that are white in dark theme */
html.light .text-white svg:not(#gdrive *):not(#docs *),
html.light .text-gray-100 svg:not(#gdrive *):not(#docs *) {
    color: #1a1a2e;
}

/* Keep accent SVGs their original color */
html.light .text-brand-gold {
    color: #b8860b;
}

/* Breathing glow more subtle in light */
html.light .breathing-glow {
    animation: none;
}

/* Resource links column bullets */
html.light .bg-white {
    background-color: #ffffff !important;
}

/* Shimmer text keep visible with slightly darker gold */
html.light .text-shimmer {
    background: linear-gradient(90deg, #b8860b 0%, #d4a843 25%, #b8860b 50%, #d4a843 75%, #b8860b 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
}

html.light .text-shimmer-green {
    background: linear-gradient(90deg, #0d9488 0%, #14b8a6 25%, #0d9488 50%, #14b8a6 75%, #0d9488 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
}

/* Flipbook embed section light */
html.light #flipbook {
    background-color: #ffffff;
}

/* Resources section */
html.light #resources {
    background-color: #f1f3f5;
}

/* GDrive section */
html.light #gdrive {
    background-color: #ffffff;
}

/* === REFINED MOBILE OVERRIDES (Priority) === */
@media (max-width: 768px) {
    #lang-switcher {
        position: fixed !important;
        bottom: 120px !important;
        right: -300px !important; /* Hidden off-screen by default */
        left: auto !important;
        z-index: 100 !important;
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    #theme-toggle-wrapper {
        position: fixed !important;
        bottom: 120px !important;
        right: -300px !important; /* Hidden off-screen by default */
        left: auto !important;
        z-index: 100 !important;
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* When drawer is open, slide them in */
    .drawer-open #lang-switcher {
        transform: translateX(-340px) !important;
    }
    
    .drawer-open #theme-toggle-wrapper {
        transform: translateX(-440px) !important;
    }

    #lang-active-label {
        display: none !important;
    }
    #lang-toggle {
        padding: 8px !important;
        border-radius: 12px !important;
    }

    /* Ensure hamburger and close icons have explicit sizes */
    #mobile-menu-open svg, 
    #mobile-menu-close svg {
        width: 32px !important;
        height: 32px !important;
        display: block !important;
    }
}