/* =============================================
   KQXS Page Layout — shortcode [kqxs_page]
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&display=swap');

/* ---- Reset trong scope ---- */
.kqxs-page-wrap *,
.kqxs-page-wrap *::before,
.kqxs-page-wrap *::after { box-sizing: border-box; }

.kqxs-page-wrap {
    font-family: 'Be Vietnam Pro', sans-serif;
    color: #222;
    margin: 0 0 40px;
}

/* ---- Date Bar ---- */
.kqxs-datebar {
    background: linear-gradient(90deg, #1a237e 0%, #283593 50%, #1565c0 100%);
    border-radius: 12px;
    margin-bottom: 20px;
    padding: 14px 20px;
    box-shadow: 0 4px 20px rgba(21,65,192,.25);
}

.kqxs-datebar-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.kqxs-datebar-icon { font-size: 20px; }

.kqxs-datebar-label {
    color: rgba(255,255,255,.8);
    font-size: 14px;
    font-weight: 500;
}

.kqxs-datebar-date {
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .5px;
}

#kqxs-date-picker {
    margin-left: auto;
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 8px;
    background: rgba(255,255,255,.15);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: background .2s;
    color-scheme: dark;
}
#kqxs-date-picker:hover { background: rgba(255,255,255,.25); }

/* ---- Layout 2 cột ---- */
.kqxs-page-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    align-items: start;
}

/* =============================================
   CỘT TRÁI — Kết quả
   ============================================= */

.kqxs-col-main {}

.kqxs-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 3px solid #e53935;
}

.kqxs-col-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    font-size: 20px;
    font-weight: 800;
    color: #1a1a1a;
    border: none;
}

.kqxs-col-title-icon { font-size: 22px; }

.kqxs-col-meta {
    font-size: 13px;
    color: #888;
    background: #f5f5f5;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* Bảng kết quả trong trang — override max-width */
.kqxs-page-wrap .kqxs-wrap.kqxs-page-item {
    max-width: 100%;
    margin: 0 0 24px;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,.08);
    transition: transform .2s, box-shadow .2s;
}

.kqxs-page-wrap .kqxs-wrap.kqxs-page-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,.12);
}

/* Title trong page nhỏ hơn */
.kqxs-page-wrap .kqxs-title { font-size: 15px; }
.kqxs-page-wrap .kqxs-logo-icon { font-size: 28px; }

/* Link title */
.kqxs-title-link {
    color: inherit !important;
    text-decoration: none !important;
}
.kqxs-title-link:hover { text-decoration: underline !important; }

/* Footer link */
.kqxs-detail-link {
    color: #1565c0;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: color .15s;
}
.kqxs-detail-link:hover { color: #0d47a1; text-decoration: underline; }

/* Empty state */
.kqxs-empty {
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
    font-size: 15px;
}
.kqxs-empty span { font-size: 40px; display: block; margin-bottom: 12px; }

/* Loading skeleton */
.kqxs-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: kqxs-shimmer 1.2s infinite;
    border-radius: 8px;
    height: 120px;
    margin-bottom: 20px;
}
@keyframes kqxs-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Load more */
.kqxs-btn-more {
    background: #fff;
    border: 2px solid #e53935;
    color: #e53935;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 28px;
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s;
}
.kqxs-btn-more:hover {
    background: #e53935;
    color: #fff;
}

/* =============================================
   CỘT PHẢI — Sidebar chọn đài
   ============================================= */

.kqxs-col-sidebar {}

.kqxs-sidebar-sticky {
    position: sticky;
    top: 80px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0,0,0,.07);
}

/* Search box */
.kqxs-sidebar-search {
    padding: 14px 14px 10px;
    border-bottom: 1px solid #f0f0f0;
}

#kqxs-search-dai {
    width: 100%;
    padding: 9px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    color: #333;
    outline: none;
    transition: border-color .2s;
    background: #fafafa;
}
#kqxs-search-dai:focus {
    border-color: #1565c0;
    background: #fff;
}

/* Miền header */
.kqxs-sidebar-region {
    border-bottom: 1px solid #f0f0f0;
}
.kqxs-sidebar-region:last-of-type { border-bottom: none; }

.kqxs-sidebar-region-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #555;
    cursor: pointer;
    user-select: none;
    transition: background .15s;
}
.kqxs-sidebar-region-header:hover { background: #fafafa; }

.kqxs-chevron {
    font-size: 10px;
    transition: transform .25s;
    color: #aaa;
}
.kqxs-sidebar-region.collapsed .kqxs-chevron {
    transform: rotate(-90deg);
}
.kqxs-sidebar-region.collapsed .kqxs-sidebar-region-body {
    display: none;
}

.kqxs-sidebar-region-body {
    padding: 4px 8px 10px;
}

/* Nút đài */
.kqxs-dai-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 7px 10px;
    margin-bottom: 3px;
    background: none;
    border: 1px solid transparent;
    border-radius: 7px;
    font-family: inherit;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    text-align: left;
    transition: all .15s;
}
.kqxs-dai-btn:hover {
    background: #f0f7ff;
    border-color: #bbdefb;
    color: #1565c0;
}
.kqxs-dai-btn.active {
    background: #e3f2fd;
    border-color: #1565c0;
    color: #0d47a1;
    font-weight: 700;
}

.kqxs-dai-name { flex: 1; }

.kqxs-dai-count {
    background: #e0e0e0;
    color: #666;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
    transition: all .15s;
}
.kqxs-dai-btn.active .kqxs-dai-count {
    background: #1565c0;
    color: #fff;
}

/* Nút quay lại */
.kqxs-btn-latest {
    display: block;
    width: calc(100% - 28px);
    margin: 10px 14px 14px;
    padding: 10px;
    background: #fff3e0;
    border: 1.5px solid #fb8c00;
    border-radius: 8px;
    color: #e65100;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
}
.kqxs-btn-latest:hover {
    background: #fb8c00;
    color: #fff;
}

/* =============================================
   Loading overlay
   ============================================= */

.kqxs-col-loading {
    position: relative;
    min-height: 200px;
}
.kqxs-col-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    backdrop-filter: blur(2px);
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 900px) {
    .kqxs-page-layout {
        grid-template-columns: 1fr;
    }
    .kqxs-col-sidebar {
        order: -1; /* Sidebar lên trước trên mobile */
    }
    .kqxs-sidebar-sticky {
        position: static;
    }
    /* Thu gọn miền trên mobile */
    .kqxs-sidebar-region.collapsed .kqxs-sidebar-region-body { display: none; }
}

@media (max-width: 600px) {
    .kqxs-datebar { padding: 12px 14px; }
    .kqxs-col-header { flex-direction: column; align-items: flex-start; gap: 6px; }
    .kqxs-page-wrap .kqxs-results-table { font-size: 13px; }
    .kqxs-page-wrap .kqxs-num { font-size: 14px; padding: 3px 6px; }
    .kqxs-page-wrap .kqxs-num-jackpot { font-size: 18px; }
}
