/* ============================================
   RESPONSIVE CSS - Thiên Long Bát Bộ
   Chỉ bổ sung mobile (≤768px) - KHÔNG ghi đè desktop
   ============================================ */

/* === HAMBURGER MENU BUTTON (Hidden by default) === */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 100;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.mobile-menu-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background-color: #fff;
    margin: 5px 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* === MOBILE (≤768px) === */
@media screen and (max-width: 768px) {

    body {
        overflow-x: hidden;
    }

    /* -- Hamburger menu -- */
    .mobile-menu-toggle {
        display: block;
    }

    .menu-bar-E0zemC {
        height: auto;
        min-height: 50px;
        padding: 10px 15px;
        position: fixed;
        background-color: #212529;
        visibility: visible;
        z-index: 1000;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .frame-125-YOTDIn {
        width: 100%;
        position: relative;
    }

    .menu-3dPgCJ {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: -15px;
        right: -15px;
        background-color: #212529;
        padding: 15px 20px;
        gap: 0;
        z-index: 999;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
        width: calc(100% + 30px);
    }

    .menu-3dPgCJ.mobile-open {
        display: flex !important;
    }

    .menu-3dPgCJ p {
        display: none;
    }

    .menu-3dPgCJ a,
    .svn-avo-bold-masala-13px {
        font-size: 15px;
        padding: 12px 0;
        display: block;
        border-bottom: 1px solid #333;
        width: 100%;
    }

    .menu-3dPgCJ .dropdown {
        display: block;
        width: 100%;
    }

    .dropdown-content {
        position: relative;
        box-shadow: none;
        background-color: #1a1e21;
        padding-left: 15px;
    }

    .dropdown-content a {
        font-size: 14px;
        padding: 10px 15px;
    }

    /* -- Banner -- */
    .ag-banner {
        padding-top: 50px;
        padding-bottom: 0;
        min-height: auto !important;
        height: auto !important;
        background-image: none !important;
        background-color: #1a1a1a !important;
        overflow: hidden;
    }

    .video_bg {
        display: block !important;
        visibility: visible !important;
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        max-width: 100% !important;
        margin-top: 0 !important;
        top: auto !important;
        right: auto !important;
        object-fit: cover;
    }

    .logo-tieungao {
        position: relative;
        margin-top: 10px;
        text-align: center;
        display: block;
    }

    .logo-tieungao img {
        max-width: 200px;
        margin: 0 auto;
    }

    /* -- Content grid: full width on mobile -- */
    .col-md-8.offset-2,
    .col-md-4.offset-4 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-left: 0;
        padding: 0 10px;
    }

    /* -- Action buttons -- */
    .bg-btn {
        background-image: none;
        height: auto;
        padding: 10px 0;
    }

    .list-btn {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        width: 100%;
    }

    .list-btn a {
        width: calc(33.33% - 8px);
        max-width: 110px;
        padding-left: 0;
        padding-right: 0;
    }

    .list-btn a img {
        width: 100%;
        height: auto;
    }

    .btn-napthe {
        top: 0;
    }

    /* -- News swiper and tabs: stack vertically -- */
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .col-md-7,
    .col-md-5 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    #slide-tintuc {
        margin-bottom: 15px;
    }

    #slide-tintuc img {
        width: 100%;
        height: auto;
    }

    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-tabs .nav-item {
        flex-shrink: 0;
    }

    .nav-tabs .nav-link {
        font-size: 12px;
        padding: 8px 10px;
        white-space: nowrap;
    }

    .nav-tabs .nav-link.active {
        padding: 8px 10px;
        background-size: 100% 100%;
    }

    .dot-news {
        font-size: 13px;
        line-height: 1.4;
    }

    .dot-news:before {
        width: 0.4rem;
        height: 0.4rem;
        margin-right: 0.6rem;
    }

    .time-news {
        font-size: 11px;
        white-space: nowrap;
    }

    /* -- Social -- */
    .list-social-btn {
        position: relative;
        right: auto;
        margin-top: 10px;
        padding-right: 0;
        text-align: center;
        display: flex;
        justify-content: center;
        gap: 10px;
    }

    .img-btn-social {
        width: 40px;
        margin: 3px;
    }

    /* -- Features -- */
    .tinh-nang-khung {
        margin-top: 15px;
        background-size: 100% 100%;
        padding: 8px;
    }

    .tinh-nang-khung .col-6 a img {
        max-height: 45px;
    }

    #slide-tinhnang {
        width: 100%;
        height: auto;
        object-fit: contain;
        margin-bottom: 15px;
    }

    /* -- Experiences section -- */
    .ag-experiences {
        min-height: auto;
        margin-top: 0;
        padding-bottom: 20px;
        background-size: cover;
    }

    /* -- Video section -- */
    .bg-video {
        height: auto;
        padding: 10px 0;
    }

    .swiper-slide-video {
        margin-left: 0;
        margin-right: 0;
    }

    .swiper-button-prev2,
    .swiper-button-next2 {
        display: none;
    }

    /* -- Float navigation -- */
    .float {
        display: none;
    }

    /* -- Footer -- */
    footer .col-md-10.offset-1 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-left: 0;
        font-size: 13px;
        line-height: 1.6;
    }

    /* -- Swiper overflow fix -- */
    .swiper {
        overflow: hidden;
    }

    .swiper-button-next,
    .swiper-button-prev {
        display: none;
    }

    /* -- Form -- */
    .form-control {
        font-size: 14px;
    }
}

/* === SMALL MOBILE (≤575px) === */
@media screen and (max-width: 575px) {
    .ag-banner {
        padding-top: 50px;
    }

    .logo-tieungao img {
        max-width: 160px;
    }

    .ag-experiences {
        margin-top: 0 !important;
    }

    .list-btn a {
        width: calc(33.33% - 6px);
        max-width: 90px;
    }

    .nav-tabs .nav-link {
        font-size: 11px;
        padding: 6px 8px;
    }

    .dot-news {
        font-size: 12px;
    }

    .time-news {
        font-size: 10px;
    }

    .img-btn-social {
        width: 35px;
    }

    .ag-experiences {
        margin-top: -5vh;
    }
}

/* === EXTRA SMALL MOBILE (≤399px) === */
@media screen and (max-width: 399px) {
    .ag-banner {
        padding-top: 50px;
    }

    .logo-tieungao img {
        max-width: 130px;
    }

    .list-btn a {
        width: calc(33.33% - 4px);
        max-width: 80px;
    }

    .menu-3dPgCJ a,
    .svn-avo-bold-masala-13px {
        font-size: 13px;
    }
}

/* === NEWS LIST PAGE RESPONSIVE === */
@media screen and (max-width: 768px) {
    .baiviet-div {
        padding: 0 10px;
    }

    .baiviet-div .col-md-8.offset-2 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-left: 0;
        padding: 0;
    }

    .menu-tintuc {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

    .menu-tintuc .title-menu {
        font-size: 12px;
    }

    .BlockTitle h4 {
        font-size: 18px;
    }

    .ContentBlock {
        padding: 0 10px;
        word-break: break-word;
    }

    .ContentBlock img {
        max-width: 100%;
        height: auto;
    }

    .DataList .ajaxp_list_post {
        flex-direction: column;
    }

    .DataList .dot-news {
        margin-bottom: 0;
    }

    .DataList .time-news {
        text-align: left;
        font-size: 11px;
    }
}

/* === ID / DASHBOARD PAGE RESPONSIVE === */
@media screen and (max-width: 768px) {
    .sidebar-menu {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
        width: 260px;
    }

    .sidebar-menu.open {
        left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

/* === VONG XOAY PAGE RESPONSIVE === */
@media screen and (max-width: 768px) {
    canvas {
        max-width: 100%;
        height: auto;
    }
}

/* === UTILITY: Fix common overflow issues === */
@media screen and (max-width: 768px) {
    .wrapper,
    section {
        overflow-x: hidden;
    }

    /* Make images in news content responsive */
    .tab-content img,
    .ContentBlock img {
        max-width: 100%;
        height: auto;
    }

    /* Make tables responsive */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    /* Fix inline styles that break mobile */
    [style*="padding-right: 245px"] {
        padding-right: 0 !important;
    }
}

/* === PRINT STYLES === */
@media print {
    .float,
    .mobile-menu-toggle,
    .menu-bar-E0zemC {
        display: none !important;
    }
}
