/* Global Styles */
* {
    font-family: 'Montserrat', sans-serif;
    scrollbar-width: thin;
    scrollbar-color: #FFD700 #1a1a1a;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: 'Montserrat', sans-serif;
    background: black;
}

/* Main Section */
.main-section {
    background-image: url('./assets/img/pc/bg.webp'), url('./assets/img/pc/bg2.webp');
    background-size: contain, contain;
    background-position: center 0, center 100vh;
    background-repeat: no-repeat, no-repeat;
    min-height: 100vh;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

@media (max-width: 768px) {
    .main-section {
    background-image: url('./assets/img/mb/bg.webp'), url('./assets/img/mb/bg2.webp');
    background-size: contain, contain;
    background-position: center 0, center 100vh;
    background-repeat: no-repeat, no-repeat;
        padding: 12px;
    }
}

/* Form Container */
.form-container {
    background-image: url('./assets/img/pc/khungchinh.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    width: 95%;
    max-width: 450px;
    min-height: 240px;
    height: auto;
    position: relative;
    transition: height 0.3s ease;
}

#registerForm {
    min-height: 240px;
}

/* Input Styles */
.input-username {
    background-image: url('./assets/img/pc/khungnhap.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    height: 55px;
    display: flex;
    align-items: center;
}

.input-password {
    background-image: url('./assets/img/pc/khungnhap.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    height: 55px;
    display: flex;
    align-items: center;
}

.input-captcha {
    background-image: url('./assets/img/pc/khungnhap.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    height: 55px;
    display: flex;
    align-items: center;
}

/* Button Styles */
.btn-login {
    background-image: url('./assets/img/pc/btn_dangnhap.webp');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    height: 55px;
    width: 100%;
}

.btn-register {
    background-image: url('./assets/img/pc/btn_dangky1.webp');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    height: 55px;
    width: 100%;
}

.btn-register-submit {
    background-image: url('./assets/img/pc/btn_dangky2.webp');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    height: 55px;
    width: 100%;
}

.btn-back {
    background-image: url('./assets/img/pc/btn_quaylai.webp');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    height: 55px;
    width: 100%;
}

/* Placeholder Styles */
.input-username::placeholder,
.input-password::placeholder {
    color: #30452E !important;
    opacity: 1;
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
}

.input-username::-webkit-input-placeholder,
.input-password::-webkit-input-placeholder {
    color: #30452E !important;
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
}

.input-username::-moz-placeholder,
.input-password::-moz-placeholder {
    color: #30452E !important;
    opacity: 1;
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
}

.input-username:-ms-input-placeholder,
.input-password:-ms-input-placeholder {
    color: #30452E !important;
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
}

/* Input Fields */
.input-username,
.input-password {
    font-family: 'Montserrat', sans-serif;
}

/* Buttons */
button {
    font-family: 'Montserrat', sans-serif;
}

/* All text elements */
p, span, div, a, label {
    font-family: 'Montserrat', sans-serif;
}

/* Layout Columns */
.fixed-column {
    position: fixed;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 10;
}

.left-column {
    left: 0;
    width: 25vw;
    padding: 20px;
    display: flex;
    align-items: center; /* Center content vertically */
    justify-content: center;
    transform: translateY(15vh); /* Move down MORE - increase this number to move further down */
}

.right-column {
    right: 0;
    width: 25vw;
    padding: 20px;
    display: flex;
    align-items: center; /* Center content vertically */
    justify-content: center;
    transform: translateY(5vh); /* Move UP - decrease this number to move further up */
}

.center-column {
    margin-left: 25vw;
    margin-right: 25vw;
    width: 50vw;
    min-height: 100vh;
    padding-top: 0;
}

/* Video Slider */
.video-slider {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    width: 100%; /* Make it responsive */
    aspect-ratio: 16/9;  /* Use aspect ratio for all devices */
    margin: 0 auto;
    border: 3px solid #ff0000;
    animation: glow-pulse 2s ease-in-out infinite alternate;
    contain: layout style paint; /* Performance optimization */
}

/* Desktop and tablet video dimensions - use aspect ratio */
@media (min-width: 768px) {
    .video-slider {
        width: 100%; /* Increase from 95% to 100% */
        aspect-ratio: 16/9;
        height: auto; /* Remove fixed height */
        max-width: 420px; /* Base size cho tablet/desktop nhỏ */
    }
}

/* Mobile video - use aspect ratio only on mobile */
@media (max-width: 767px) {
    .video-slider {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16/9 !important;
        margin: 0 !important;
    }
    
    /* Mobile video container should use full width */
    .flex.md\\:hidden .px-4 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .flex.md\\:hidden .w-full {
        max-width: none !important;
    }
}

@keyframes glow-pulse {
    0% {
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.6), 0 0 10px rgba(255, 0, 0, 0.4), 0 0 20px rgba(255, 0, 0, 0.2);
        border-color: #ff0000;
    }
    100% {
        box-shadow: 0 0 30px rgba(255, 0, 0, 0.8), 0 0 20px rgba(255, 0, 0, 0.6), 0 0 30px rgba(255, 0, 0, 0.4);
        border-color: #ff3333;
    }
}

/* Live Content Container */
.live-content-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    contain: layout style paint; /* Performance optimization */
}

.live-iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    border-radius: 12px;
    will-change: transform; /* Performance optimization */
}

.live-iframe.active {
    display: block;
}

/* Desktop video scaling - make video fill container completely */
@media (min-width: 768px) {
    .live-iframe {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        transform: scale(1.05) !important; /* Same scale as mobile to fill gaps */
        border-radius: 8px !important;
    }
    
    .live-content-container {
        overflow: hidden !important; /* Hide any overflow from scaling */
    }
    
    .video-slider {
        overflow: hidden !important;
    }
}

/* Mobile video scaling - make video fill container completely */
@media (max-width: 767px) {
    .live-iframe {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        transform: scale(1.05) !important; /* Slightly scale up to fill any gaps */
        border-radius: 8px !important;
    }
    
    .live-content-container {
        overflow: hidden !important; /* Hide any overflow from scaling */
    }
}

.live-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 50px; 
    z-index: 2;
    animation: blink 1.5s infinite;
}

.vin-logo {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    z-index: 2;
    border-radius: 4px;
    /* background: rgba(0, 0, 0, 0.3); */
    padding: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.video-slider::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: transparent;
    z-index: 1;
}

.gold-border {
    background-image: url('./assets/img/pc/khungSEO.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
}

/* Mobile SEO frame */
@media (max-width: 767px) {
    .gold-border {
        background-image: url('./assets/img/mb/khungseomb.webp');
        background-size: 100% 100%;
        background-repeat: no-repeat;
        background-position: center;
        /* Ensure border is visible */
        border: 2px solid rgba(255, 215, 0, 0.3);
        border-radius: 12px;
        padding: 2px;
    }
    
    /* Mobile text size optimizations */
    .gold-border h2 {
        font-size: 1.75rem !important; /* 28px instead of text-3xl */
        line-height: 1.3 !important;
        margin-bottom: 16px !important;
    }
    
    .gold-border h3 {
        font-size: 1.5rem !important; /* 24px instead of text-2xl */
        line-height: 1.3 !important;
        margin-bottom: 12px !important;
    }
    
    .gold-border h4 {
        font-size: 1.25rem !important; /* 20px instead of text-xl */
        line-height: 1.3 !important;
        margin-bottom: 8px !important;
    }
    
    .gold-border p {
        font-size: 0.95rem !important; /* 15px instead of base 16px */
        line-height: 1.5 !important;
        margin-bottom: 12px !important;
    }
    
    .gold-border li {
        font-size: 0.9rem !important; /* 14px for list items */
        line-height: 1.4 !important;
        margin-bottom: 6px !important;
    }
}

/* Logo Section */
.logo-section {
    text-align: center;
    padding: 15px 0 10px 0;
    position: relative;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #FFD700;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #b39700;
}

.logo-section img {
    margin-top:48px;
    height: 180px;
    margin-bottom: 5px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile logo size - make it bigger */
@media (max-width: 767px) {
    .logo-section img {
        height: 320px;
        margin-top: 24px;
    }
}

/* Title Section */
.title-section {
    background-image: url('./assets/img/pc/title.webp');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    height: 90px;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Banner and Social Icons */
.banner-left {
    width: 95%;
    height: auto;
    max-width: 400px;
}

.social-icons {
    width: 95%;
    margin: 0 auto;
}

.social-icon {
    width: 50px;
    height: 50px;
}

/* Download buttons styles */
.download-btn {
    display: inline-block;
    text-decoration: none;
}

.download-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    transition: all 0.3s ease;
}

.download-btn:hover .download-container {
    transform: translateY(-2px);
}

.download-btn:active .download-container {
    transform: translateY(0);
}

/* Custom Scrollbar */
.fixed-column::-webkit-scrollbar {
    width: 8px;
}

.fixed-column::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}

.fixed-column::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
}

.fixed-column::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Tablet breakpoint (768px - 1199px): Chỉ hiển thị Center Column (Form) và Content */
@media (max-width: 1199px) and (min-width: 768px) {
    .left-column, .right-column {
        display: none !important;
    }

    .column, .center-column {
        margin: 0;
        width: 100%;
    }

    .vin-logo {
        width: 28px;
        height: 28px;
        top: 8px;
        left: 8px;
    }

    /* Hiển thị CTA section chỉ trên tablet */
    .tablet-only-cta {
        display: block !important;
        padding: 20px 0;
    }
}

/* Mobile breakpoint (<768px): Chỉ hiển thị Right Column và Content */
@media (max-width: 767px) {
    .left-column {
        display: none !important;
    }

    .column {
        display: none !important;
    }

    .center-column {
        margin: 0 !important;
        width: 100% !important;
        padding: 10px !important;
    }

    .right-column {
        position: relative !important;
        width: 100% !important;
        padding: 20px !important;
        height: auto !important;
    }

    .video-slider {
        width: 100% !important;
        aspect-ratio: 16/9 !important;
        max-width: 100% !important;
        height: auto !important;
    }

    .vin-logo {
        width: 42px;
        height: 42px;
        top: 8px;
        left: 8px;
    }

    /* Mobile specific form styles */
    .form-container {
        background-image: url('./assets/img/mb/khunglive.webp');
    }

    .input-username {
        background-image: url('./assets/img/mb/Rectangle 7.webp');
    }

    .input-password {
        background-image: url('./assets/img/mb/Rectangle 7.webp');
    }

    .btn-register {
        background-image: url('./assets/img/mb/Rectangle 7.webp');
    }

    .btn-login {
        background-image: url('./assets/img/mb/Rectangle 7.webp');
    }
    
    /* Mobile icons */
    .input-username img[src*="user.webp"] {
        content: url('./assets/img/mb/user.webp');
    }
    
    .input-password img[src*="pass.webp"] {
        content: url('./assets/img/mb/pass.webp');
    }
    
    .input-password img[src*="eye"] {
        content: url('./assets/img/mb/eye_off.webp');
    }
    
    /* Mobile text and button size optimizations */
    .logo-section img {
        height: 280px !important; /* Reduce from 320px to be more balanced */
        margin-top: 20px !important;
    }
    
    /* Mobile form elements sizing */
    .input-username, .input-password, .input-captcha {
        height: 50px !important; /* Slightly smaller than 55px */
    }
    
    .input-username input, .input-password input, .input-captcha input {
        font-size: 15px !important; /* Slightly smaller font */
        padding-left: 45px !important;
    }
    
    /* Mobile paragraph text in main content */
    .center-column p {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
        margin-bottom: 16px !important;
    }
    
    /* Mobile heading sizes for main content */
    .center-column h1 {
        font-size: 1.5rem !important; /* Smaller than text-3xl */
        line-height: 1.3 !important;
    }
    
    /* Social icons in mobile right column */
    .social-icons img {
        height: 28px !important; /* Smaller social icons */
        width: 28px !important;
    }
    
    /* Mobile download buttons in right column */
    #mobile-download-container img {
        max-height: 45px !important; /* Control mobile download button size */
    }
}

/* Mobile download button styles */
#mobile-download-container {
    transition: all 0.3s ease;
}

#mobile-download-container a {
    transition: transform 0.2s ease;
}

#mobile-download-container a:hover {
    transform: translateY(-2px);
}

/* Mobile-friendly download button sizing */
.mobile-download-btn {
    min-height: 58px !important;
    width: 95% !important; /* Tăng từ 82% lên 95% để match với text width */
    max-width: 320px !important; /* Tăng từ 270px lên 320px */
    height: auto !important;
    padding: 7px !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

.mobile-access-btn {
    min-height: 75px !important;
    width: 95% !important;
    max-width: 350px !important;
    height: auto !important;
    padding: 12px !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
    will-change: transform; /* Performance optimization */
}

/* Responsive download buttons for footer section */
.responsive-download-btn {
    min-height: 52px !important;
    height: auto !important;
    padding: 4px 8px !important;
    object-fit: contain !important;
}

/* Make sure buttons are touch-friendly on all mobile devices */
@media (max-width: 480px) {
    .mobile-download-btn {
        min-height: 62px !important;
        width: 95% !important; /* Tương đương với text container */
        display: block !important;
        margin: 0 auto !important;
    }
    
    .mobile-access-btn {
        min-height: 78px !important;
        width: 96% !important;
        display: block !important;
        margin: 0 auto !important;
    }
    
    .responsive-download-btn {
        min-height: 56px !important;
    }
}

/* Ensure mobile download section is properly styled on mobile only */
@media (max-width: 767px) {
    #mobile-download-container {
        padding: 20px 0;
        margin: 20px 0;
    }

    .main-section {
        background-image: url('./assets/img/mb/bg.webp'), url('./assets/img/mb/bg2.webp');
        background-size: contain, contain;
        background-position: center 0, center 100vh;
        background-repeat: no-repeat, no-repeat;
    }
    /* Mobile footer layout adjustments - keep horizontal like mb2.jpg */
    footer .container {
        gap: 8px !important;
    }
    
    footer .flex-wrap {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: space-around !important;
        align-items: center !important;
        gap: 4px !important;
    }
    
    /* Make footer items smaller and more compact on mobile */
    footer .flex-wrap > div {
        flex: 0 0 auto !important;
        text-align: center !important;
        min-width: 80px !important;
    }
    
    footer .flex-wrap img {
        height: 48px !important;
        width: auto !important;
        max-width: 60px !important;
    }
    
    footer .flex-wrap h3 {
        font-size: 12px !important;
        margin-bottom: 4px !important;
        white-space: nowrap !important;
    }
    
    footer .flex-wrap .space-x-6 {
        gap: 8px !important;
        justify-content: center !important;
    }
    
    footer .flex-wrap .space-x-6 img {
        height: 24px !important;
        width: 24px !important;
    }
    
    /* Footer background for mobile */
    footer {
        background-image: url('./assets/img/mb/nenduoimb.webp') !important;
        background-size: cover !important;
        background-position: center !important;
    }
}

/* Live content specific styles */
.live-content-container iframe {
    border-radius: 12px;
}

/* VinClub specific branding colors */
:root {
    --vinclub-gold: #FFD700;
    --vinclub-red: #fc0303;
    --vinclub-dark: #1a1a1a;
    --vinclub-green: #a7e02e;
}

/* Enhanced mobile responsiveness */
@media (max-width: 480px) {
    /* Enhanced mobile responsiveness for small screens */
    .logo-section img {
        height: 120px;
        margin-top: 24px;
    }

    .form-container {
        max-width: 95%;
        margin: 0 auto;
    }

    .video-slider {
        width: 100% !important;
        aspect-ratio: 16/9 !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 0 !important;
    }

    .vin-logo {
        width: 46px;
        height: 46px;
        top: 6px;
        left: 6px;
    }
}

/* Force divider images to show on mobile */
@media (max-width: 767px) {
    .responsive-img[alt="divider"] {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: 32px !important;
        width: auto !important;
    }
}

/* Title image - giữ nguyên kích thước gốc */
.title-original-size {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
    transform: none !important;
}

/* Tablet specific adjustments */
@media (min-width: 768px) and (max-width: 1199px) {
    .main-section {
    background-image: url('./assets/img/pc/bg.webp'), url('./assets/img/pc/bg2.webp');
    background-size: contain, contain;
    background-position: center 0, center 100vh;
    background-repeat: no-repeat, no-repeat;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    }

    .center-column {
        padding: 20px;
    }
    
    /* Tablet positioning adjustments */
    .left-column {
        transform: translateY(6vh); /* Less movement on tablets */
    }
    
    .right-column {
        transform: translateY(5vh); /* Less movement on tablets */
    }
}

/* Desktop specific adjustments */
@media (min-width: 1200px) {
    .main-section {
    background-image: url('./assets/img/pc/bg.webp'), url('./assets/img/pc/bg2.webp');
    background-size: contain, contain;
    background-position: center 0, center 100vh;
    background-repeat: no-repeat, no-repeat;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    overflow-x: visible !important; /* Cho phép video vượt qua giới hạn ngang */
    }

    .vin-logo {
        width: 54px;
        height: 54px;
        top: 12px;
        left: 12px;
    }
    
    /* Better alignment for desktop columns */
    .fixed-column {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Tối ưu hóa right-column cho video lớn hơn */
    .right-column {
        width: 24vw !important; /* Tăng từ 25vw lên 35vw */
        /* padding: 10px !important; Giảm từ 20px xuống 10px */
        overflow: visible !important; /* Cho phép video vượt qua giới hạn */
        z-index: 10 !important; /* Đảm bảo video hiển thị trên các element khác */
    }
    
    .video-slider {
        max-width: 100% !important;
        width: 100% !important;
        /* Mở rộng khung live sang trái vượt qua right-column */
        transform: translateX(5%) scale(1.1) !important; /* Dịch trái 20% và phóng to 140% */
        transform-origin: right center !important; /* Neo bên phải để không bị dịch chuyển */
        overflow: visible !important; /* Đảm bảo không bị cắt */
        z-index: 15 !important; /* Layer cao hơn right-column */
    }
    
    /* Desktop Social Icons - Dịch chuyển ngang */
    .desktop-social-icons {
        transform: translateX(0%) !important; /* ← CHỈNH SỐ NÀY để dịch chuyển ngang */
    }
    
    /* Fine-tune positioning for larger screens */
    .left-column {
        transform: translateY(-3vh); /* Large desktop - LEFT column - lên thêm 5vh nữa */
    }
    
    .right-column {
        transform: translateY(-7vh); /* Large desktop - RIGHT column (video) - lên thêm 5vh nữa */
    }
}

/* Mobile app title styling - Performance optimized */
.mobile-app-title {
    color: #FFFFFF !important;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 500 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
    line-height: 1.2 !important;
    margin: 6px auto !important;
    max-width: 320px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    contain: layout style; /* Performance optimization */
}