/* ===== CSS RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    /* Base font size for rem calculations */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: Arial, sans-serif;
    padding: 1.25rem;
    background: url(./assets/img/background.webp);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

a {
    text-decoration: none;
    color: #00aeef;
    font-weight: bold;
}

.text-center {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: #333;
}

/* ===== HEADER STYLES ===== */
.back-home {
    text-decoration: none;
    display: flex;
    justify-content: center;
    position: absolute;
    left: 26%;
    transform: translateY(-58%);
    padding: 1.875rem;
    /* 30px */
}

.back-home,
.download-app:hover {
    cursor: pointer;
}

.back-home span:last-child,
.download-app span:last-child {
    font-size: 1.125rem;
    /* 18px */
    font-weight: bold;
    color: #333;
    line-height: 1.2;
}

.separator {
    color: #666;
}

.home-icon-mb,
.download-icon-mb {
    display: none;
}

.support-menu, .support-menu-camnang {
    display: block;
}

.support-box-mb {
    display: none;
}

.support-popup {
    display: none;
}

.title,
.title-news,
.title-km {
    display: block;
}

.title-home-mb,
.title-news-mb,
.title-km-mb {
    display: none;
}

/* ===== MAIN TITLE ===== */
.main-title {
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 0.5rem;
}

.main-title h1 {
    font-size: 2.525rem;
    padding: 0rem 2.2rem;
    font-weight: bold;
    color: #00aeef;
    text-shadow: 0.0625rem 0.0625rem 0.125rem rgba(0, 0, 0, 0.2);
    /* 1px 1px 2px */
}

.divider-left,
.divider-right {
    height: 1.75rem;
    width: 26rem;
}

.divider-right {
    transform: scaleX(-1);
}

/* ===== MAIN CONTENT GRID ===== */
.action-box {
    position: relative;
    display: block;
    width: 100%;
    margin: 0 auto;
}

/* Menu xổ ra */
.support-box {
    position: relative;
}

.support-menu {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, 10px);
    width: 75%;
    max-width: 260px;
    background: #e9ffff33;
    border-radius: 26px;
    padding: 10px 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all .25s ease;
    z-index: 10;
    display: flex;
    justify-content: center;
    border: 1px solid #51FFE8;
}

.support-menu-camnang {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, 10px);
    width: 75%;
    max-width: 260px;
    background: #e9ffff33;
    border-radius: 26px;
    padding: 10px 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: block;
    transition: all .25s ease;
    z-index: 10;
    display: flex;
    justify-content: center;
    border: 1px solid #51FFE8;
}

.support-item {
    background-color: #E4FFFB;
    width: 90%;
    border-radius: 20px;
}

.support-menu ul,
.support-menu-camnang ul {
    list-style: none;
    margin: 0;
    padding: 0 20px;
}

.support-menu ul li,
.support-menu-camnang ul li {
    border-bottom: 1px solid #25C4AF;
}

.support-menu li+li,
.support-menu-camnang li+li {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.support-menu a,
.support-menu-camnang a {
    display: block;
    padding: 8px 0;
    font-size: 14px;
    text-decoration: none;
    color: #065046;
    font-weight: bold;
}

/* Hiệu ứng hover: khi hover vào khối robot thì hiện menu */
.support-box:hover .support-menu,
.support-main:hover+.support-menu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 20px);
}

.support-box:hover .support-menu-camnang,
.support-main:hover+.support-menu-camnang {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 20px);
}

.bg-img {
    width: 100%;
    height: auto;
    display: block;
}

.box-img {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 25%;
    /* chỉnh robot lên/xuống */
    width: 220px;
    /* responsive theo nền */
    min-width: 100px;
    /* không bị quá nhỏ */
}

.box-img-news {
    position: absolute;
    left: 17%;
    transform: translateX(-50%);
    bottom: 12%;
    width: 120px;
    min-width: 120px;
}

/* ===== SECTION STYLES ===== */

.section-content-news {
    background: url(./assets/img/bg-news.png);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    border-radius: 20px;
    width: 100%;
    margin: 0 auto !important;
    height: 200px;
    align-items: center;
}

.section-header {
    margin-top: 1.225rem;
    /* 50px */
}

/* Section Title Styles */
.section-title {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.section-title h2 {
    font-size: 2.225rem;
    font-weight: bold;
    color: #005d80;
    margin: 0 2rem;
    text-shadow: 0.0625rem 0.0625rem 0.125rem rgba(0, 0, 0, 0.2);
}

.title-divider-left,
.title-divider-right {
    height: 1.5rem;
    width: auto;
}

.title-divider-right {
    transform: scaleX(-1);
}

.section-content-large {}

.section-content-small {
    min-height: 6rem;
}

/* ===== BUTTON HEADERS ===== */
.button-header,
.button-header-small {
    background-position: center;
    background-size: contain;
    display: block;
    width: 100%;
    max-width: 25rem;
    /* 400px */
    min-height: 3.25rem;
    /* 52px */
    position: relative;
    z-index: 10;
}

.button-header {
    margin: -3.125rem auto 1.3125rem auto;
    /* -50px auto 21px auto */
}

.button-header-small {
    margin: -3.125rem auto 1.125rem auto;
    /* -50px auto 18px auto */
}

/* ===== GRID LAYOUTS ===== */
.action-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.action-grid-1x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    gap: 0.25rem;
    /* 12px */
    margin-top: 0.1875rem;
    /* 3px */
}

/* Button grids for different sections */
.chat-section .button-grid,
.experience-section .button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0.75rem;
}

.news-section .button-grid,
.guide-section .button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    gap: 0.75rem;
    /* 12px */
    margin-top: 0.625rem;
    /* 10px */
}

/* ===== ACTION IMAGES ===== */
.action-img {
    width: auto;
    cursor: pointer;
    transition: all 0.3s ease;
    object-fit: contain;
    margin-top: -1rem;
}

.action-img:hover {
    transform: translateY(-0.125rem);
    /* -2px */
}

/* ===== PROMOTIONAL SECTION ===== */
.promo-section {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.9375rem;
    /* 15px */
    max-width: 82vw;
    margin: 0 auto;
}

.promo-item {
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.promo-item:hover {
    transform: translateY(-0.3125rem);
    /* -5px */
}

.promo-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.promo-text {
    color: #000;
    font-size: 1.25rem;
    /* 20px */
    font-weight: bold;
    text-transform: uppercase;
}

/* ===== TABLET RESPONSIVE STYLES ===== */
/* Tablet Portrait (768px–1024px) */
@media screen and (min-width: 48.0625rem) and (max-width: 1919px) {

    /* Header */
    .header {
        margin-bottom: 2rem;
        margin-top: 1rem;
    }

    .back-home {
        left: 3%;
        padding: 0.75rem 0.75rem;
    }

    .download-app {
        right: 3%;
        padding: 0.75rem 0.75rem;
    }

    .home-icon,
    .download-icon {
        width: 2rem;
        height: 2rem;
    }

    .back-home span:last-child,
    .download-app span:last-child {
        font-size: 0.95rem;
    }

    .logo {
        height: 5.5rem;
    }

    /* Title */
    .main-title {
        margin-bottom: 1rem;
        margin-top: 4rem;
        padding-top: 0.25rem;
    }

    .main-title h1 {
        font-size: 2rem;
        padding: 0 1.25rem;
    }

    .divider-left,
    .divider-right {
        height: 1.25rem;
        width: 18rem;
        display: inline;
    }

    /* Layout */
    .main-content {
        max-width: 94vw;
        gap: 0.75rem;
    }

    .section-header {
        margin-top: 0.5rem;
    }

    .section-title {
        margin-bottom: 1.25rem;
    }

    .section-title h2 {
        font-size: 1.6rem;
        margin: 0 1rem;
    }

    .button-header,
    .button-header-small {
        max-width: 18rem;
        min-height: 3rem;
        margin: -2.5rem auto 1.25rem auto;
    }

    .section-content-small {
        padding: 0 0.5rem;
        min-height: 2.5rem;
    }

    .action-grid-2x2,
    .chat-section .button-grid,
    .experience-section .button-grid {
        gap: 0.6rem;
    }

    .news-section .button-grid,
    .guide-section .button-grid {
        gap: 0.6rem;
    }

    .action-img {
        width: 100%;
        margin-top: -0.75rem;
    }

    /* Promo */
    .promo-section {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        max-width: 96vw;
    }

    .promo-item img {
        width: 80%;
        height: auto;
        /* 170px */
    }

    .promo-text {
        font-size: 1rem;
    }
}

/* Tablet Landscape (1024px–1366px) */
@media screen and (min-width: 64.0625rem) and (max-width: 85.375rem) {
    .back-home {
        left: 12%;
        padding: 1rem;
    }

    .download-app {
        right: 12%;
        padding: 1rem;
    }

    .home-icon,
    .download-icon {
        width: 2.25rem;
        height: 2.25rem;
    }

    .back-home span:last-child,
    .download-app span:last-child {
        font-size: 1rem;
    }

    .logo {
        height: 6rem;
    }

    .main-title h1 {
        font-size: 2.25rem;
        padding: 0 1.5rem;
    }

    .divider-left,
    .divider-right {
        height: 1.5rem;
        width: 22rem;
        display: inline;
    }

    .main-content {
        max-width: 90vw;
        gap: 0.875rem;
    }

    .button-header,
    .button-header-small {
        max-width: 22rem;
        min-height: 3.125rem;
        margin: -2.75rem auto 1.25rem auto;
    }

    .section-title h2 {
        font-size: 1.8rem;
    }

    .promo-section {
        grid-template-columns: repeat(6, 1fr);
        gap: 0.75rem;
        max-width: 92vw;
    }

    .promo-item img {
        height: 12.5rem;
        /* 200px */
    }
}

/* ===== MOBILE RESPONSIVE STYLES ===== */
@media screen and (max-width: 48rem),
screen and (max-device-width: 48rem),
screen and (orientation: portrait) and (max-width: 64rem),
only screen and (min-device-width: 20rem) and (max-device-width: 48rem) {
    .support-page {
        min-height: 100vh;
        font-family: sans-serif;
    }

    .back-icon-mb {
        width: auto;
    }

    /* 320px-768px */
    /* Header */
    .support-header {
        padding: 18px 16px;
    }

    .back-btn {
        color: #ffffff;
        font-size: 18px;
        font-weight: 600;
        text-decoration: none;
    }

    /* Layout chính */
    .support-content {
        text-align: center;
        padding: 0 20px 40px;
        margin-top: 10px;
    }

    /* Robot to hơn */
    .support-robot-wrap {
        margin-top: 10px;
        margin-bottom: 10px;
        position: relative;
    }

    .support-icon {
        width: 100%;
    }

    .light-1 {
        width: 180px;
        border: 1px solid #fff;
        border-radius: 30px;
    }

    .robot-big {
        width: 150px;
        height: auto;
        position: absolute;
        left: 0;
        right: 0;
        margin: 0 auto;
    }

    /* Title lớn hơn */
    .support-heading {
        font-size: 20px;
        font-weight: 700;
        color: #fff;
        text-shadow: 0 0 6px rgba(0, 0, 0, .35);
        margin-bottom: 20px;
    }

    /* Menu rộng như UI app */
    .support-menu-page {
        margin: 0 auto;
        width: 100%;
        /* rộng 90% màn hình */
        background: #0000000d;
        border-radius: 26px;
        padding: 10px 0;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
        transition: all .25s ease;
        border: 1px solid #51FFE8;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .support-menu-page-item {
        background-color: #E4FFFB;
        width: 90%;
        border-radius: 20px;
    }

    /* List item đẹp hơn */
    .support-card {
        position: relative;
    }

    /* Khi card có class is-open -> hiện popup */
    .support-card.is-open .support-popup {
        display: flex;
    }

    .support-popup {
        position: fixed;
        inset: 0;
        z-index: 1000;
        align-items: center;
        justify-content: center;
    }

    .support-popup-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, .35);
    }

    .support-popup-inner {
        position: relative;
        z-index: 1;
        width: 88%;
        max-width: 380px;
        box-shadow: 0 8px 40px rgba(0, 0, 0, .2);
        text-align: center;
    }

    .support-popup-inner ul {
        list-style: none;
        margin: 0;
        padding: 0 26px 10px;
    }

    .support-popup-inner li+li {
        border-top: 1px solid rgba(0, 0, 0, .1);
    }

    .support-popup-inner a {
        display: block;
        padding: 12px 0;
        text-decoration: none;
        color: #008f70;
        font-weight: 700;
        font-size: 14px;
    }

    .support-popup-close {
        position: absolute;
        right: 30px;
        top: 10px;
        border: none;
        background: transparent;
        font-size: 20px;
        color: #008f70;
        font-weight: bold;
    }

    .support-menu-page ul {
        list-style: none;
        margin: 0;
        padding: 0 26px;
    }

    .support-menu-page li+li {
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }

    .support-menu-page a {
        display: block;
        padding: 14px 0;
        text-decoration: none;
        color: #007c6f;
        font-weight: 700;
        font-size: 16px;
    }

    .section-content-news {
        height: 80px;
    }

    .back-home {
        margin-top: 0.125rem;
        /* 2px */
        left: 0;
        padding: 0.375rem 0.625rem;
        /* 6px 10px */
    }

    .box-img-news {
        width: 50px;
        min-width: 50px;
    }

    .download-app {
        margin-top: 0.125rem;
        /* 2px */
        right: 0;
        padding: 0.375rem 0.625rem;
        /* 6px 10px */
    }

    .back-home span,
    .download-app span {
        text-decoration: solid;
        font-size: 0.75rem !important;
        /* 12px */
    }

    .home-icon,
    .download-icon {
        display: none;
    }

    .support-menu, .support-menu-camnang {
        display: none;
    }

    .title,
    .title-news,
    .title-km {
        display: none;
    }

    .title-home-mb,
    .title-news-mb,
    .title-km-mb {
        display: block;
        width: 100%;
    }

    /* ẩn bản PC */
    .support-box-mb {
        display: block;
    }

    /* chỉ dùng bản mobile */

    .home-icon-mb,
    .download-icon-mb {
        display: block;
    }

    .logo {
        height: 34px;
    }

    /* Main title adjustments */
    .main-title {
        margin-bottom: 0.75rem;
    }

    .main-title .title {
        width: 100%;
    }

    .divider-left,
    .divider-right {
        display: none;
    }

    /* Section adjustments */

    .button-header,
    .button-header-small {
        max-width: 12.875rem;
        /* 206px */
        min-height: 0;
        margin: -3.125rem auto 1.85rem auto;
        /* -50px auto 30px auto */
    }

    .button-header-small {
        margin: -3.125rem auto 1.9rem auto;
        /* -50px auto 30px auto */
    }

    .section-header {
        margin-top: 0;
    }

    .box-img {
        width: 90px;
    }

    .section-content-small {
        min-height: 1.875rem;
        padding: 0rem 0.5rem;
    }

    .action-img {
        width: 98%;
        margin-top: -0.5rem;
    }

    .section-title {
        margin-bottom: 1rem;
        margin-top: 1rem;
    }

    /* Section title responsive */
    .section-title h2 {
        font-size: 1.25rem;
        /* 28px */
        margin: 0 1rem;
    }

    .title-divider-left,
    .title-divider-right {
        height: 1rem;
    }

    /* Promo section */
    .promo-section {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 0 10px 20px;
        gap: 12px;
        /* khoảng cách giữa item */
        scroll-snap-type: x mandatory;
    }

    .promo-section::-webkit-scrollbar {
        height: 4px;
    }

    .promo-section::-webkit-scrollbar-track {
        background: transparent;
    }

    .promo-section::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.6);
        border-radius: 999px;
    }

    .promo-section .promo-item {
        flex: 0 0 38%;
        /* mỗi item ~40% màn hình */
        max-width: 38%;
        scroll-snap-align: start;
        margin: 0;
        /* xoá margin cũ nếu có */
        padding: 0;
    }

    .promo-section .promo-item img {
        width: 100%;
        height: auto;
        display: block;
    }

    .promo-section .promo-item p,
    .promo-section .promo-item span {
        text-align: center;
        font-size: 12px;
        margin-top: 6px;
    }

    .promo-text {
        font-family: sans-serif;
        font-size: 0.75rem;
        /* 12px */
    }
}

/* ===== FINE-TUNED RESPONSIVE BREAKPOINTS ===== */
/* Extra small devices (320px to 375px) */
@media screen and (min-width: 20rem) and (max-width: 23.4375rem) {

    /* 320px-375px */
    .button-header,
    .button-header-small {
        max-width: 11.5rem;
        /* 176px */
        margin: -3.125rem auto 1.98rem auto;
    }

    .button-header-small {
        margin: -3.125rem auto 2rem auto;
    }

    .action-img {
        width: 98%;
        margin-top: -0.5rem;
    }

    .section-title {
        margin-bottom: 1rem;
    }

    .section-title h2 {
        font-size: 1.1rem;
        margin: 0 1rem;
    }

    .promo-item img {
        width: 100%;
        height: 7.625rem;
        /* 122px */
    }

    .promo-text {
        font-size: 0.75rem;
        /* 10px */
        font-weight: bold;
    }

    .main-title h1 {
        font-size: 1.225rem;
        /* 18px */
        margin: 0;
        padding: 0;
    }
}

/* Small devices (376px to 390px) */
@media screen and (min-width: 23.5rem) and (max-width: 24.375rem) {

    /* 376px-390px */
    .button-header,
    .button-header-small {
        max-width: 12rem;
        /* 184px */
        margin: -3.125rem auto 1.92rem auto;
    }

    .section-title {
        margin-bottom: 0.8rem;
    }


    .button-header-small {
        margin: -3.125rem auto 1.92rem auto;
    }

    .action-img {
        margin-top: -0.5rem;
    }

    .section-title h2 {
        font-size: 1.175rem;
        /* 26px */
        margin: 0 0.625rem;
    }

    .promo-item img {
        width: 100%;
        height: 7.875rem;
        /* 126px */
    }

    .promo-text {
        font-size: 0.72rem;
        /* 11px */
        font-weight: 550;
    }

    .main-title h1 {
        font-size: 1.325rem;
        /* 20px */
        margin: 0;
    }
}

/* Medium devices (391px to 414px) */
@media screen and (min-width: 24.4375rem) and (max-width: 25.875rem) {

    /* 391px-414px */
    .button-header,
    .button-header-small {
        max-width: 12.875rem;
        /* 196px */
    }

    .promo-item img {
        width: 100%;
        height: 7.875rem;
        /* 126px */
    }

    .promo-text {
        font-size: 0.75rem;
        /* 11px */
        font-weight: 550;
    }

    .main-title h1 {
        font-size: 1.3125rem;
        /* 21px */
        margin: 0;
    }

    .section-title {
        margin-bottom: 1rem;
        margin-top: 1rem;
    }

    .section-title img {
        width: 100%;
    }

    .section-title h2 {
        font-size: 1.175rem;
        margin: 0 1rem;
    }
}

/* Large mobile devices (431px to 480px) */
@media screen and (min-width: 26.9375rem) and (max-width: 30rem) {

    /* 431px-480px */
    .button-header,
    .button-header-small {
        max-width: 13.4375rem;
        /* 215px */
    }

    .promo-item img {
        width: 100%;
        height: 7.875rem;
        /* 126px */
    }

    .promo-text {
        font-size: 0.6875rem;
        /* 11px */
        font-weight: bold;
    }

    .main-title h1 {
        font-size: 1.3125rem;
        /* 21px */
        margin: 0;
    }
}

.mobile-only {
    display: none;
}

.pc-only {
    display: inline;
}

@media (max-width: 768px) {
    .mobile-only {
        display: inline;
    }

    .pc-only {
        display: none;
    }
}