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

:root {
    /* Color Palette - Premium Costa Rica Inspired but Modern */
    --primary: #102A43;       /* Premium Dark Blue */
    --primary-light: #243B53; 
    --secondary: #D40000;     /* Rich Red */
    --secondary-light: #FF2B2B;
    --accent: #F59E0B;        /* Gold for Mega/Acumulado */
    --accent-light: #FDE68A;
    
    /* Backgrounds & Surfaces */
    --bg-main: #F8FAFC;       /* Soft Slate */
    --surface: #FFFFFF;
    --surface-hover: #F1F5F9;
    
    /* Typography Colors */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-tertiary: #94A3B8;
    --text-on-dark: #FFFFFF;
    
    /* Layout & Effects */
    --border: #E2E8F0;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    /* Premium Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);
    --shadow-glow: 0 0 15px rgba(212, 0, 0, 0.4);
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    /* Soft ambient gradient */
    background-image: 
        radial-gradient(at 0% 0%, rgba(36, 59, 83, 0.04) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(212, 0, 0, 0.04) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
}

h1, h2, h3, h4, .font-heading {
    font-family: var(--font-heading);
    color: var(--text-primary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

/* Layout */
.main-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes gradient-x {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Hero Header (Glassmorphism) */
.hero-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    position: relative;
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-on-dark);
    margin-bottom: 2rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.hero-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1.5" fill="rgba(255,255,255,0.07)"/></svg>');
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

.hero-header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
    text-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.hero-header p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    font-weight: 400;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

/* Result Card */
.result-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.8);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
    display: flex;
    flex-direction: column;
}

.result-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

/* Card Header Strip */
.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.result-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-card h2::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    margin-left: 0.5rem;
}

.result-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Result Item (Row) */
.result-item {
    background: var(--bg-main);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-item:hover {
    background: var(--surface);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.result-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.result-numbers {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
}

.prize-amount {
    font-size: 1.125rem;
    color: var(--secondary);
    font-weight: 700;
    margin-top: 0.25rem;
}

/* Lottery Balls */
.lottery-balls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.lottery-ball {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--secondary), #A00000);
    color: var(--text-on-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: var(--shadow-sm);
    font-family: var(--font-heading);
    position: relative;
    overflow: hidden;
}

.lottery-ball::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 10px;
    right: 10px;
    height: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
    border-radius: 10px;
}

.lottery-ball.revancha {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.lottery-ball.mega {
    background: linear-gradient(135deg, var(--accent), #D97706);
    color: #451A03;
}

.lottery-ball.mega::after {
    background: linear-gradient(180deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 100%);
}

/* Tags / Details */
.result-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.result-details span {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--surface);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

.time-badge {
    display: inline-flex;
    align-items: center;
    background: var(--primary-light);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.time-badge.reventado {
    background: var(--secondary);
    animation: pulse-soft 2s infinite;
}

/* Skeletons for Async Loading */
.skeleton {
    background: #e2e8f0;
    background: linear-gradient(90deg, #e2e8f0 25%, #cbd5e1 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text { height: 16px; margin-bottom: 8px; width: 80%; }
.skeleton-title { height: 28px; width: 60%; margin-bottom: 16px; }
.skeleton-ball { width: 48px; height: 48px; border-radius: 50%; }

/* Error State */
.error-state {
    padding: 2rem;
    text-align: center;
    color: var(--secondary);
    background: #FEF2F2;
    border-radius: var(--radius-md);
    border: 1px solid #FECACA;
    margin-top: 1rem;
}

/* SEO Content Sections */
.seo-content-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-lg);
}

.seo-content-section h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 1rem;
}

.seo-content-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--secondary);
    border-radius: 2px;
}

.seo-content-section h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
}

.seo-content-section p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.seo-content-section ul {
    list-style: none;
    margin-bottom: 1.5rem;
}

.seo-content-section ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.seo-content-section ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: bold;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.game-card {
    background: var(--bg-main);
    padding: 2rem;
    border-radius: var(--radius-md);
    border-top: 4px solid var(--primary);
    transition: var(--transition);
}

.game-card:nth-child(even) {
    border-top-color: var(--secondary);
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    background: var(--surface);
}

.game-card h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

/* FAQ Block */
.faq-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.faq-answer {
    color: var(--text-secondary);
}

/* Footer */
footer {
    background: var(--primary);
    color: var(--text-tertiary);
    padding: 4rem 1.5rem 2rem;
    text-align: center;
}

footer a {
    color: var(--surface);
    font-weight: 500;
    margin: 0 0.5rem;
}

footer a:hover {
    color: var(--secondary-light);
}

.footer-disclaimer {
    max-width: 800px;
    margin: 2rem auto;
    font-size: 0.875rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
}

/* Staggers */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .seo-content-section {
        padding: 2rem 1.5rem;
    }
    .result-card {
        padding: 1.5rem;
    }
}
