/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1e293b;
    --primary-dark: #0f172a;
    --secondary: #334155;
    --accent: #d4a843;
    --accent-dark: #b8922e;
    --red: #7f1d1d;
    --red-hover: #5c1515;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #475569;
    --success: #10b981;
    --white: #ffffff;
}

body {
    font-family: 'Inter', 'Noto Sans Khmer', sans-serif;
    background: #0f172a;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.header {
    padding: 20px 0;
}

.header-content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-link {
    display: inline-block;
    z-index: 2;
}

.logo {
    max-width: 600px;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.flag-bg {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    height: auto;
    opacity: 0.3;
    z-index: 1;
}

/* Main Content */
.main-content {
    padding-bottom: 30px;
}

.content-wrapper {
    background: var(--primary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Navigation */
.navbar {
    background: var(--primary-dark);
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.nav-list {
    display: flex;
    list-style: none;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-item {
    padding: 12px 18px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.nav-item a {
    color: var(--text);
    text-decoration: none;
}

.nav-item:hover {
    background: var(--secondary);
    border-bottom-color: var(--accent);
}

.nav-item.active {
    border-bottom-color: var(--accent);
    background: var(--secondary);
}

.nav-item.lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--accent);
    cursor: pointer;
}

/* Marquee */
.marquee {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    color: var(--primary-dark);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
    overflow: hidden;
    font-weight: 600;
    font-size: 14px;
}

.marquee-content {
    animation: marquee 20s linear infinite;
    white-space: nowrap;
}

@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Main Grid */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
}

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

/* Result Cards */
.result-card {
    background: var(--primary-dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.result-card-info h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.result-card-info p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.result-card-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 1px;
}

.result-numbers {
    display: flex;
    gap: 8px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.number-ball {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #991b1b, #7f1d1d);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 3px 8px rgba(127, 29, 29, 0.4);
}

.result-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.result-card-footer span {
    font-size: 12px;
    color: var(--text-muted);
}

.check-btn {
    background: var(--secondary);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.check-btn:hover {
    background: var(--accent);
    color: var(--primary-dark);
    border-color: var(--accent);
}

/* Sidebar */
.sidebar {
    background: var(--primary-dark);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border);
    height: fit-content;
}

.sidebar-title {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.lottery-card {
    background: linear-gradient(135deg, var(--red), var(--red-hover));
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s;
}

.lottery-card:hover {
    transform: scale(0.98);
}

.lottery-name {
    font-weight: 700;
    font-size: 15px;
    color: #fecaca;
}

.lottery-prize {
    font-weight: 700;
    font-size: 14px;
    color: #fecaca;
    text-align: center;
}

.play-btn {
    background: var(--secondary);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.3s;
}

.play-btn:hover {
    background: var(--accent);
    color: var(--primary-dark);
}

.ad-box {
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
    text-align: center;
}

.ad-box h4 {
    font-size: 12px;
    text-decoration: underline;
    margin-bottom: 10px;
    color: var(--text-muted);
}

.ad-box img {
    width: 100%;
    border-radius: 6px;
}

/* Live Draw Page */
.livedraw-section {
    text-align: center;
    padding: 20px 0;
}

.livedraw-header {
    margin-bottom: 30px;
}

.livedraw-header h1 {
    font-size: 24px;
    color: var(--accent);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.jackpot-text {
    font-size: 16px;
    color: var(--text-muted);
}

.jackpot-text span {
    color: var(--success);
    font-weight: 700;
    font-size: 20px;
}

/* Countdown */
.countdown-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
    border: 2px solid var(--accent);
    border-radius: 16px;
    padding: 40px 20px;
    margin: 30px auto;
    max-width: 600px;
}

.countdown-section h2 {
    font-size: 16px;
    color: var(--accent);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.time-block {
    background: var(--primary-dark);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 20px 25px;
    min-width: 90px;
}

.time-value {
    display: block;
    font-size: 42px;
    font-weight: 800;
    color: var(--white);
    line-height: 1;
}

.time-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 6px;
    letter-spacing: 1px;
}

.time-separator {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.draw-time-info {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
}

/* Draw Status */
.draw-status {
    margin: 20px 0;
}

.drawing-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
    color: var(--success);
    font-size: 18px;
    animation: pulse 1.5s infinite;
}

.pulse-dot {
    width: 12px;
    height: 12px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse-scale 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes pulse-scale {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.5); }
}

/* Prize Table */
.draw-results-table {
    max-width: 500px;
    margin: 30px auto;
}

.prize-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
}

.prize-table thead tr {
    background: var(--accent);
    color: var(--primary-dark);
}

.prize-table th {
    padding: 14px 20px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 1px;
}

.prize-row td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.prize-row.prize-1 {
    background: var(--primary-dark);
}

.prize-row.prize-2 {
    background: var(--secondary);
}

.prize-row.prize-3 {
    background: var(--primary-dark);
}

.prize-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 4px;
    font-family: 'Courier New', monospace;
}

.draw-date {
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Results Page */
.results-page {
    padding: 20px 0;
}

.page-title {
    text-align: center;
    font-size: 24px;
    color: var(--text);
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.results-table-wrapper {
    overflow-x: auto;
}

.results-history-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
}

.results-history-table thead {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    color: var(--primary-dark);
}

.results-history-table th {
    padding: 14px 16px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.results-history-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    font-size: 14px;
}

.results-history-table tbody tr:nth-child(even) {
    background: var(--primary-dark);
}

.results-history-table tbody tr:hover {
    background: var(--secondary);
}

.number-badge {
    display: inline-block;
    background: linear-gradient(135deg, #991b1b, #7f1d1d);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
}

/* About Page */
.about-page {
    padding: 20px 0;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-section {
    margin-bottom: 30px;
    padding: 24px;
    background: var(--primary-dark);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.about-section h2 {
    color: var(--accent);
    font-size: 18px;
    margin-bottom: 12px;
}

.about-section p {
    color: var(--text-muted);
    line-height: 1.8;
}

.cert-logo {
    margin-top: 16px;
    text-align: center;
}

.cert-logo img {
    width: 120px;
    height: auto;
}

/* Contact Page */
.contact-page {
    padding: 20px 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

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

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    background: var(--primary-dark);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.contact-item h3 {
    color: var(--accent);
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.contact-item p {
    color: var(--text-muted);
    font-size: 14px;
}

.contact-form-wrapper {
    background: var(--primary-dark);
    padding: 24px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.contact-form .form-group {
    margin-bottom: 16px;
}

.contact-form label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: var(--primary-dark);
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: var(--accent-dark);
}

/* Footer */
.footer {
    margin-top: 0;
}

.footer-content {
    background: var(--primary);
    padding: 30px 20px;
    border-top: 1px solid var(--border);
    border-radius: 0 0 12px 12px;
}

.footer-content h3 {
    color: var(--text);
    font-size: 18px;
    margin-bottom: 12px;
}

.footer-content > p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 10px;
    line-height: 1.7;
}

.footer-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.wla-logo {
    width: 100px;
    height: auto;
}

.payment-section h4 {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-align: center;
}

.bank-logos {
    display: flex;
    gap: 12px;
    align-items: center;
}

.bank-logos img {
    width: 60px;
    height: auto;
    border-radius: 4px;
}

.copyright {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 640px) {
    .nav-list {
        flex-direction: column;
    }
    
    .nav-item {
        border-bottom: 1px solid var(--border);
        padding: 10px 16px;
    }
    
    .logo {
        max-width: 250px;
    }
    
    .flag-bg {
        display: none;
    }
    
    .time-block {
        padding: 15px 18px;
        min-width: 70px;
    }
    
    .time-value {
        font-size: 30px;
    }
    
    .lottery-card {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}
