/* --- Global Variables & Reset --- */
:root {
    --logo-blue-dark: #0A1F44;
    --logo-blue-bright: #007BFF;
    --logo-cyan: #00D2FF;
    
    --bg-dark: #070B19;
    --bg-card: #0F172A;
    --bg-card-hover: #1E293B;
    --text-light: #F3F4F6;
    --text-muted: #94A3B8;
    --green-live: #10B981;
    --border-color: #1E293B;
    --font-main: 'Poppins', sans-serif;
    
    /* NEW: Table Specific Colors for Readability */
    --table-header-bg: #0A1F44;
    --table-body-bg: #1A2336;
    --table-row-hover: #253049;
    --table-date-bg: #0F2A4A;
    --table-border: #2D3748;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-main); background-color: var(--bg-dark); color: var(--text-light); line-height: 1.6; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* --- Reveal Animation --- */
.reveal { opacity: 0; transform: translateY(40px); transition: all 0.8s cubic-bezier(0.5, 0, 0, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }

/* --- Top Bar --- */
.top-bar {
    background-color: #04070E;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.top-bar-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* LIVE */
.live-badge {
    flex: 0 0 auto;
    background-color: #EF4444;
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

/* --- Marquee --- */
.top-marquee {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.marquee-track {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 18s linear infinite;
}

.marquee-track span {
    color: #ffffff;
    font-weight: 500;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Time & Date */
.time-date {
    flex: 0 0 auto;
    white-space: nowrap;
    color: var(--text-muted);
}

.separator {
    margin: 0 5px;
}

@media (max-width: 768px) {

    .top-bar {
        padding: 6px 0;
    }

    .top-bar-content {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 10px;
    }

    /* First row */
    .live-badge {
        flex: 0 0 auto;
        padding: 3px 8px;
        font-size: 0.7rem;
    }

    .time-date {
        flex: 1;
        text-align: right;
        white-space: nowrap;
        font-size: 0.7rem;
    }

    /* Second row */
    .top-marquee {
        order: 3;
        flex: 0 0 100%;
        width: 100%;
        min-width: 100%;
        height: 22px;
        overflow: hidden;
        /*background: rgba(255, 255, 255, 0.03);*/
        border-radius: 3px;
    }

    .marquee-track {
        display: inline-block;
        white-space: nowrap;
        padding-left: 100%;
        animation: marquee 14s linear infinite;
    }

    .marquee-track span {
        font-size: 0.75rem;
        line-height: 22px;
    }
}

/* --- Header --- */
header { background-color: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px); padding: 15px 0; border-bottom: 2px solid var(--logo-cyan); position: sticky; top: 0; z-index: 100; box-shadow: 0 4px 20px rgba(0, 210, 255, 0.1); }
.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo img { display: block; max-height: 50px; }
nav { display: flex; gap: 5px; align-items: center; }
nav .btn { padding: 8px 16px; border-radius: 6px; font-weight: 500; font-size: 0.9rem; transition: all 0.3s ease; border: 1px solid transparent; color: var(--text-muted); background: none; cursor: pointer; font-family: inherit; }
nav .btn:hover { color: var(--logo-cyan); background-color: rgba(0, 210, 255, 0.05); }
nav .btn.active { background: linear-gradient(90deg, var(--logo-blue-bright), var(--logo-cyan)); color: #FFF; font-weight: 600; }
.dropdown { position: relative; display: inline-block; }
.dropdown .dropbtn { display: flex; align-items: center; gap: 5px; }
.dropdown-content { display: none; position: absolute; background-color: var(--bg-card); min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5); z-index: 1; border: 1px solid var(--border-color); border-radius: 6px; top: 100%; left: 0; overflow: hidden; }
.dropdown-content a { color: var(--text-muted); padding: 12px 16px; display: block; font-size: 0.9rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.dropdown-content a:hover { background-color: var(--bg-card-hover); color: var(--logo-cyan); }
.dropdown:hover .dropdown-content { display: block; }
.menu-toggle { display: none; flex-direction: column; cursor: pointer; gap: 5px; }
.menu-toggle .bar { width: 25px; height: 3px; background-color: var(--logo-cyan); border-radius: 3px; transition: 0.3s; }

/* --- Hero --- */
.hero { background: linear-gradient(135deg, #070B19 0%, #0A1F44 100%); padding: 16px 0; text-align: center; border-bottom: 1px solid var(--border-color); position: relative; overflow: hidden; }
.hero h1 { font-size: 2.8rem; font-weight: 800; color: #FFF; margin-bottom: 10px; text-shadow: 0 0 20px rgba(0, 210, 255, 0.5); }
.hero .sub-text { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 25px; }
.date-badge { display: inline-block; background-color: rgba(0, 210, 255, 0.1); color: var(--logo-cyan); padding: 8px 20px; border-radius: 30px; font-size: 0.9rem; font-weight: 500; border: 1px solid rgba(0, 210, 255, 0.3); margin-bottom: 30px; }
.stats-row { display: flex; justify-content: center; gap: 50px; margin-top: 20px; }
.stat-box h2 { font-size: 2.5rem; color: var(--logo-cyan); font-weight: 700; }
.stat-box p { font-size: 0.8rem; color: var(--text-muted); letter-spacing: 1px; }

/* --- Section Title --- */
.section-padding { padding: 15px 0; }
.section-title { margin-bottom: 20px; border-left: 4px solid var(--logo-cyan); padding-left: 15px; }
.section-title h2 { font-size: 1.4rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }

/* --- Today's Result Grid --- */
.result-card { background-color: var(--bg-card); border-radius: 12px; overflow: hidden; border: 1px solid var(--border-color); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.glow-border { position: relative; }
.glow-border::before { content: ''; position: absolute; top: -2px; left: -2px; right: -2px; bottom: -2px; background: linear-gradient(45deg, var(--logo-cyan), var(--logo-blue-bright), var(--logo-cyan)); z-index: -1; border-radius: 14px; background-size: 400% 400%; animation: gradientMove 4s ease infinite; opacity: 0.6; }
@keyframes gradientMove { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.card-header { background: linear-gradient(90deg, var(--logo-blue-dark), var(--logo-blue-bright)); color: #FFF; padding: 15px 20px; font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.result-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; padding: 25px; }
.game-box { background-color: var(--bg-dark); border-radius: 8px; padding: 15px 5px; text-align: center; border: 1px solid var(--border-color); transition: all 0.3s ease; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.game-box:hover { border-color: var(--logo-cyan); box-shadow: 0 0 15px rgba(0, 210, 255, 0.3); transform: translateY(-5px); }
.game-name { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; margin-bottom: 5px; text-transform: uppercase; }
.game-number { font-size: 1.6rem; font-weight: 700; color: var(--logo-cyan); margin-bottom: 2px; }
.game-single { font-size: 1rem; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; }
.game-number.disabled, .game-single.disabled { color: #374151; font-weight: 400; }
.live-num { color: var(--green-live) !important; animation: livePulse 1.5s infinite alternate; }
@keyframes livePulse { 0% { text-shadow: 0 0 5px rgba(16, 185, 129, 0.5); } 100% { text-shadow: 0 0 20px rgba(16, 185, 129, 1); } }
.game-status { font-size: 0.65rem; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: auto; }
.game-status.live { color: var(--green-live); }
.game-status.upcoming { color: var(--text-muted); }
.timer-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 25px; background-color: rgba(0, 0, 0, 0.3); border-top: 1px solid var(--border-color); flex-wrap: wrap; gap: 15px; }
.timer-text { font-weight: 600; color: var(--logo-cyan); font-size: 1rem; display: flex; align-items: center; gap: 10px; }
#timer-display { font-family: monospace; font-size: 1.2rem; color: #FFF; background: rgba(0,0,0,0.5); padding: 2px 10px; border-radius: 5px; }
.pagination-dots { display: flex; gap: 8px; }
.pagination-dots span { width: 10px; height: 10px; border-radius: 50%; background-color: #374151; display: inline-block; cursor: pointer; }
.pagination-dots .completed { background-color: var(--logo-cyan); box-shadow: 0 0 10px var(--logo-cyan); }
.refresh-btn {
    background: linear-gradient(90deg, var(--logo-blue-dark), var(--logo-blue-bright));
    color: #FFF;
    border: none;
    padding: 18px 63px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    transition: all 0.3s;
    font-size: 20px;
}
.refresh-btn:hover { background: linear-gradient(90deg, var(--logo-blue-bright), var(--logo-cyan)); }

/* =========================================
   RESULT TABLE (CHART) STYLES - UPDATED FOR READABILITY
   ========================================= */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--table-border);
    background-color: var(--table-body-bg); /* Lighter background for the whole table body */
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

/* Header Styling */
.result-table th {
    background-color: var(--table-header-bg); /* Deep blue header */
    color: var(--logo-cyan);
    padding: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid var(--table-border);
    border-right: 1px solid var(--table-border);
}

.result-table th.date-header {
    text-align: left;
    padding-left: 20px;
    width: 100px;
    color: var(--logo-cyan);
}

/* Cell Styling */
.result-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid var(--table-border);
    border-right: 1px solid var(--table-border);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-light);
}

.result-table tr:last-child td { border-bottom: none; }
.result-table td:last-child, .result-table th:last-child { border-right: none; }

/* Date Cell Styling - Distinct Color */
.date-cell {
    background-color: var(--table-date-bg) !important; /* Dark Teal/Navy */
    color: #FFF !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    vertical-align: middle;
    letter-spacing: 1px;
    width: 100px;
    border-right: 2px solid var(--table-border) !important; /* Stronger divider */
}

/* Top Number Row */
.num-cell {
    color: #FFFFFF; /* Pure white for maximum contrast */
    font-size: 1.1rem;
    padding-bottom: 2px;
}

/* Bottom Single Digit Row */
.single-cell {
    color: var(--text-muted); /* Softer color so it doesn't compete with the main number */
    font-size: 0.85rem;
    font-weight: 500;
    padding-top: 0;
    border-bottom: 1px solid var(--table-border) !important;
}

/* Row Hover Effect - VERY IMPORTANT for tracking rows */
.result-table tbody tr:hover td {
    background-color: var(--table-row-hover);
    transition: background-color 0.2s ease;
}

/* Remove default alternating borders to allow hover to work */
.result-table tbody tr:nth-child(odd) td { border-bottom: none; }
.result-table tbody tr:nth-child(even) td { border-bottom: 1px solid var(--table-border); }

/* Disabled/Empty state */
.num-cell.disabled, .single-cell.disabled {
    color: #4B5563 !important;
    font-weight: 400;
}

/* --- Pagination --- */
.pagination-controls { display: flex; justify-content: center; gap: 8px; margin-top: 25px; flex-wrap: wrap; }
.btn-page { background-color: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-light); padding: 8px 16px; border-radius: 6px; cursor: pointer; font-family: inherit; transition: all 0.2s; }
.btn-page:hover { background-color: var(--bg-card-hover); border-color: var(--logo-cyan); }
.btn-page.active { background: linear-gradient(90deg, var(--logo-blue-bright), var(--logo-cyan)); color: #FFF; border-color: transparent; font-weight: 700; }

/* --- Content Section --- */
.content-section { background-color: var(--bg-card); border-radius: 12px; padding: 40px; border: 1px solid var(--border-color); margin-bottom: 40px; }
.content-section h2 { color: var(--logo-cyan); margin-bottom: 20px; font-size: 1.6rem; }
.content-section h3 { color: var(--logo-blue-bright); margin-top: 30px; margin-bottom: 15px; font-size: 1.2rem; }
.content-section p { color: var(--text-muted); margin-bottom: 15px; font-size: 0.95rem; }
.content-section a { color: var(--logo-cyan); text-decoration: underline; }
.content-section ul { margin-bottom: 20px; padding-left: 20px; }
.content-section ul li { color: var(--text-muted); margin-bottom: 8px; font-size: 0.95rem; position: relative; }
.content-section ul li::before { content: "▸"; color: var(--logo-cyan); position: absolute; left: -15px; }
.faq-item { background-color: var(--bg-dark); padding: 20px; border-radius: 8px; margin-bottom: 15px; border: 1px solid var(--border-color); }
.faq-item h4 { color: var(--logo-cyan); font-size: 1.05rem; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.faq-item p { margin-bottom: 0; color: var(--text-muted); font-size: 0.9rem; padding-left: 30px; }

/* --- Footer --- */
footer { background-color: #04070E; border-top: 2px solid var(--logo-cyan); padding: 50px 0 20px; margin-top: 20px; }
.footer-content { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 30px; margin-bottom: 40px; }
.footer-col h3 { color: var(--logo-cyan); margin-bottom: 20px; font-size: 1.1rem; }
.footer-col p { color: var(--text-muted); font-size: 0.9rem; margin: 15px 0; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { color: var(--text-muted); font-size: 0.9rem; }
.footer-col ul li a:hover { color: var(--logo-cyan); }
.social-icons { display: flex; gap: 12px; }
.social-icons a { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; background-color: var(--bg-card); border-radius: 50%; color: var(--text-muted); transition: all 0.3s; }
.social-icons a:hover { background: var(--logo-cyan); color: #000; }
.schedule-list li { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 0.85rem; }
.schedule-list li i { color: var(--logo-cyan); font-size: 0.8rem; }
.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid var(--border-color); font-size: 0.8rem; color: var(--text-muted); }

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */

@media (max-width: 992px) {
    .hero h1 { font-size: 2.2rem; }
    .result-grid { grid-template-columns: repeat(4, 1fr); }
    .footer-content { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    /* Mobile Navigation */
    .menu-toggle { display: flex; }
    nav { display: none; flex-direction: column; width: 100%; position: absolute; top: 100%; left: 0; background-color: var(--bg-card); padding: 20px; border-bottom: 2px solid var(--logo-cyan); z-index: 99; }
    nav.active { display: flex; }
    nav .btn { width: 100%; text-align: center; padding: 12px; }
    .dropdown { width: 100%; }
    .dropdown .dropbtn { width: 100%; justify-content: center; }
    .dropdown-content { position: static; width: 100%; box-shadow: none; border: none; background: rgba(0,0,0,0.2); }
    
    /* Hero & General Adjustments */
    .hero h1 { font-size: 1.6rem; }
    .hero .sub-text { font-size: 0.85rem; }
    .stats-row { flex-direction: column; gap: 15px; }
    .result-grid { grid-template-columns: repeat(4, 1fr); padding: 15px; gap: 8px; }
    .game-box { padding: 10px 2px; }
    .game-name { font-size: 0.6rem; }
    .game-number { font-size: 1.1rem; }
    .game-single { font-size: 20px; }
    .game-status { font-size: 0.55rem; }
    .timer-row { flex-direction: column; text-align: center; padding: 15px; }
    .content-section { padding: 20px; }
    .footer-content { grid-template-columns: 1fr; text-align: center; }
    .social-icons { justify-content: center; }
    .schedule-list li { justify-content: center; }

    /* PERFECT FIT MOBILE TABLE (No Scroll) */
    .table-responsive { 
        overflow-x: hidden; 
        border: none; 
        /*background: transparent;*/
    }

    .result-table { 
        min-width: 100% !important;
        width: 100%;
        table-layout: fixed;
        border: 1px solid var(--table-border);
        border-radius: 4px;
        overflow: hidden;
    }

    /* Compact headers */
    .result-table th { 
        padding: 6px 0; 
        font-size: 0.6rem; 
        border-right: 1px solid var(--table-border);
    }
    
    /* Hide the "Date" header text on mobile to save space */
    .result-table th.date-header {
        text-indent: -9999px; 
        position: relative;
        width: 55px; 
    }
    .result-table th.date-header::after {
        content: "DATE";
        position: absolute;
        left: 0; right: 0;
        text-indent: 0;
        text-align: center;
        font-size: 0.6rem;
        color: var(--logo-cyan);
    }

    /* Compact cells */
    .result-table td { 
        padding: 4px 0; 
        font-size: 15px; 
        border-right: 1px solid var(--table-border);
    }

    /* Compact Date Cell */
    .date-cell {
        width: 55px !important;
        font-size: 0.65rem !important;
        letter-spacing: 0;
        padding: 4px 2px !important;
        background-color: var(--table-date-bg) !important; /* Keep distinct color */
    }

    /* Compact Numbers */
    .num-cell { 
        font-size: 0.8rem; 
        padding-bottom: 2px;
    }
    .single-cell { 
        font-size: 0.65rem; 
        padding-top: 2px;
    }

    .num-cell.disabled { font-size: 0.7rem; }
}



.old-charts-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.old-chart-button {
    background: linear-gradient(
        90deg,
        var(--logo-blue-dark),
        var(--logo-blue-bright)
    );

    color: #FFF;

    border: none;

    padding: 18px 30px;

    border-radius: 6px;

    font-weight: 600;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    font-family: inherit;

    font-size: 18px;

    text-decoration: none;

    min-width: 200px;

    transition: all 0.3s ease;
}

.old-chart-button > i:first-child {
    font-size: 18px;
}

.old-chart-button .chart-arrow {
    font-size: 14px;

    transition: transform 0.3s ease;
}


/* Hover */

.old-chart-button:hover {
    color: #FFF;

    transform: translateY(-3px);

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.old-chart-button:hover .chart-arrow {
    transform: translateX(5px);
}


/* Active */

.old-chart-button:active {
    transform: translateY(0);
}


/* Tablet */

@media (max-width: 1000px) {

    .old-charts-grid {
        gap: 12px;
    }

    .old-chart-button {
        min-width: 180px;
        padding: 17px 25px;
        font-size: 17px;
    }

}


/* Mobile */

@media (max-width: 650px) {

    .old-charts-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .old-chart-button {
        min-width: 0;
        width: 100%;

        padding: 15px 12px;

        font-size: 15px;

        gap: 7px;
    }

    .old-chart-button > i:first-child {
        font-size: 15px;
    }

    .old-chart-button .chart-arrow {
        font-size: 11px;
    }

}


/* Small mobile */

@media (max-width: 400px) {

    .old-charts-grid {
        grid-template-columns: 1fr;
    }

    .old-chart-button {
        padding: 16px 20px;
        font-size: 16px;
    }

}