/* 
 * EmiratesDrawWinners.com - CSS Design System
 * Premium Static Mixed Layout (Dark Header/Footer, Light Body/Cards)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* STATIC LIGHT THEME VARIABLES FOR CONTENT */
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-color: #3b82f6;
    --card-subtle-bg: #f1f5f9;
    
    /* STATIC DARK THEME VARIABLES FOR HEADER/FOOTER */
    --dark-bg: #111827;
    --dark-border: rgba(255, 255, 255, 0.08);
    --dark-text-primary: #f9fafb;
    --dark-text-secondary: #9ca3af;
    --dark-subtle-bg: rgba(255, 255, 255, 0.04);
    
    /* Game Specific Colors */
    --easy6-color: #00B955;
    --fast5-color: #0F7CE4;
    --mega7-color: #DF1C24;
    --pick1-color: #9C46C9;
    --pick2-color: #EE7C13;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --blur: blur(16px);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    padding-bottom: 80px; /* Space for fixed bottom navigation on mobile */
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Shine Animation Keyframes */
@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Shine effect utility */
.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    animation: shine 5s infinite ease-in-out;
}

/* Header & Navigation (Dark Style) */
header {
    background: var(--dark-bg);
    border-bottom: 1px solid var(--dark-border);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--dark-text-primary);
}

.logo span {
    background: linear-gradient(135deg, var(--easy6-color), var(--fast5-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.desktop-nav {
    display: flex;
    gap: 1.75rem;
    align-items: center;
}

@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }
}

.nav-link {
    color: var(--dark-text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--dark-text-primary);
}

/* Main Container */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Hero Section (Vibrant Light Mode Gradient) */
.hero {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1.5rem 1.25rem;
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border: 1px solid rgba(59, 130, 246, 0.12);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #1e3a8a;
}

.hero p {
    color: #475569;
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Grid Layouts */
.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 992px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
}

/* Status Badges */
.status-indicator {
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    line-height: 1;
}

.badge-latest {
    background: #e2e8f0;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.badge-updated {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.badge-live-blink {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid rgba(223, 28, 36, 0.3);
    animation: live-blink 1.2s infinite;
}

@keyframes live-blink {
    0% { opacity: 0.6; transform: scale(0.96); }
    50% { opacity: 1; transform: scale(1.04); }
    100% { opacity: 0.6; transform: scale(0.96); }
}

/* Game Cards (White Layout) */
.game-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: var(--shadow-lg);
}

/* Top game bar highlight */
.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.game-card.easy6::before { background: var(--easy6-color); }
.game-card.fast5::before { background: var(--fast5-color); }
.game-card.mega7::before { background: var(--mega7-color); }
.game-card.pick1::before { background: var(--pick1-color); }
.game-card.pick2::before { background: var(--pick2-color); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.game-title {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.easy6 .game-title { color: var(--easy6-color); }
.fast5 .game-title { color: var(--fast5-color); }
.mega7 .game-title { color: var(--mega7-color); }
.pick1 .game-title { color: var(--pick1-color); }
.pick2 .game-title { color: var(--pick2-color); }

.draw-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--card-subtle-bg);
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    border: 1px solid var(--card-border);
}

/* Ball styles for numbers */
.numbers-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.25rem 0;
    justify-content: center;
}

.number-ball {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    font-family: 'Outfit', sans-serif;
    color: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.number-ball:hover {
    transform: scale(1.1);
}

.easy6 .number-ball { background: radial-gradient(circle at 35% 35%, var(--easy6-color), #006b30); }
.fast5 .number-ball { background: radial-gradient(circle at 35% 35%, var(--fast5-color), #095096); }
.mega7 .number-ball { background: radial-gradient(circle at 35% 35%, var(--mega7-color), #9c0c11); }
.pick2 .number-ball { background: radial-gradient(circle at 35% 35%, var(--pick2-color), #b05705); }

/* Symbol styles for PICK 1 */
.symbol-badge {
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1.2rem;
    font-family: 'Outfit', sans-serif;
    color: #fff;
    text-align: center;
    box-shadow: var(--shadow-sm);
    background: linear-gradient(135deg, var(--pick1-color), #631e8c);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.winners-summary {
    display: flex;
    justify-content: space-between;
    background: var(--card-subtle-bg);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border: 1px solid var(--card-border);
}

.summary-item {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 500;
}

.summary-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Countdown Styles */
.countdown-box {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.countdown-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.countdown-timer {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.countdown-timer span {
    color: var(--accent-color);
}

.easy6 .countdown-timer span { color: var(--easy6-color); }
.fast5 .countdown-timer span { color: var(--fast5-color); }
.mega7 .countdown-timer span { color: var(--mega7-color); }
.pick1 .countdown-timer span { color: var(--pick1-color); }
.pick2 .countdown-timer span { color: var(--pick2-color); }

/* Past Results Table Page */
.page-title-section {
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.game-banner {
    padding: 2.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

/* Banners gradients */
.game-banner.easy6 { background: linear-gradient(135deg, rgba(0, 185, 85, 0.12) 0%, rgba(255,255,255,1) 100%); border-left: 6px solid var(--easy6-color); border: 1px solid rgba(0, 185, 85, 0.15); }
.game-banner.fast5 { background: linear-gradient(135deg, rgba(15, 124, 228, 0.12) 0%, rgba(255,255,255,1) 100%); border-left: 6px solid var(--fast5-color); border: 1px solid rgba(15, 124, 228, 0.15); }
.game-banner.mega7 { background: linear-gradient(135deg, rgba(223, 28, 36, 0.12) 0%, rgba(255,255,255,1) 100%); border-left: 6px solid var(--mega7-color); border: 1px solid rgba(223, 28, 36, 0.15); }
.game-banner.pick1 { background: linear-gradient(135deg, rgba(156, 70, 201, 0.12) 0%, rgba(255,255,255,1) 100%); border-left: 6px solid var(--pick1-color); border: 1px solid rgba(156, 70, 201, 0.15); }
.game-banner.pick2 { background: linear-gradient(135deg, rgba(238, 124, 19, 0.12) 0%, rgba(255,255,255,1) 100%); border-left: 6px solid var(--pick2-color); border: 1px solid rgba(238, 124, 19, 0.15); }

.banner-content h1 {
    font-size: 2.2rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.banner-content p {
    color: var(--text-secondary);
}

.banner-countdown {
    color: var(--text-primary);
}

/* Table Card (White layout with correct borders) */
.table-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background: var(--card-subtle-bg);
    padding: 1rem 1.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--card-border);
}

td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
    font-size: 0.95rem;
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

.table-date {
    color: var(--text-secondary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2.5rem 0;
}

.page-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.page-btn:hover {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: #fff;
}

.page-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Disclaimer section (Dark style at bottom) */
.disclaimer-card {
    background: var(--dark-bg);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin: 3rem auto 1rem auto;
    color: var(--dark-text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.disclaimer-title {
    font-weight: 700;
    color: var(--dark-text-primary);
    margin-bottom: 0.5rem;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

/* OneSignal subscription Card style */
.onesignal-card {
    background: linear-gradient(135deg, rgba(238, 124, 19, 0.05) 0%, rgba(156, 70, 201, 0.05) 100%);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.onesignal-info h3 {
    color: var(--text-primary);
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
}

.onesignal-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.onesignal-btn {
    background: linear-gradient(135deg, #EE7C13, #9C46C9);
    color: #fff;
    border: none;
    padding: 0.75rem 1.75rem;
    border-radius: 30px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.onesignal-btn:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
    .onesignal-card {
        flex-direction: column;
        text-align: center;
    }
}

/* Mobile Fixed Bottom Navigation Bar (Dark Style) */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: var(--dark-bg);
    border-top: 1px solid var(--dark-border);
    justify-content: space-around;
    align-items: center;
    z-index: 999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    color: var(--dark-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    flex: 1;
}

.mobile-nav-item:hover, .mobile-nav-item.active {
    color: #ffffff;
    transform: translateY(-2px);
}

.mobile-nav-item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
}

.mobile-nav-item.active svg {
    stroke-width: 2.5;
}

@media (max-width: 768px) {
    .mobile-nav {
        display: flex;
    }
}

/* Floating Refresh Button */
.floating-refresh {
    position: fixed;
    bottom: 80px; /* Stands above mobile bottom nav */
    right: 25px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), #2563eb);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    z-index: 998;
    border: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-refresh:hover {
    transform: scale(1.1) rotate(18deg);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.floating-refresh.loading svg {
    animation: spin 1s infinite linear;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notification styling */
.toast-msg {
    position: fixed;
    bottom: 150px;
    right: -300px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-msg.show {
    right: 25px;
}

/* Footer Section (Dark Style) */
footer {
    border-top: 1px solid var(--dark-border);
    background: var(--dark-bg);
    padding: 3.5rem 1.5rem 2rem 1.5rem;
    text-align: center;
    color: var(--dark-text-primary);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2.25rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.footer-link {
    font-size: 0.9rem;
    color: var(--dark-text-secondary);
    transition: color 0.2s ease;
    font-weight: 500;
}

.footer-link:hover {
    color: var(--dark-text-primary);
}

.copyright {
    color: var(--dark-text-secondary);
    font-size: 0.8rem;
    margin-top: 1.5rem;
}

/* Responsive Past Results page adjustments */
@media (max-width: 650px) {
    .game-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
        padding: 1.5rem;
    }
    .banner-countdown {
        text-align: left !important;
        width: 100%;
        border-top: 1px dashed rgba(0, 0, 0, 0.12);
        padding-top: 1rem;
    }
    .banner-content h1 {
        font-size: 1.8rem;
    }
    
    .table-card {
        background: transparent;
        border: none;
        box-shadow: none;
        border-radius: 0;
    }
    
    .table-responsive {
        overflow-x: visible;
    }
    
    /* Force table elements to stack as block cards on mobile */
    .table-responsive table, 
    .table-responsive thead, 
    .table-responsive tbody, 
    .table-responsive th, 
    .table-responsive td, 
    .table-responsive tr { 
        display: block; 
    }
    
    /* Hide table header but keep accessible */
    .table-responsive thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .table-responsive tr { 
        border: 1px solid var(--card-border);
        border-radius: 16px;
        margin-bottom: 1.25rem;
        background: #ffffff;
        padding: 0.75rem 0.5rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        border-left: 5px solid var(--accent-color);
    }
    
    /* Add corresponding color borders depending on game page context */
    .easy6 .table-responsive tr { border-left-color: var(--easy6-color); }
    .fast5 .table-responsive tr { border-left-color: var(--fast5-color); }
    .mega7 .table-responsive tr { border-left-color: var(--mega7-color); }
    
    .table-responsive td { 
        border: none;
        border-bottom: 1px solid #f1f5f9;
        position: relative;
        padding: 0.75rem 1rem 0.75rem 38%; 
        text-align: left !important;
        font-size: 0.9rem;
    }
    
    .table-responsive td:last-child {
        border-bottom: none;
    }
    
    /* Generate mobile table headers using pseudo elements */
    .table-responsive td::before { 
        position: absolute;
        top: 50%;
        left: 1rem;
        width: 32%; 
        padding-right: 10px; 
        white-space: nowrap;
        font-weight: 700;
        color: var(--text-secondary);
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        transform: translateY(-50%);
    }
    
    /* Label cells */
    .table-responsive td:nth-of-type(1)::before { content: "Draw Date"; }
    .table-responsive td:nth-of-type(2)::before { content: "Numbers"; }
    .table-responsive td:nth-of-type(3)::before { content: "Winners"; }
    .table-responsive td:nth-of-type(4)::before { content: "Total Prize"; }
    
    /* Align elements inside cells */
    .table-responsive td .numbers-container {
        justify-content: flex-start !important;
        flex-wrap: wrap;
        gap: 0.25rem !important;
        margin: 0 !important;
    }
    
    .table-responsive td .number-ball {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.85rem !important;
        line-height: 30px !important;
    }
}
