/* ===== VARIABLES ===== */
:root {
    --color-primary: #cf090a;
}

/* ===== GLOBAL ===== */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    box-sizing: border-box;
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: inherit;
}

/* ===== CONTAINER CHUẨN ===== */
.container,
.header-content-wrapper {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

/* ===== HEADER ===== */
.xs-header-top {
    background: #fff;
    padding: 10px 0;
}

.header-content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.xs-logo {
    color: var(--color-primary);
    font-weight: bold;
    font-size: 26px;
    text-decoration: none;
    margin-left: 15px;
    display: flex;
    align-items: center;
}

.xs-date {
    font-size: 14px;
    color: #666;
    border-left: 1px solid #ddd;
    padding-left: 20px;
    line-height: 1;
}

/* ===== NAVBAR ===== */
.xs-navbar {
    background: var(--color-primary);
    width: 100%;
    overflow: visible;
    min-height: 48px;
    position: relative;
    z-index: 100000;
}

.xs-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;       /* không xuống dòng */
    flex-direction: row;     /* luôn ngang */
}

.xs-nav-list li {
    flex: 0 0 auto;
}

.xs-nav-list li a {
    color: #fff;
    text-decoration: none;
    padding: 14px 20px;
    display: block;
    font-size: 15px;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap;
}

.xs-nav-list li a:hover {
    background: var(--color-primary);
}

/* ===== PAGE TITLE ===== */
.page-title-wrap {
    background: var(--color-primary);
    padding: 10px 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 16px rgba(29, 78, 216, 0.25);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    text-shadow: 0 1px 4px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .page-title-wrap {
        padding: 12px 14px;
    }
    .page-title {
        font-size: 1rem;
    }
}

/* ===== MAIN CONTENT ===== */
.container {
    margin: 20px auto;
    min-height: 400px;
}

/* ===== FOOTER ===== */
.xs-footer {
    background: #f4f4f4;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #ddd;
    margin-top: 30px;
}

.xs-footer-links a {
    margin: 0 10px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    font-size: 13px;
}

.xs-copyright {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

.xs-copyright strong {
    color: #2563eb;
}

/* --- PHẦN CHUNG: Cấu trúc Card và Tiện ích --- */
.xsmb-card, .xsmn-card, .xsmt-card {
    margin: 0 auto 30px auto;
    font-family: Arial, Helvetica, sans-serif;
    background: #fff;
    line-height: 1.4;
}

.xsmb-flex, .xsmn-flex, .xsmt-flex {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.xsmn-left, .xsmn-right, .xsmt-left, .xsmt-right {
    flex: 1;
    min-width: 0;
}

/* --- PHẦN CHUNG: Table và Hiển thị số --- */
.table-wrapper {
    position: relative;
    width: 100%;
    overflow-x: hidden;
}

.table-lotto {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    table-layout: auto;
}

.table-lotto td, .table-lotto th {
    border: 1px solid #d9d9d9;
    padding: 6px;
    vertical-align: middle;
    border-collapse: collapse;
    height: 40px;
    font-weight: bold;
}

.xsmb-card .n, .xsmn-card .n, .xsmt-card .n {
    display: inline-block;
}

.bg-highlight-row { background: #ffedb8; }
.bg-color-lotto-background { background: #fcfcfc; }
.color-highlight { color: #d32f2f; font-weight: bold; }

.txt-title {
    font-size: 1.25rem;
    color: #212529;
    margin: 0;
    font-weight: 700;
}


.sub-links {
    font-weight: normal;
    margin-top: 4px;
    margin-bottom: 4px;
}

.sub-links span {
    color: #0d6efd;
    text-decoration: underline;
    font-size: 1.25rem;
}

.txt-sub-title {
    font-size: 1.125rem;
}

.txt-special-prize {
    font-size: 25px;
    color: #2563eb;
    font-weight: 700;
    line-height: 1;
    font-family: Inter, sans-serif;
}

.txt-normal-prize {
    font-weight: 500;
    color: #333;
}

.view-options-bar {
    padding: 10px;
    display: flex;
    gap: 15px;
    font-size: 13px;
    flex-wrap: wrap;
    border: 1px solid #d9d9d9;
    border-top: none;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.loadmore-btn {
    text-align: center;
    margin-top: 10px;
}

#load_more_btn_mb, #load_more_btn_mn, #load_more_btn_mt {
    background-color: #1d4ed8;
    color: white;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    width: 100%;
    border: none;
    transition: background-color 0.3s, transform 0.3s;
    cursor: pointer;
}

.view-2 .n:not([data-p="1"]):not([data-p="2"]) { display: none; }
.view-3 .n:not([data-p="1"]):not([data-p="2"]):not([data-p="3"]) { display: none; }

.dd-kq {
    text-align: left !important;
    padding-left: 10px !important;
}

.txt-dau-loto {
    color: #2563eb;
    font-weight: bold;
    background: #fdfdfd;
    width: 35px;
}

@media (min-width: 992px) {
    .xsmb-flex, .xsmn-flex, .xsmt-flex {
        flex-direction: row;
        align-items: flex-start;
    }
    .xsmb-left, .xsmb-right, .xsmn-left, .xsmn-right, .xsmt-left, .xsmt-right {
        width: 50%;
    }
}

@media (max-width: 768px) {
    .xsmn-card .table-lotto td, .xsmn-card .table-lotto th,
    .xsmt-card .table-lotto td, .xsmt-card .table-lotto th {
        padding: 4px 2px;
    }

    .container,
    .header-content-wrapper {
        margin-top: 5px;
    }
}

.bg-color-lotto-background td {
    background-color: #f2f2f2;
}

.txt-normal-prize {
    font-size: 21px;
    color: #212529;
    font-weight: 700;
    line-height: 1;
    font-family: Inter, sans-serif;
}

@media (max-width: 768px) {
    .txt-title {
        font-size: 1rem;
    }

    .sub-links span {
        font-size: 1rem;
    }

    .container h1 {
        font-size: 1.1rem;
    }
}

@media (max-width: 991px) {
    .menu-btn {
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 2;
        padding: 2px 20px;
    }

    .header-container {
        display: flex;
        justify-content: space-between;
    }
}

.is-mobile {
    display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .container,
    .header-content-wrapper {
        max-width: 960px;
    }
}

@media (max-width: 992px) {
    .container,
    .header-content-wrapper {
        max-width: 720px;
    }
}

@media (max-width: 768px) {
    .container,
    .header-content-wrapper {
        max-width: 100%;
    }

    .header-content-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .xs-logo {
        font-size: 20px;
    }

    .xs-date {
        display: none;
    }

    .xs-navbar {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        display: none;
    }

    .xs-navbar::-webkit-scrollbar {
        display: none;
    }

    .xs-nav-list {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        white-space: nowrap;
    }

    .xs-nav-list::-webkit-scrollbar {
        display: none;
    }

    .xs-nav-list li a {
        white-space: nowrap;
    }

    /* Mobile nav dropdown toggle */
    .nav-bar .nav-items {
        position: relative;
        overflow: visible;
    }

    .nav-bar .nav-items.open {
        overflow: visible;
    }

    .xs-nav-list {
        overflow-y: visible !important;
        position: relative;
    }

    .nav-bar .nav-items.open > .dropdown-list {
        display: flex !important;
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 99999;
        background: #fff !important;
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
        border-radius: 10px;
        min-width: 240px;
    }

    .nav-bar .nav-items.open > .nav-links .fa-caret-down {
        transform: rotate(180deg);
    }

    .nav-bar .dropdown-list {
        display: none;
        position: absolute;
        flex-direction: column;
        width: 100%;
        min-width: unset;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        overflow: visible;
    }

    .nav-bar .dropdown-list.open {
        display: flex;
    }

    .nav-bar .dropdown-items {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-bar .dropdown-items:last-child {
        border-bottom: none;
    }

    .nav-bar .dropdown-links {
        padding: 10px 16px;
        color: #212529;
    }

    .nav-bar .dropdown-links:hover {
        background: var(--color-primary);
        color: #fff;
    }

    .sidebar-sub-list {
        display: none;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .sidebar-sub-list.open {
        display: block;
    }

    .sidebar-sub-list li a {
        display: block;
        padding: 10px 20px;
        color: #333;
        font-size: 14px;
        border-bottom: 1px solid #f0f0f0;
    }

    .sidebar-accordion-toggle {
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .sidebar-accordion-toggle .fa-caret-down {
        transition: transform 0.2s;
    }

    .sidebar-accordion.open .fa-caret-down {
        transform: rotate(180deg);
    }

    .xs-nav-list {
        display: none;
    }

    .is-mobile {
        display: inherit;
    }

    #sidebar-menu {
        position: fixed;
        top: 0;
        right: -320px;
        width: 320px;
        height: 100vh;
        background: #fff;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        transition: right 0.3s ease-in-out;
        z-index: 9999;
        overflow-y: auto;
        font-family: Arial, sans-serif;
    }

    #sidebar-menu.active {
        right: 0;
        box-shadow: 0 0 0 100vw rgba(0, 0, 0, 0.5);
    }

    #sidebar-menu a {
        text-decoration: none;
    }

    .sidebar-header {
        background: #333;
        color: #fff;
        padding: 15px;
        text-align: center;
        font-weight: bold;
        font-size: 16px;
        letter-spacing: 1px;
    }

    .menu-group {
        border-bottom: 1px solid #eee;
    }

    .group-title {
        background: #fff;
        color: #333;
        padding: 12px 15px;
        margin: 0;
        font-size: 15px;
        font-weight: 800;
        text-transform: uppercase;
    }

    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.4);
        display: none;
        z-index: 9998;
    }

    .menu-overlay.active {
        display: block;
    }

    body.menu-open {
        overflow: hidden;
    }
}

/* ===== NAV-BAR DROPDOWN ===== */
.nav-bar .nav-list {
    display: flex;
    height: 100%;
    min-height: 48px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-bar .nav-items {
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    overflow: visible;
}

.nav-bar .nav-items:hover .dropdown-list {
    display: flex;
}

.nav-bar .nav-links {
    display: flex;
    height: 100%;
    min-height: 48px;
    padding: 0 10px;
    align-items: center;
    text-decoration: none;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.nav-bar .nav-links:hover {
    background-color: rgba(0,0,0,0.2);
}

.nav-bar .nav-links .fa-caret-down {
    font-size: 11px;
    margin-left: 6px;
    transition: transform 0.2s;
}

.nav-bar .nav-items:hover .nav-links .fa-caret-down {
    transform: rotate(180deg);
}

.nav-bar .dropdown-list {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    margin: 0;
    padding: 8px;
    list-style: none;
    min-width: 280px;
    background: #fff;
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    border-radius: 10px;
    z-index: 999;
    flex-wrap: wrap;
    gap: 2px;
}

.nav-bar .dropdown-items {
    width: 100%;
}

.nav-bar .dropdown-links {
    display: block;
    padding: 9px 12px;
    text-decoration: none;
    color: #212529;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.nav-bar .dropdown-links:hover {
    background: var(--color-primary);
    color: #fff;
}

.seo-page-content {
    font-weight: 400;
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    padding: 0px 5px;
}

.seo-page-content strong {
    font-weight: 400;
}