/* ============================================
   LottoGen Pro - Stylesheet
   ============================================ */

:root {
    --bg-primary: #0A0E17;
    --bg-card: #111827;
    --bg-card-hover: #1a2332;
    --accent-gold: #D4A843;
    --accent-blue: #3B82F6;
    --accent-green: #10B981;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --border-color: #1E293B;
    --ball-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    min-height: 100vh;
}

/* Background mesh effect */
.bg-mesh {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(59,130,246,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(212,168,67,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(16,185,129,0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.content-wrapper { position: relative; z-index: 1; }

/* ---- Header ---- */
.site-header {
    padding: 2rem 0 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}
.site-header h1 {
    font-family: 'Space Mono', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--accent-gold), #F59E0B, var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}
.site-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ---- Language switcher ---- */
.lang-switcher {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.25rem;
}
.lang-switcher a {
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}
.lang-switcher a.active,
.lang-switcher a:hover {
    background: var(--accent-gold);
    color: var(--bg-primary);
    border-color: var(--accent-gold);
}

/* ---- Panel cards ---- */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.panel-title {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* ---- Game selector grid ---- */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}
.game-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}
.game-card:hover {
    border-color: var(--accent-blue);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}
.game-card.selected {
    border-color: var(--accent-gold);
    background: rgba(212,168,67,0.1);
    box-shadow: 0 0 20px rgba(212,168,67,0.15);
}
.game-card .game-icon {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
}
.game-card .game-name {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}
.game-card .game-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ---- Form elements ---- */
.form-control, .form-select {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0.6rem 1rem;
}
.form-control:focus, .form-select:focus {
    background: var(--bg-primary);
    border-color: var(--accent-gold);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(212,168,67,0.15);
}
.form-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- Buttons ---- */
.btn-generate {
    background: linear-gradient(135deg, var(--accent-gold), #F59E0B);
    color: var(--bg-primary);
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 12px;
    letter-spacing: 1px;
    transition: all 0.3s;
    text-transform: uppercase;
}
.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(212,168,67,0.35);
    color: var(--bg-primary);
}
.btn-outline-action {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.btn-outline-action:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* ---- Lotto balls ---- */
.lotto-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 0.9rem;
    margin: 3px;
    background: linear-gradient(145deg, #2d3748, #1a202c);
    color: var(--text-primary);
    border: 2px solid #4a5568;
    box-shadow: var(--ball-shadow);
    animation: popIn 0.3s ease-out both;
}
.lotto-ball.bonus-ball {
    background: linear-gradient(145deg, var(--accent-gold), #B8860B);
    color: var(--bg-primary);
    border-color: #F59E0B;
    box-shadow: 0 4px 15px rgba(212,168,67,0.4);
}
.lotto-ball.star-ball {
    background: linear-gradient(145deg, #3B82F6, #1D4ED8);
    color: #fff;
    border-color: #60A5FA;
    box-shadow: 0 4px 15px rgba(59,130,246,0.4);
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* ---- Results table ---- */
.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.results-table thead th {
    background: var(--bg-primary);
    color: var(--accent-gold);
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.8rem 1rem;
    border-bottom: 2px solid var(--accent-gold);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.results-table thead th:hover {
    color: #F59E0B;
}
.results-table thead th .sort-arrow {
    margin-left: 4px;
    opacity: 0.4;
}
.results-table thead th.sorted .sort-arrow {
    opacity: 1;
}
.results-table tbody tr {
    transition: background 0.2s;
}
.results-table tbody tr:hover {
    background: rgba(59,130,246,0.05);
}
.results-table tbody td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.draw-number {
    font-family: 'Space Mono', monospace;
    color: var(--text-secondary);
    font-size: 0.85rem;
    min-width: 40px;
}

/* ---- Custom game panel ---- */
.custom-panel {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(59,130,246,0.05);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: 12px;
}
.custom-panel.show { display: block; }

/* ---- Bingo panel ---- */
.bingo-panel {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(16,185,129,0.05);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 12px;
}
.bingo-panel.show { display: block; }

/* ---- Empty state ---- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}
.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* ---- PDF progress overlay ---- */
.pdf-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 23, 0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}
.pdf-overlay.show { display: flex; }
.pdf-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.pdf-overlay p {
    color: var(--accent-gold);
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
}

/* ---- Print styles ---- */
@media print {
    body { background: #fff !important; color: #000 !important; }
    .bg-mesh, .site-header, .panel:not(.results-panel), .btn-generate,
    .lang-switcher, .no-print, footer { display: none !important; }
    .panel { background: #fff !important; border: 1px solid #ddd !important; }
    .results-table thead th { background: #f5f5f5 !important; color: #333 !important; border-bottom-color: #333 !important; }
    .results-table tbody td { border-bottom-color: #ddd !important; color: #000 !important; }
    .lotto-ball { background: #eee !important; color: #000 !important; border-color: #999 !important; box-shadow: none !important; animation: none !important; }
    .lotto-ball.bonus-ball { background: #FFD700 !important; color: #000 !important; }
    .lotto-ball.star-ball { background: #4A90D9 !important; color: #fff !important; }
    .panel-title { color: #333 !important; }
    .print-header { display: block !important; text-align: center; margin-bottom: 1rem; }
    .print-header h2 { font-size: 1.5rem; color: #000; }
    .print-header p { font-size: 0.9rem; color: #666; }
}
.print-header { display: none; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .site-header h1 { font-size: 1.8rem; }
    .game-grid { grid-template-columns: repeat(2, 1fr); }
    .lotto-ball { width: 36px; height: 36px; font-size: 0.75rem; }
}
