/* ==========================================================================
   CSS Variables & Design Tokens
   ========================================================================== */
   :root {
    /* Colors */
    --clr-bg-dark: #0a0e17;
    --clr-surface: rgba(20, 26, 38, 0.85);
    --clr-surface-light: rgba(35, 45, 65, 0.9);
    --clr-primary: #00e1ff;
    --clr-primary-glow: rgba(0, 225, 255, 0.4);
    --clr-accent: #ff007f;
    --clr-text: #e2e8f0;
    --clr-text-muted: #94a3b8;
    --clr-border: rgba(255, 255, 255, 0.1);
    
    /* Typography */
    --font-sans: Arial, Helvetica, sans-serif;
    --font-numbers: Arial, Helvetica, sans-serif;
    
    /* Spacing & Radii */
    --radius-sm: 8px;
    --radius-md: 16px;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    background-color: var(--clr-bg-dark);
    color: var(--clr-text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; transition: color var(--transition-fast); }
ul { list-style: none; }

.bg-layer {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-image: linear-gradient(to bottom, rgba(10, 14, 23, 0.8), rgba(10, 14, 23, 0.98)), url('assets/bg-city.png');
    background-size: cover; background-position: center; z-index: -1;
}

.app-container {
    max-width: 900px; margin: 0 auto; width: 100%;
}

/* ==========================================================================
   Top Bar & Header
   ========================================================================== */
.top-bar {
    background: #000; padding: 0.5rem 1rem; font-size: 0.85rem; color: var(--clr-text-muted);
}
.top-bar a { margin: 0 0.5rem; }
.top-bar a:hover { color: #fff; }

.main-header { padding: 1rem; display: flex; align-items: center; }
.logo-container { display: flex; align-items: center; gap: 1rem; }
.logo-img { width: 50px; height: 50px; object-fit: contain; }
.logo-text h1 { font-size: 1.8rem; font-weight: 600; color: #fff; }

/* ==========================================================================
   Navigation Menu
   ========================================================================== */
.main-nav {
    background: rgba(0, 30, 80, 0.6);
    border-bottom: 2px solid var(--clr-primary);
}
.main-nav ul { display: flex; overflow-x: auto; scrollbar-width: none; background: #003366; }
.main-nav ul::-webkit-scrollbar { display: none; }
.main-nav li { flex: 1; text-align: center; border-right: 1px solid #002244; }
.main-nav button {
    width: 100%; background: none; border: none; color: #fff; padding: 10px 0;
    font-family: Arial, sans-serif; font-weight: normal; font-size: 14px; cursor: pointer;
    transition: all var(--transition-fast);
}
.main-nav button:hover { background: rgba(255, 255, 255, 0.1); }
.main-nav button.active {
    background: #0050b3; font-weight: bold; color: #fff;
}
.main-nav button.live-draw { background: #cc0000; font-weight: bold; }

/* ==========================================================================
   View Management
   ========================================================================== */
.view-section { display: none; margin-top: var(--spacing-md); }
.view-section.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   HOME VIEW (Split Layout)
   ========================================================================== */
.home-split {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0.5rem;
    background: var(--clr-surface);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Home - Left Panel */
.latest-draw-panel { background: #111; padding: 1rem; border: 1px solid #333; }
.latest-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; }
.latest-header h2 { font-size: 1.3rem; font-weight: bold; color: #fff; letter-spacing: 0px; font-family: Arial, sans-serif; }
.latest-meta { font-size: 12px; font-weight: bold; color: #ddd; border-bottom: 1px solid #333; padding-bottom: 0.5rem; margin-bottom: 0; }

.big-prize-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.6rem 1rem; border-bottom: 1px solid #333;
}
.big-prize-label { font-size: 16px; color: #ffff00; font-weight: bold; }
.big-prize-num { font-size: 22px; font-weight: bold; color: #fff; letter-spacing: 5px; }

.guarantee-box {
    text-align: center; padding: 0.4rem; background: linear-gradient(to bottom, #444, #111);
    font-size: 12px; font-weight: bold; color: #fff; border: 1px solid #333; border-top: none;
}
.home-banner { margin-top: 10px; }
.home-banner img { width: 100%; border: 1px solid #333; display: block; }

/* Home - Right Panel (Table) */
.home-history-panel { background: #000; border: 1px solid #333; overflow: hidden; font-family: Arial, sans-serif; }
.history-header { background: linear-gradient(to bottom, #333, #000); color: #00bfff; padding: 6px 10px; font-size: 12px; font-weight: bold; border-bottom: 1px solid #333; }

.home-table { width: 100%; border-collapse: collapse; background: #0a0a0a; }
.home-table th { color: #00bfff; font-weight: bold; padding: 2px 4px; border: 1px solid #222; font-size: 10px; background: linear-gradient(to bottom, #2a2a2a, #111); text-align: center; }
.home-table td { padding: 2px 4px; text-align: center; border: 1px solid #222; font-size: 10px; color: #ddd; font-weight: bold; }
.home-table .col-result { font-size: 11px; font-weight: bold; color: #fff; letter-spacing: 0px; }

.home-table tbody tr:nth-child(odd) { background: #1a1a1a; }
.home-table tbody tr:nth-child(even) { background: #0a0a0a; }
.home-table tbody tr:hover td { background: #222; color: #00bfff; }

/* ==========================================================================
   DAY VIEW (Full Table)
   ========================================================================== */
.table-wrapper {
    background: var(--clr-surface); border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm); padding: var(--spacing-md);
}
.table-wrapper .table-header { margin-bottom: 1rem; border-bottom: 1px solid var(--clr-border); padding-bottom: 0.5rem; }
.table-wrapper .table-header h2 { font-size: 1.2rem; color: var(--clr-primary); font-weight: 600; }
.table-responsive { overflow-x: auto; }

.lottery-table { width: 100%; border-collapse: collapse; min-width: 600px; background: #0a0a0a; }
.lottery-table th { background: linear-gradient(to bottom, #2a2a2a, #111); color: #00bfff; padding: 4px 6px; font-size: 10px; text-align: center; border: 1px solid #222; font-family: Arial, sans-serif; }
.lottery-table td { padding: 4px 6px; text-align: center; border: 1px solid #222; font-family: Arial, sans-serif; font-size: 10px; color: #ddd; font-weight: bold; }
.lottery-table tbody tr:nth-child(even) { background: #0a0a0a; }
.lottery-table tbody tr:nth-child(odd) { background: #1a1a1a; }
.lottery-table tbody tr:hover td { background: #222; color: #00bfff; }

/* ==========================================================================
   Footer Info Block
   ========================================================================== */
.footer-info-block {
    background: #fff; color: #333; margin-top: 2rem; border-radius: var(--radius-sm);
    padding: 2rem;
}
.cert-row { display: flex; border-bottom: 1px solid #ddd; padding-bottom: 1.5rem; margin-bottom: 1.5rem; gap: 2rem; }
.cert-item { display: flex; align-items: center; gap: 1rem; flex: 1; }
.cert-icon { width: 80px; height: 80px; border-radius: 50%; border: 3px solid #b8860b; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: bold; color: #0050b3; }
.cert-icon.shield { border-color: #555; color: #555; }
.cert-text h3 { font-size: 1.1rem; color: #444; }
.cert-text p { font-size: 0.9rem; font-weight: 600; color: #777; margin: 0.2rem 0; }
.cert-text span { font-size: 0.8rem; color: #999; }

.links-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.link-item h4 { font-size: 0.95rem; color: #0050b3; margin-bottom: 0.5rem; cursor: pointer; }
.link-item h4:hover { text-decoration: underline; }
.link-item p { font-size: 0.8rem; color: #666; }

.app-store-row {
    display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem;
    padding-top: 1.5rem; border-top: 1px solid #eee; justify-content: center;
}
.app-btn {
    background: #f5f5f5; border: 1px solid #ddd; padding: 0.6rem 1rem;
    border-radius: 4px; font-size: 0.85rem; color: #444; font-weight: 600;
    transition: all var(--transition-fast); display: flex; align-items: center; gap: 0.5rem;
}
.app-btn:hover {
    background: #0050b3; color: #fff; border-color: #0050b3;
}

/* ==========================================================================
   STATIC PAGES (Responsible, About, Contact)
   ========================================================================== */
.static-page-wrapper {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.static-page-wrapper h2 {
    font-size: 1.5rem;
    color: var(--clr-primary);
    border-bottom: 1px solid var(--clr-border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.static-content p {
    margin-bottom: 1rem;
    color: #ccc;
    font-size: 1rem;
    line-height: 1.8;
}

.static-content ol, .static-content ul {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
    color: #ccc;
    line-height: 1.8;
}

.static-content li {
    margin-bottom: 0.5rem;
}

.static-content strong {
    color: #fff;
}

/* Responsive */
@media (max-width: 900px) {
    .home-split { grid-template-columns: 1fr; }
    .cert-row { flex-direction: column; }
    .links-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .links-row { grid-template-columns: 1fr; }
}
