/* ============================================================
   XS Pro All – Plugin CSS  (v1.4)
   Chứa styles dành riêng cho các shortcode KQXS:
     [xs_pro]  [xs_home_live_3mien]  [ixoso_all_tinh_pro]
   Theme có thể override màu bằng cách đặt CSS sau file này.
   ============================================================ */


/* ----- Wrapper chung ----- */
.xs-wrap,
.xs-home-box {
    width: 100%;
    margin: 16px 0;
    border: 0 solid #e5e5e5;
    background: #fff;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}

/* ----- Header tiêu đề ----- */
.xs-header,
.xs-home-title {
    background: #ff6600;
    color: #fff;
    font-weight: 500;
    padding: 12px;
    text-align: center;
    font-size: 18px;
}

.xs-block-title {
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    background: #fff7f1;
    border-bottom: 1px solid #ffe0cc;
}

/* ----- Cột theo số tỉnh (MT / MN) ----- */
table td.txt-giai, .giai-8 td:first-child, .table-result.table-xsmn tr th.name-prize, table.table-loto thead tr th.loto-name {
    width: 14%;
}
.colgiai th.first, .firstlast-mn th.first, .colthreecity tr th.first {
    width: 10%;
}
.coltwocity th,
.coltwocity tr th {
    width: 45%;
}
.colthreecity th,
.colthreecity tr th {
    width: 30%;
}
.colfourcity th,
.colfourcity tr th {
    width: 22.5%;
}

/* ----- Bảng kết quả chính ----- */
.xs-result-main {
    padding: 0;
    overflow-x: auto;
}
.xs-result-main table {
    width: 100%;
    border-collapse: collapse;
}
.extendable td,
.extendable th {
    padding: 8px;
    text-align: center;
    vertical-align: middle;
    height: 46px;
    line-height: 46px;
}

/* ----- Số trong ô ----- */
.xs-wrap .xs-result-main table tr td.number span.xs-item,
table.table-xsmn tr td span.xs-item,
table.kqmb tr td.number span.xs-item {
    width: 25%;
    line-height: 46px;
    height: 46px;
    font-size: 24px;
}
.xs-wrap .xs-result-main table tr.g7 td.number span.xs-item {
    width: 23%;
}
.xs-item,
table.kqmt tr.giai-row td span,
table.kqmt tr.giai-row1 td span,
table.kqmn tr.giai-row td span,
table.kqmn tr.giai-row1 td span {
    display: inline-block;
    font-weight: 700;
    font-size: 24px;
    width: 100%;
}
table.kqmn tr td div,
table.kqmt tr td div,
.xs-home-main table.kqmb tr td div {
    display: block;
    margin: 0 2px;
    font-weight: 700;
    font-size: 24px;
}

/* ----- Màu Đặc Biệt / Giải 8 ----- */
.g8 td span,
.db td span,
.color_red,
table.firstlast-mb .clred,
.gdb td span.xs-item,
.giai-8 td span.xs-item,
.giai-db td span.xs-item,
.g8 td div,
.gdb td div,
td span.number_DB {
    color: #f60;
}

/* ----- Tỉnh: main result table – đồng bộ height/font/màu với 3 miền ----- */
.xs-result-main table.kqmt td,
.xs-result-main table.kqmn td {
    padding: 8px 4px;
    text-align: center;
    vertical-align: middle;
    height: 46px;
    line-height: 1.3;
}
/* Label cột giải (cột đầu tiên) */
.xs-result-main table.kqmt td:first-child,
.xs-result-main table.kqmn td:first-child {
    font-size: 13px;
    font-weight: 600;
    width: 15%;
}
/* Số giải – font lớn đậm (áp dụng cả text thường lẫn span) */
.xs-result-main table.kqmt tr.giai-row td:not(:first-child),
.xs-result-main table.kqmt tr.giai-row1 td:not(:first-child),
.xs-result-main table.kqmn tr.giai-row td:not(:first-child),
.xs-result-main table.kqmn tr.giai-row1 td:not(:first-child) {
    font-size: 22px;
    font-weight: 700;
}
/* ĐB màu cam */
.xs-result-main table.kqmt tr.giai-row1 td:not(:first-child),
.xs-result-main table.kqmn tr.giai-row1 td:not(:first-child),
.xs-result-main table.kqmt tr.giai-db td:not(:first-child),
.xs-result-main table.kqmn tr.giai-db td:not(:first-child) {
    color: #ff6600;
}
/* G8 màu cam (giải 8 tỉnh MN/MT) */
.xs-result-main table.kqmt tr.giai-8 td:not(:first-child),
.xs-result-main table.kqmn tr.giai-8 td:not(:first-child) {
    color: #ff6600;
}

/* ----- Highlight số ----- */
.hl.dozen {
    transition: all 0.18s ease;
}
.hl.dozen.xs-highlight, span.dozen.xs-highlight {
    background: #A0272E;
    color: #fff;
    border-radius: 3px;
    padding: 0 2px;
    height: 36px;
    line-height: 36px;
}

/* ----- Control (bộ lọc + số) ----- */
.xs-control {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px 12px;
    border: 1px solid #ddd;
    background: #fff7f1;
    margin-bottom: 15px;
}
.xs-radio, .xs-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}
.xs-radio label {
    cursor: pointer;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.xs-radio label input {
    margin: 0;
    width: 16px;
    height: 16px;
}

/* ----- Nút chữ số 0–9 ----- */
.xs-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border-radius: 100px;
    border: 1px solid #ffbc8f;
    background: #ffbc8f;
    cursor: pointer;
    font-weight: 700;
    user-select: none;
    transition: all 0.18s ease;
}
.xs-num:hover {
    transform: translateY(-1px);
    border-color: #A0272E;
    background: #A0272E;
    color: #fff;
}
.xs-num.is-active {
    background: #A0272E;
    color: #fff;
    border-color: #A0272E;
}

/* ----- Đầu / Đuôi (dd) — dùng grid thay flex ----- */
.xs-dd-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.xs-dd-wrap.coltwocity,
.xs-dd-wrap.colthreecity,
.xs-dd-wrap.colfourcity {
    grid-template-columns: 1fr;
}
.xs-dd {
    overflow-x: auto;
}
.xs-dd table,
.table-result {
    width: 100%;
    border-collapse: collapse;
}
.xs-dd td,
.xs-dd th,
.table-result td,
.table-result th {
    border: 1px solid #ddd;
    padding: 6px;
    text-align: center;
    height: 40px;
    line-height: 40px;
    font-weight: 600;
}

/* ----- Homepage 3 miền ----- */
.xs-home-live-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.xs-home-box {
    flex: 1;
    min-width: 280px;
}
.xs-home-main {
    overflow-x: auto;
}

/* ----- Live spinner ----- */
.xs-spin, .xs-home-main table.kqmb tr td.number span.xs-spin {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid #e3e3e3;
    border-top-color: #d40000;
    border-right-color: #ff9a1f;
    border-bottom-color: #f3f3f3;
    border-left-color: #f3f3f3;
    background: transparent;
    animation: xsSpin 0.68s linear infinite;
    vertical-align: middle;
    box-sizing: border-box;
}
@keyframes xsSpin {
    100% { transform: rotate(360deg); }
}

/* ----- Thông báo lỗi ----- */
.xsp-error {
    padding: 12px;
    border: 1px solid #f1c0c0;
    background: #fff5f5;
    color: #b42318;
    border-radius: 4px;
    margin: 8px 0;
}

/* ----- Responsive ----- */
@media (max-width: 600px) {
    .xs-home-live-wrap {
        flex-direction: column;
    }
    .xs-dd-wrap {
        grid-template-columns: 1fr;
    }
    .xs-control {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}