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

/* Color Scheme */
:root {
    /* Dark Backgrounds */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: #111111;
    --bg-hover: #1a1a1a;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #b4b4b4;
    --text-muted: #808080;

    /* Accent Colors */
    --accent-green: #00a86b;
    --accent-blue: #3498db;
    --accent-gold: #f1c40f;
    --accent-red: #ff4757;

    /* Border Colors */
    --border-color: #1f1f1f;
    --border-light: #2f2f2f;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1, h2 {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
}

.logo {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Update Schedule Banner */
.update-schedule-banner {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

.schedule-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-gold);
    margin-bottom: 1rem;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

.schedule-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.schedule-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.lottery-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.update-time {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

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

    .schedule-title {
        font-size: 1rem;
    }
}

/* Main Content */
.main-content {
    padding: 3rem 0;
    min-height: calc(100vh - 300px);
}

/* Lottery Cards Grid */
.lottery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 4rem;
}

/* Mobile: single column */
@media (max-width: 768px) {
    .lottery-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablet: 2 columns */
@media (min-width: 769px) and (max-width: 1024px) {
    .lottery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Card Link Wrapper */
.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-link .lottery-card {
    cursor: pointer;
}

.card-link .lottery-title::after {
    content: ' →';
    opacity: 0;
    transition: opacity 0.3s;
}

.card-link:hover .lottery-title::after {
    opacity: 1;
}

.lottery-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.lottery-card:hover {
    border-color: var(--accent-green);
    box-shadow: 0 8px 32px rgba(0, 168, 107, 0.2);
    transform: translateY(-4px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.lottery-title {
    font-size: 1.25rem;
    margin: 0;
    white-space: nowrap;
}

.countdown {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: var(--accent-gold);
    font-weight: 600;
    white-space: nowrap;
}

/* Last Drawing - Grayscale, no color */
.last-drawing {
    margin-bottom: 1.5rem;
}

.last-drawing h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    background: none;
    -webkit-text-fill-color: var(--text-secondary);
}

.drawing-date {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

/* Numbers Display - Grayscale for last drawing */
.numbers-display {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ball, .powerball, .megaball, .cashball, .wildball, .bullseye {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-light);
    color: var(--text-secondary);
    box-shadow: none;
}

.powerball, .megaball, .cashball, .wildball, .bullseye {
    background: var(--bg-secondary);
    border: 2px solid var(--accent-red);
    color: var(--accent-red);
    box-shadow: none;
}

/* Predictions */
.predictions {
    margin-bottom: 1.5rem;
}

.predictions h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    background: none;
    -webkit-text-fill-color: var(--text-secondary);
}

.prediction-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

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

.prediction-method {
    font-weight: 600;
    color: var(--accent-green);
}

.prediction-numbers {
    display: flex;
    gap: 0.3rem;
    flex-wrap: nowrap;
    justify-content: center;
}

.prediction-ball {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 1.1rem;
    background: var(--bg-hover);
    border: 2px solid var(--border-light);
    color: var(--text-primary);
    flex-shrink: 0;
}

.prediction-ball.special {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* Card Footer */
.card-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.next-drawing {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.next-drawing strong {
    color: var(--text-primary);
}

/* History Section */
.history-section {
    margin-top: 4rem;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.history-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
}

.history-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

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

.history-entry {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.history-date {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.history-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-method {
    color: var(--text-primary);
    font-weight: 600;
}

.history-matches {
    font-family: 'JetBrains Mono', monospace;
}

.history-matches.has-prize {
    color: var(--accent-gold);
    font-weight: 700;
}

.no-history {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

#last-updated {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-green);
}

/* Responsive */
@media (max-width: 768px) {
    .lottery-grid,
    .history-grid {
        grid-template-columns: 1fr;
    }

    .logo {
        font-size: 2rem;
    }

    .container {
        padding: 0 1rem;
    }

    .ball, .powerball, .megaball, .cashball {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .prediction-ball {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Footer Link */
.footer-link {
    color: var(--accent-green);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

/* ================================ */
/* Performance Page Styles          */
/* ================================ */

/* Back Button */
.back-link {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
    color: #000;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 168, 107, 0.3);
}

.back-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 168, 107, 0.4);
    filter: brightness(1.1);
}

/* Big Summary Section */
.summary-section {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    padding: 3rem 0;
    border-bottom: 1px solid var(--border-color);
}

.big-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.big-stat {
    text-align: center;
}

.big-stat.highlight .big-number {
    color: var(--accent-gold);
}

.big-number {
    display: block;
    font-size: 3.5rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    line-height: 1;
}

.big-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Leaderboard */
.leaderboard-section {
    margin-bottom: 3rem;
}

.leaderboard {
    max-width: 600px;
    margin: 0 auto;
}

.leader-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.leader-row:hover {
    border-color: var(--accent-green);
}

.leader-row.top-three {
    background: var(--bg-secondary);
    border-color: var(--border-light);
}

.leader-rank {
    font-size: 1.25rem;
    width: 2rem;
    text-align: center;
}

.leader-name {
    flex: 1;
    font-weight: 600;
    color: var(--accent-green);
}

.leader-stat {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--text-primary);
}

.leader-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Results Section */
.results-section {
    margin-bottom: 3rem;
}

.results-list {
    max-width: 800px;
    margin: 0 auto;
}

.date-group {
    margin-bottom: 1.5rem;
}

.date-header {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}

.result-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.result-lottery {
    width: 120px;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

.result-numbers {
    flex: 1;
}

.num-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.num-row:last-child {
    margin-bottom: 0;
}

.num-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    width: 100px;
    flex-shrink: 0;
}

.num-balls {
    display: flex;
    gap: 0.25rem;
}

.num-balls .ball {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
}

.num-balls.actual .ball {
    background: var(--bg-hover);
    border-color: var(--border-light);
    color: var(--text-secondary);
}

.num-balls.predicted .ball {
    background: var(--bg-secondary);
    border-color: var(--border-light);
    color: var(--text-muted);
}

.num-balls.predicted .ball.match {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: #000;
    font-weight: 700;
}

.result-outcome {
    text-align: right;
    min-width: 100px;
}

.match-count {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.match-count.good {
    color: var(--accent-blue);
    font-weight: 600;
}

.prize-amount {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--accent-gold);
    font-size: 1.1rem;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem;
    font-style: italic;
}

@media (max-width: 768px) {
    .big-stats {
        gap: 2rem;
    }

    .big-number {
        font-size: 2.5rem;
    }

    .result-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .result-lottery {
        width: auto;
    }

    .result-outcome {
        text-align: left;
        width: 100%;
        display: flex;
        gap: 1rem;
    }

    .leader-row {
        flex-wrap: wrap;
    }

    .leader-meta {
        width: 100%;
        margin-top: 0.25rem;
    }
}
