/* =============================================
   KQXS Frontend Styles
   ============================================= */

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

.kqxs-wrap,
.kqxs-list-wrap {
    font-family: 'Be Vietnam Pro', sans-serif;
    max-width: 680px;
    margin: 20px auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(0,0,0,.12);
}

/* ---- Not Found / Error ---- */
.kqxs-not-found,
.kqxs-error {
    background: #fff8e1;
    border-left: 4px solid #f5a623;
    padding: 14px 18px;
    border-radius: 8px;
    color: #7a5c00;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 15px;
    margin: 16px 0;
}

/* =============================================
   SINGLE TABLE
   ============================================= */

/* Header */
.kqxs-header {
    background: linear-gradient(135deg, #c62828 0%, #e53935 40%, #b71c1c 100%);
    color: #fff;
    padding: 20px 24px;
}

.kqxs-region-mien_nam   .kqxs-header { background: linear-gradient(135deg, #1565c0 0%, #1976d2 40%, #0d47a1 100%); }
.kqxs-region-mien_trung .kqxs-header { background: linear-gradient(135deg, #2e7d32 0%, #388e3c 40%, #1b5e20 100%); }
.kqxs-region-mien_bac   .kqxs-header { background: linear-gradient(135deg, #c62828 0%, #e53935 40%, #b71c1c 100%); }

.kqxs-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

.kqxs-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.kqxs-logo-icon {
    font-size: 36px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}

.kqxs-region-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: .85;
    margin-bottom: 4px;
}

.kqxs-title {
    margin: 0;
    padding: 0;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.25);
}

.kqxs-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.kqxs-date-badge {
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 20px;
    padding: 5px 13px;
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.kqxs-draw-number {
    font-size: 12px;
    opacity: .8;
}

/* Table wrapper */
.kqxs-table-wrap {
    background: #fff;
}

.kqxs-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.kqxs-th-prize,
.kqxs-th-numbers {
    background: #f5f5f5;
    color: #555;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    padding: 10px 18px;
    text-align: left;
    border-bottom: 2px solid #e0e0e0;
}

.kqxs-th-numbers { text-align: center; }

/* Rows */
.kqxs-row {
    border-bottom: 1px solid #f0f0f0;
    transition: background .15s;
}
.kqxs-row:hover { background: #fafafa; }
.kqxs-row:last-child { border-bottom: none; }

/* Jackpot row */
.kqxs-row-jackpot {
    background: linear-gradient(90deg, #fff8e1 0%, #fffde7 100%);
    border-bottom: 2px solid #ffe082;
}
.kqxs-row-jackpot:hover { background: #fff3cd; }

.kqxs-prize-label {
    padding: 12px 18px;
    font-weight: 700;
    color: #444;
    white-space: nowrap;
    width: 110px;
    font-size: 14px;
}

.kqxs-db-badge {
    color: #c62828;
    font-size: 14px;
    font-weight: 800;
}

.kqxs-numbers-cell {
    padding: 10px 14px;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

/* Number chips */
.kqxs-num {
    display: inline-flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #222;
    border: 1px solid #e0e0e0;
    font-variant-numeric: tabular-nums;
}

.kqxs-num-jackpot {
    font-size: 26px;
    background: #fff;
    border: 2px solid #f5a623;
    color: #c62828;
    padding: 8px 18px;
    letter-spacing: 4px;
    box-shadow: 0 2px 10px rgba(197,100,0,.15);
}

.kqxs-num-prefix {
    color: #999;
    font-weight: 600;
    font-size: .85em;
}
.kqxs-num-suffix {
    color: #c62828;
    font-weight: 800;
}
.kqxs-num-jackpot .kqxs-num-suffix {
    font-size: 1em;
}

.kqxs-pending {
    color: #bbb;
    font-size: 20px;
}

/* Footer */
.kqxs-footer {
    background: #fafafa;
    border-top: 1px solid #eeeeee;
    padding: 12px 20px;
    font-size: 12px;
    color: #888;
    text-align: center;
}

/* =============================================
   LIST / CARDS
   ============================================= */

.kqxs-list-wrap {
    background: #fff;
    padding: 0;
    box-shadow: none;
    max-width: 100%;
}

.kqxs-list-header {
    padding: 16px 4px 12px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 16px;
}

.kqxs-list-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #222;
    font-family: 'Be Vietnam Pro', sans-serif;
}

.kqxs-list-grid {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax(200px, 1fr) );
    gap: 14px;
    padding: 0 2px 4px;
}

.kqxs-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    background: #fff;
    transition: transform .2s, box-shadow .2s;
}
.kqxs-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
}

.kqxs-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 10px;
    background: #f8f9fa;
    border-bottom: 1px solid #eeeeee;
}

.kqxs-card-emoji { font-size: 24px; line-height: 1; }

.kqxs-card-province {
    font-weight: 700;
    font-size: 14px;
    color: #222;
    line-height: 1.2;
}
.kqxs-card-date {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.kqxs-card-jackpot {
    padding: 14px;
    text-align: center;
    background: linear-gradient(135deg, #fff8e1, #fffde7);
}

.kqxs-card-jackpot-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 6px;
}

.kqxs-card-jackpot-num {
    font-size: 26px;
    font-weight: 800;
    color: #c62828;
    letter-spacing: 3px;
    font-variant-numeric: tabular-nums;
}

.kqxs-card-link {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #1565c0;
    text-decoration: none;
    border-top: 1px solid #eee;
    transition: background .15s;
}
.kqxs-card-link:hover {
    background: #e3f2fd;
    color: #0d47a1;
}

/* Responsive */
@media (max-width: 600px) {
    .kqxs-header-inner { flex-direction: column; }
    .kqxs-meta { text-align: left; align-items: flex-start; }
    .kqxs-title { font-size: 15px; }
    .kqxs-num { font-size: 15px; letter-spacing: 1px; padding: 4px 7px; }
    .kqxs-num-jackpot { font-size: 20px; letter-spacing: 2px; }
    .kqxs-prize-label { width: 85px; font-size: 12px; padding: 10px 10px; }
    .kqxs-numbers-cell { padding: 8px 8px; gap: 4px; }
}

/* Footer update time */
.kqxs-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}
.kqxs-fetched-at { color: #aaa; font-size: 11px; }

/* Pending notice */
.kqxs-pending-notice {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 15px;
    background: #fafafa;
}
