/**
 * AsiaPowerBall Pages & Modular Components Stylesheet
 */

/* Hover animations for cards and buttons */
.news-card:hover,
.stock-card:hover,
.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1) !important;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2) !important;
}

/* Single Post, Page, Archive & 404 Professional Styles */
.apb-content-wrapper {
    padding: 40px 0 80px 0;
    min-height: 75vh;
}

.apb-single-card,
.apb-page-card {
    background: #FFFFFF;
    border-radius: 22px;
    padding: 36px 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.apb-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: #8D6E63;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.apb-breadcrumb a {
    color: #E91E63;
    text-decoration: none;
    font-weight: 700;
}

.apb-breadcrumb a:hover {
    text-decoration: underline;
}

.apb-single-title {
    font-size: 30px;
    font-weight: 900;
    color: #3E2723;
    line-height: 1.35;
    margin-bottom: 16px;
}

.apb-single-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #8D6E63;
    font-size: 14px;
    padding-bottom: 20px;
    margin-bottom: 25px;
    border-bottom: 1.5px solid #F5F5F5;
    flex-wrap: wrap;
}

.apb-featured-image {
    margin-bottom: 28px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.apb-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.apb-entry-content {
    font-size: 16.5px;
    line-height: 1.8;
    color: #4E342E;
}

.apb-entry-content p {
    margin-bottom: 18px;
}

.apb-entry-content h2,
.apb-entry-content h3 {
    color: #3E2723;
    margin: 28px 0 14px 0;
}

.apb-related-section {
    margin-top: 45px;
}

.apb-related-title {
    font-size: 22px;
    font-weight: 800;
    color: #3E2723;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 404 Page */
.apb-404-box {
    max-width: 650px;
    margin: 40px auto;
    text-align: center;
    background: #FFFFFF;
    padding: 50px 35px;
    border-radius: 24px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.06);
}

.apb-404-code {
    font-size: 72px;
    font-weight: 900;
    background: linear-gradient(135deg, #FF4081, #FF8E53);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 12px;
}

.apb-404-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.apb-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.25s ease;
}

.apb-btn-primary {
    background: linear-gradient(135deg, #FF4081, #FF6B9E);
    color: #FFFFFF;
    box-shadow: 0 6px 18px rgba(255, 64, 129, 0.3);
}

.apb-btn-secondary {
    background: #F1F5F9;
    color: #334155;
}

@media (max-width: 768px) {
    .apb-single-card,
    .apb-page-card {
        padding: 24px 20px;
    }
    .apb-single-title {
        font-size: 24px;
    }
}


/* ==========================================================================
   Lottery Results Page & Interactive Ticket Checker Styles
   ========================================================================== */

.results-container {
    padding: 40px 0 80px 0;
    min-height: 80vh;
}

.results-card {
    background: #FFFFFF;
    border-radius: 25px;
    padding: 40px;
    box-shadow: var(--shadow-soft, 0 10px 30px rgba(0, 0, 0, 0.06));
    border: 2px solid #FFF;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-header h2 {
    margin: 0;
    font-size: 24px;
    color: var(--text-dark, #3E2723);
}

.stats-date-badge {
    background: #FFF9C4;
    color: #F57F17;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 800;
    border: 2px solid #FFF59D;
}

.error-box {
    text-align: center;
    padding: 50px;
    background: #FFEBEE;
    border-radius: 20px;
    border: 2px dashed #FFCDD2;
}

/* Zona Navigation Bar */
.stats-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.zone-tab {
    background: rgba(255, 255, 255, 0.85);
    padding: 10px 18px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 14px;
    color: var(--text-muted, #6D4C41);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    border: 2px solid #FFF;
    text-decoration: none;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.zone-tab.active,
.zone-tab:hover {
    background: var(--candy-pink, #FF4081);
    color: #FFF !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(255, 133, 162, 0.4);
}

/* Interactive Thai 6-Digit Ticket Checker Card */
.apb-checker-box {
    background: linear-gradient(135deg, #FFFDF9 0%, #FFF3E0 100%);
    border: 2px solid #FFE0B2;
    border-radius: 20px;
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 24px rgba(245, 124, 0, 0.08);
}

.apb-checker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.apb-checker-title {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
    color: #E65100;
    display: flex;
    align-items: center;
    gap: 8px;
}

.apb-print-btn {
    background: #FFFFFF;
    color: #3E2723;
    border: 1.5px solid #D7CCC8;
    border-radius: 30px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.apb-print-btn:hover {
    background: #3E2723;
    color: #FFFFFF;
    border-color: #3E2723;
}

.apb-checker-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.apb-checker-input {
    flex: 1 1 220px;
    padding: 13px 18px;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 4px;
    border-radius: 14px;
    border: 2px solid #FFCC80;
    background: #FFFFFF;
    color: #3E2723;
    text-align: center;
    outline: none;
    transition: border-color 0.2s ease;
}

.apb-checker-input:focus {
    border-color: #FF4081;
}

.apb-checker-select {
    flex: 1 1 200px;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 14px;
    border: 2px solid #FFCC80;
    background: #FFFFFF;
    color: #3E2723;
    outline: none;
}

.apb-checker-submit {
    padding: 13px 28px;
    font-size: 16px;
    font-weight: 900;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #FF4081 0%, #F50057 100%);
    color: #FFFFFF;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(245, 0, 87, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.apb-checker-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 0, 87, 0.36);
}

/* Main Prizes Grid */
.main-prizes-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.prize-card-1st {
    background: linear-gradient(135deg, #FFF9C4 0%, #FFECB3 100%);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    border: 3px solid #FFE082;
    box-shadow: 0 8px 25px rgba(255, 213, 79, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.prize-card-last2 {
    background: linear-gradient(135deg, #F8BBD0 0%, #F48FB1 100%);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    border: 3px solid #F06292;
    color: #FFF;
    box-shadow: 0 8px 25px rgba(240, 98, 146, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.prize-title-1st {
    font-size: 24px;
    font-weight: 900;
    color: #D84315;
    margin-bottom: 5px;
}

.prize-reward-text {
    font-size: 14px;
    font-weight: 700;
    color: #8D6E63;
    margin-bottom: 15px;
}

.prize-card-last2 .prize-reward-text {
    color: #FFEBEE;
}

.number-1st {
    font-size: 56px;
    font-weight: 900;
    color: var(--text-dark, #3E2723);
    letter-spacing: 6px;
    background: #FFF;
    border-radius: 15px;
    padding: 10px 20px;
    display: inline-block;
    margin: 0 auto;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.05);
    border: 2px solid #FFF59D;
}

.number-last2 {
    font-size: 56px;
    font-weight: 900;
    color: #C2185B;
    letter-spacing: 4px;
    background: #FFF;
    border-radius: 15px;
    padding: 10px 30px;
    display: inline-block;
    margin: 0 auto;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.05);
}

/* 3 Digits & Near 1st Grid */
.sub-prizes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.sub-prize-card {
    background: var(--bg-cream, #FFFDF9);
    border-radius: 20px;
    padding: 25px 20px;
    text-align: center;
    border: 2px solid #F3E5F5;
}

.sub-prize-title {
    font-size: 18px;
    font-weight: 900;
    color: #6A1B9A;
    margin-bottom: 5px;
}

.sub-numbers-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.number-sub {
    font-size: 32px;
    font-weight: 900;
    color: var(--text-dark, #3E2723);
    background: #FFF;
    padding: 8px 18px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid #E1BEE7;
    letter-spacing: 2px;
}

/* Other Prizes (2nd - 5th) */
.other-prize-section {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid #E3F2FD;
}

.other-prize-header {
    border-bottom: 2px dashed #BBDEFB;
    padding-bottom: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.other-prize-title {
    font-size: 20px;
    font-weight: 900;
    color: #1565C0;
    margin: 0;
}

.other-prize-reward {
    font-size: 14px;
    font-weight: 800;
    color: #1976D2;
    background: #E3F2FD;
    padding: 5px 12px;
    border-radius: 15px;
}

.numbers-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    text-align: center;
}

.numbers-grid-10 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    text-align: center;
}

.number-item {
    font-family: monospace;
    font-size: 18px;
    font-weight: 700;
    color: #37474F;
    background: #F8F9FA;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #ECEFF1;
    letter-spacing: 1px;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
    .main-prizes-grid {
        grid-template-columns: 1fr;
    }
    .sub-prizes-grid {
        grid-template-columns: 1fr;
    }
    .numbers-grid-5,
    .numbers-grid-10 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .results-card {
        padding: 20px 15px;
    }
    .numbers-grid-5,
    .numbers-grid-10 {
        grid-template-columns: repeat(2, 1fr);
    }
    .number-1st,
    .number-last2 {
        font-size: 40px;
    }
}

/* Print Lottery Sheet Mode (@media print) */
@media print {
    header,
    footer,
    .stats-nav,
    .apb-checker-box,
    .floating-ads,
    .mobile-bottom-nav,
    #wpadminbar {
        display: none !important;
    }
    body,
    .results-container,
    .results-card {
        background: #FFFFFF !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .main-prizes-grid {
        grid-template-columns: 2fr 1fr !important;
    }
    .sub-prizes-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .numbers-grid-5,
    .numbers-grid-10 {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

/* ==========================================================================
   Lottery Schedule & Calendar Page Styles (template-schedule.php)
   ========================================================================== */

.glass-page-wrap {
    padding: 40px 0 80px 0;
    min-height: 85vh;
}
.page-title-gradient {
    font-size: 36px;
    font-weight: 800;
    background: -webkit-linear-gradient(45deg, #FF4081, #E040FB);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}
.cal-tab-nav {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}
.cal-tab-btn {
    padding: 12px 26px;
    border-radius: 30px;
    border: none;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    color: #555;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.cal-tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    color: #333;
}
.cal-tab-btn.active {
    background: linear-gradient(135deg, #FF6B9E, #FF8E53);
    color: #FFF;
    box-shadow: 0 8px 25px rgba(255, 107, 158, 0.35);
}
.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease;
}
.tab-pane.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.countdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}
/* ==========================================================================
   ULTRA-REALISTIC 3D CHRONOMETER / COUNTDOWN TIMER BLOCKS
   ========================================================================== */
.countdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    perspective: 1200px;
}

.countdown-card.apb-card-3d,
.countdown-card {
    background: linear-gradient(165deg, #FFFFFF 0%, #F8FAFC 60%, #EEF2F6 100%) !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    border-radius: 22px !important;
    padding: 22px 18px !important;
    text-align: center !important;
    box-shadow: 
        0 14px 28px -6px rgba(15, 23, 42, 0.12),
        0 6px 12px -3px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 #FFFFFF,
        inset 0 -2px 0 rgba(203, 213, 225, 0.4) !important;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    position: relative;
    overflow: hidden;
}

.countdown-card:hover {
    transform: translateY(-5px) scale(1.01) !important;
    box-shadow: 
        0 22px 38px -8px rgba(15, 23, 42, 0.18),
        0 8px 16px -4px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 #FFFFFF !important;
}

.countdown-card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

.countdown-card-header h3,
.countdown-card h3 {
    font-size: 17.5px !important;
    font-weight: 900 !important;
    color: #0F172A !important;
    margin: 0 !important;
    letter-spacing: -0.3px;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}

.countdown-timer,
.countdown-timer.timer-3d {
    display: flex !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 10px !important;
    margin: 14px 0 16px 0 !important;
    perspective: 800px;
}

/* 3D Recessed Pedestal / Box */
.time-box,
.time-box.time-box-3d {
    flex: 1;
    min-width: 60px;
    max-width: 76px;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 8px 6px 7px 6px !important;
    border-radius: 16px !important;
    background: linear-gradient(180deg, #FFFFFF 0%, #F1F5F9 50%, #E2E8F0 100%) !important;
    border: 1px solid rgba(203, 213, 225, 0.9) !important;
    box-shadow: 
        0 8px 16px -3px rgba(15, 23, 42, 0.12),
        0 3px 6px -1px rgba(15, 23, 42, 0.06),
        inset 0 2px 2px rgba(255, 255, 255, 0.95),
        inset 0 -3px 3px rgba(0, 0, 0, 0.06) !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    transform-style: preserve-3d;
}

.time-box:hover {
    transform: translateY(-4px) scale(1.03) !important;
    box-shadow: 
        0 14px 22px -4px rgba(15, 23, 42, 0.18),
        0 5px 8px -2px rgba(15, 23, 42, 0.08),
        inset 0 2px 2px rgba(255, 255, 255, 1) !important;
}

/* 3D Physical Split-Flap Chronometer Plate */
.time-val,
.time-val.time-val-3d {
    position: relative !important;
    width: 100% !important;
    min-height: 54px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    font-size: 27px !important;
    font-weight: 950 !important;
    font-family: 'SF Pro Display', 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif !important;
    letter-spacing: -0.5px !important;
    line-height: 1 !important;
    color: #FFFFFF !important;
    text-shadow: 
        0 1px 1px rgba(255, 255, 255, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.3) !important;
    box-shadow: 
        0 6px 14px -2px rgba(0, 0, 0, 0.35),
        0 2px 4px -1px rgba(0, 0, 0, 0.2),
        inset 0 2px 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -3px 4px 0 rgba(0, 0, 0, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

/* 3D Specular Curved Glass Reflection (Top 50%) */
.time-val::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 50% !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.15) 100%) !important;
    border-top-left-radius: 11px !important;
    border-top-right-radius: 11px !important;
    pointer-events: none !important;
    z-index: 2 !important;
}

/* 3D Center Split Hairline Groove */
.time-val::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 0 !important;
    right: 0 !important;
    height: 1.5px !important;
    background: rgba(0, 0, 0, 0.45) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) !important;
    pointer-events: none !important;
    z-index: 2 !important;
}

/* Realistic 3D Colors */
/* Thai GLO & Japan Loto - Ruby Crimson 3D */
.time-val.pink {
    background: linear-gradient(180deg, #FF2E63 0%, #E11D48 48%, #BE123C 52%, #881337 100%) !important;
    box-shadow: 
        0 8px 18px -2px rgba(225, 29, 72, 0.5),
        0 3px 6px -1px rgba(159, 18, 57, 0.3),
        inset 0 2px 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -3px 5px 0 rgba(0, 0, 0, 0.5) !important;
}

/* Lao Pattana & US Mega Millions - Sapphire Cobalt 3D */
.time-val.blue {
    background: linear-gradient(180deg, #3B82F6 0%, #2563EB 48%, #1D4ED8 52%, #1E3A8A 100%) !important;
    box-shadow: 
        0 8px 18px -2px rgba(37, 99, 235, 0.5),
        0 3px 6px -1px rgba(30, 58, 138, 0.3),
        inset 0 2px 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -3px 5px 0 rgba(0, 0, 0, 0.5) !important;
}

/* Hanoi Normal - Amber Sunburst Gold 3D */
.time-val.gold {
    background: linear-gradient(180deg, #F59E0B 0%, #D97706 48%, #B45309 52%, #78350F 100%) !important;
    box-shadow: 
        0 8px 18px -2px rgba(217, 119, 6, 0.5),
        0 3px 6px -1px rgba(120, 53, 15, 0.3),
        inset 0 2px 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -3px 5px 0 rgba(0, 0, 0, 0.5) !important;
}

/* US Powerball - Dark Obsidian Titanium 3D */
.time-val {
    background: linear-gradient(180deg, #475569 0%, #334155 48%, #1E293B 52%, #0F172A 100%) !important;
    box-shadow: 
        0 8px 18px -2px rgba(15, 23, 42, 0.5),
        0 3px 6px -1px rgba(2, 6, 23, 0.3),
        inset 0 2px 1px 0 rgba(255, 255, 255, 0.7),
        inset 0 -3px 5px 0 rgba(0, 0, 0, 0.5) !important;
}

/* 3D Engraved Unit Label */
.time-label {
    margin-top: 7px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    color: #475569 !important;
    background: linear-gradient(180deg, #F1F5F9 0%, #E2E8F0 100%) !important;
    border-radius: 7px !important;
    padding: 3px 6px !important;
    border: 1px solid rgba(203, 213, 225, 0.9) !important;
    box-shadow: 
        inset 0 1px 1px rgba(255, 255, 255, 0.9),
        0 1px 2px rgba(0, 0, 0, 0.05) !important;
    letter-spacing: 0.3px !important;
    text-align: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
.countdown-desc {
    font-size: 12px;
    color: #888;
    margin: 0;
}
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.day-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.7);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    transition: transform 0.3s ease;
}
.day-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}
.day-card.today {
    border: 2px solid #FF5252;
    background: linear-gradient(135deg, #FFF9FA 0%, #FFF2F4 100%);
}
.day-header {
    padding: 14px;
    text-align: center;
    font-weight: 700;
    font-size: 17px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.day-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.lotto-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    text-decoration: none;
    transition: all 0.2s ease;
}
.lotto-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.lotto-flag {
    font-size: 22px;
    line-height: 1;
}
.lotto-info {
    flex-grow: 1;
}
.lotto-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}
.lotto-time {
    font-size: 11px;
    color: #888;
}
.monthly-cal-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 14px 40px rgba(255, 107, 158, 0.08);
    border: 2px solid #FFE4EE;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.cal-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.cal-nav-bar h2 {
    margin: 0;
    font-size: 24px;
    color: #263238;
    font-weight: 900;
}
.cal-nav-btn {
    padding: 8px 18px;
    border-radius: 50px;
    background: #FFF0F5;
    border: 1.5px solid #FF80AB;
    color: #D81B60;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.cal-nav-btn:hover {
    background: linear-gradient(135deg, #FF4081, #FF6B9E);
    color: #FFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(255, 64, 129, 0.3);
}
.cal-grid-wrap {
    width: 100%;
}
.cal-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    text-align: center;
    font-weight: 800;
    color: #546E7A;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px dashed #FFD6E4;
    font-size: 14px;
}
.cal-grid-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
.cal-day-cell {
    min-height: 110px;
    background: #FFFFFF;
    border-radius: 16px;
    padding: 10px;
    border: 1.5px solid #F0F0F0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: all 0.25s ease;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}
.cal-day-cell:hover {
    box-shadow: 0 8px 24px rgba(255, 107, 158, 0.12);
    transform: translateY(-3px);
    border-color: #FF80AB;
}
.cal-day-cell.empty {
    background: rgba(0,0,0,0.015);
    border: 1px dashed #EEE;
}
.cal-day-cell.today {
    border: 2px solid #FF4081;
    background: linear-gradient(145deg, #FFF0F5 0%, #FFFFFF 100%);
    box-shadow: 0 6px 18px rgba(255, 64, 129, 0.15);
}
.cal-day-cell.special-thai {
    border: 2px solid #FFA000;
    background: linear-gradient(145deg, #FFFDF0 0%, #FFFFFF 100%);
    box-shadow: 0 6px 18px rgba(255, 160, 0, 0.15);
}
.cal-date-num {
    font-size: 16px;
    font-weight: 900;
    color: #37474F;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cal-tag-today {
    font-size: 9px;
    background: linear-gradient(135deg, #FF4081, #FF6B9E);
    color: #FFF;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 800;
}
.cal-tag-thai {
    font-size: 9px;
    background: linear-gradient(135deg, #FFA000, #FFB300);
    color: #FFF;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 800;
}
.cal-badge-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
    width: 100%;
}
.cal-mini-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 800;
    padding: 4px 6px;
    border-radius: 7px;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
    line-height: 1.2;
    transition: transform 0.15s ease;
}
.cal-mini-badge:hover {
    transform: translateX(2px);
}
.cal-mini-badge.thai { background: #FFE082; color: #E65100; border: 1px solid #FFD54F; font-weight: 900; }
.cal-mini-badge.lao { background: #E0F2F1; color: #004D40; font-weight: 800; border: 1px solid #B2DFDB; }
.cal-mini-badge.vn { background: #E8F5E9; color: #1B5E20; font-weight: 800; border: 1px solid #C8E6C9; }
.cal-mini-badge.us { background: #FFEBEE; color: #C62828; font-weight: 800; border: 1px solid #FFCDD2; }
.cal-mini-badge.eu { background: #EDE7F6; color: #4527A0; font-weight: 800; border: 1px solid #D1C4E9; }
.cal-mini-badge.asia { background: #FCE4EC; color: #C2185B; font-weight: 800; border: 1px solid #F8BBD0; }
.cal-mini-badge.sea { background: #FFF8E1; color: #F57F17; font-weight: 800; border: 1px solid #FFECB3; }
.cal-mini-badge.bank { background: #FCE7F3; color: #9D174D; border: 1px solid #FBCFE8; font-weight: 800; }
.cal-mini-badge.baac { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; font-weight: 800; }
.cal-mini-badge.my { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; font-weight: 800; }
.cal-mini-badge.stock { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; font-weight: 800; }

/* Countdown Category Filter Buttons */
.countdown-cat-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}
.cd-filter-btn {
    padding: 7px 16px;
    border-radius: 20px;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    user-select: none;
}
.cd-filter-btn:hover {
    background: #F1F5F9;
    border-color: #94A3B8;
    color: #0F172A;
    transform: translateY(-1px);
}
.cd-filter-btn.active {
    background: linear-gradient(135deg, #FF1744 0%, #D50000 100%) !important;
    color: #FFFFFF !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(255, 23, 68, 0.35) !important;
    font-weight: 800;
}
.countdown-card.cat-hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .glass-page-wrap {
        padding: 20px 0 60px 0;
    }
    .page-title-gradient {
        font-size: 24px;
    }
    .page-subtitle {
        font-size: 13px !important;
    }
    .cal-tab-nav {
        gap: 6px;
        margin-bottom: 20px;
    }
    .cal-tab-btn {
        padding: 8px 14px;
        font-size: 12px;
        border-radius: 20px;
    }
    .countdown-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .countdown-card {
        padding: 12px 8px !important;
        border-radius: 14px !important;
    }
    .countdown-card h3 {
        font-size: 13.5px !important;
        margin: 0 0 8px 0 !important;
    }
    .countdown-timer {
        gap: 4px !important;
        margin-bottom: 6px !important;
    }
    .time-val {
        width: 34px !important;
        height: 34px !important;
        font-size: 15px !important;
        border-radius: 8px !important;
    }
    .time-label {
        font-size: 9px !important;
        margin-top: 2px !important;
    }
    .countdown-desc {
        font-size: 10px !important;
        line-height: 1.25 !important;
    }
    .schedule-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .day-card {
        border-radius: 14px !important;
    }
    .day-header {
        padding: 10px !important;
        font-size: 14px !important;
    }
    .day-body {
        padding: 10px !important;
        gap: 6px !important;
    }
    .lotto-item {
        padding: 6px 8px !important;
        border-radius: 8px !important;
    }
    .lotto-name {
        font-size: 12px !important;
    }
    .lotto-time {
        font-size: 10px !important;
    }
    .lotto-flag {
        font-size: 16px !important;
    }
}

/* ==========================================================================
   Frontend Dark Mode & Header Theme Toggle Button
   ========================================================================== */

.apb-theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid #FFE4EE;
    background: #FFF0F5;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.25s ease;
    box-shadow: 0 3px 10px rgba(255, 64, 129, 0.12);
}

.apb-theme-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 14px rgba(255, 64, 129, 0.22);
}

body.apb-dark-mode {
    --bg: #0F172A;
    --bg-cream: #0F172A;
    --white: #1E293B;
    --text: #F8FAFC;
    --text-dark: #F8FAFC;
    --text-muted: #94A3B8;
    background: #0F172A !important;
    color: #F8FAFC !important;
}

body.apb-dark-mode .site-header,
body.apb-dark-mode .results-card,
body.apb-dark-mode .glass-card,
body.apb-dark-mode .apb-single-card,
body.apb-dark-mode .apb-page-card,
body.apb-dark-mode .stats-card,
body.apb-dark-mode .stats-chart-section,
body.apb-dark-mode .stats-table-section,
body.apb-dark-mode .monthly-cal-container,
body.apb-dark-mode .countdown-card,
body.apb-dark-mode .day-card {
    background: #1E293B !important;
    border-color: #334155 !important;
    color: #F8FAFC !important;
}

body.apb-dark-mode h1,
body.apb-dark-mode h2,
body.apb-dark-mode h3,
body.apb-dark-mode .results-header h2,
body.apb-dark-mode .apb-single-title {
    color: #F8FAFC !important;
}

body.apb-dark-mode .apb-checker-box {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%) !important;
    border-color: #475569 !important;
}

body.apb-dark-mode .zone-tab:not(.active) {
    background: #1E293B;
    color: #CBD5E1;
    border-color: #334155;
}

body.apb-dark-mode .apb-theme-toggle {
    background: #334155;
    border-color: #475569;
}

body.apb-dark-mode .cd-filter-btn:not(.active) {
    background: #1E293B;
    border-color: #334155;
    color: #CBD5E1;
}
body.apb-dark-mode .cd-filter-btn:not(.active):hover {
    background: #334155;
    color: #F8FAFC;
}

/* News & Stock Hub Styling */
.news-ticker-wrap {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #FFF1F2 0%, #FFE4E6 100%);
    border: 1px solid #FECDD3;
    border-radius: 30px;
    padding: 6px 14px;
    margin-bottom: 25px;
    overflow: hidden;
    font-size: 13.5px;
    gap: 10px;
}
.news-ticker-badge {
    background: #E11D48;
    color: #FFF;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.news-ticker-text {
    color: #9F1239;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.news-filter-btn {
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13.5px;
    text-decoration: none;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: #475569;
}
.news-filter-btn:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
    transform: translateY(-1px);
}
.news-filter-btn.active {
    background: linear-gradient(135deg, #8E24AA 0%, #6A1B9A 100%);
    color: #FFFFFF !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(142, 36, 170, 0.35);
}
.news-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 13px;
    transition: transform 0.2s ease;
}
.news-share-btn:hover {
    transform: scale(1.15);
}
.market-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
}
.market-status-badge.open {
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #BBF7D0;
}
.market-status-badge.closed {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}
.market-pulse {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22C55E;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: pulse-green 1.8s infinite;
}
@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

body.apb-dark-mode .news-ticker-wrap {
    background: #1E293B;
    border-color: #334155;
}
body.apb-dark-mode .news-ticker-text {
    color: #FDA4AF;
}
body.apb-dark-mode .news-filter-btn:not(.active) {
    background: #1E293B;
    border-color: #334155;
    color: #CBD5E1;
}

/* ==========================================================================
   Interactive World Lottery Historical Draws (Modal & Archive Tab UX/UI)
   ========================================================================== */
@keyframes apbFadeIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.apb-open-history-btn:hover {
    text-decoration: underline;
    opacity: 0.85;
}

.apb-hist-table tr:hover {
    background: #F1F5F9 !important;
}

body.apb-dark-mode #apb-history-modal > div {
    background: #0F172A !important;
    border-color: #334155 !important;
}

body.apb-dark-mode #apb-history-modal .apb-hist-table {
    color: #F8FAFC !important;
}

body.apb-dark-mode #apb-history-modal thead tr {
    background: #1E293B !important;
    color: #E2E8F0 !important;
    border-bottom-color: #334155 !important;
}

body.apb-dark-mode #apb-history-modal tbody tr {
    background: #0F172A !important;
    border-bottom-color: #1E293B !important;
}

body.apb-dark-mode #apb-history-modal tbody tr:hover {
    background: #1E293B !important;
}

body.apb-dark-mode #apb-history-modal tbody td {
    color: #F1F5F9 !important;
}

body.apb-dark-mode #apb-modal-footer-stats {
    background: #1E1B4B !important;
    border-top-color: #311042 !important;
    color: #FDE047 !important;
}

body.apb-dark-mode #apb-archive-content-wrap {
    background: #0F172A !important;
    border-color: #334155 !important;
}

body.apb-dark-mode #apb-archive-results-box .apb-hist-table thead tr {
    background: #1E293B !important;
    color: #E2E8F0 !important;
}

body.apb-dark-mode #apb-archive-results-box .apb-hist-table tbody tr {
    background: #0F172A !important;
    border-bottom-color: #1E293B !important;
}

body.apb-dark-mode #apb-archive-results-box .apb-hist-table tbody tr:hover {
    background: #1E293B !important;
}
