/**
 * ============================================================
 * LOTOMASTER - Tema Claro, Elegante e Acessível
 * Otimizado para terceira idade
 * ============================================================
 */

/* ============================================================
   VARIÁVEIS E RESET
============================================================ */
:root {
    /* Cores principais */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    
    /* Cores de fundo */
    --bg-body: #f8fafc;
    --bg-white: #ffffff;
    --bg-light: #f1f5f9;
    --bg-card: #ffffff;
    
    /* Cores de texto */
    --text-dark: #1e293b;
    --text-body: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    /* Cores das loterias */
    --mega-sena: #209869;
    --lotofacil: #930089;
    --quina: #260085;
    --lotomania: #f78100;
    --timemania: #00ff48;
    --dupla-sena: #a61324;
    --dia-sorte: #cb8327;
    --super-sete: #a8cf45;
    --mais-milionaria: #071a53;
    
    /* Outras cores */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    
    /* Bordas */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Fontes - maiores para acessibilidade */
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-sm: 0.938rem;
    --font-size-base: 1.063rem;
    --font-size-lg: 1.188rem;
    --font-size-xl: 1.375rem;
    --font-size-2xl: 1.625rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    
    /* Transições */
    --transition: all 0.3s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.7;
    color: var(--text-body);
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   TIPOGRAFIA
============================================================ */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }

p { margin-bottom: 1rem; }

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

a:hover {
    color: var(--primary-dark);
}

/* ============================================================
   LAYOUT
============================================================ */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: var(--font-size-3xl);
    margin-bottom: 10px;
}

.section-title p {
    color: var(--text-muted);
    font-size: var(--font-size-lg);
}

/* ============================================================
   HEADER
============================================================ */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--text-dark);
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.logo span {
    background: linear-gradient(135deg, var(--primary), var(--mega-sena));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navegação */
.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav a {
    padding: 12px 20px;
    color: var(--text-body);
    font-weight: 600;
    font-size: var(--font-size-base);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav a:hover,
.nav a.active {
    background: var(--bg-light);
    color: var(--primary);
}

/* Menu Mobile */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 3px;
    transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ============================================================
   HERO SECTION
============================================================ */
.hero {
    background: linear-gradient(135deg, var(--bg-white) 0%, var(--bg-light) 100%);
    padding: 60px 0 80px;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-white);
    padding: 10px 24px;
    border-radius: 50px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--success);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 2px solid var(--success);
}

.hero-badge .pulse {
    width: 12px;
    height: 12px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 20px;
    color: var(--text-dark);
}

.hero-title span {
    background: linear-gradient(135deg, var(--primary), var(--mega-sena));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: var(--font-size-xl);
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 30px;
}

/* ============================================================
   CARDS DE LOTERIAS
============================================================ */
.lottery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.lottery-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.05);
}

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

.lottery-card-header {
    padding: 24px 24px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lottery-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lottery-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    font-weight: 700;
}

.lottery-icon.mega-sena { background: var(--mega-sena); }
.lottery-icon.lotofacil { background: var(--lotofacil); }
.lottery-icon.quina { background: var(--quina); }
.lottery-icon.lotomania { background: var(--lotomania); }
.lottery-icon.timemania { background: var(--timemania); color: var(--text-dark); }
.lottery-icon.dupla-sena { background: var(--dupla-sena); }
.lottery-icon.dia-sorte { background: var(--dia-sorte); }
.lottery-icon.super-sete { background: var(--super-sete); color: var(--text-dark); }
.lottery-icon.mais-milionaria { background: var(--mais-milionaria); }

.lottery-name {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.lottery-contest {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.lottery-date {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-align: right;
}

.lottery-card-body {
    padding: 0 24px 24px;
}

/* Números sorteados */
.numbers-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.number-ball {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: white;
    background: var(--mega-sena);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.number-ball.mega-sena { background: var(--mega-sena); }
.number-ball.lotofacil { background: var(--lotofacil); }
.number-ball.quina { background: var(--quina); }
.number-ball.lotomania { background: var(--lotomania); }
.number-ball.timemania { background: var(--timemania); color: var(--text-dark); }
.number-ball.dupla-sena { background: var(--dupla-sena); }
.number-ball.dia-sorte { background: var(--dia-sorte); }
.number-ball.super-sete { background: var(--super-sete); color: var(--text-dark); }
.number-ball.mais-milionaria { background: var(--mais-milionaria); }

/* Prêmio */
.prize-box {
    background: linear-gradient(135deg, var(--bg-light), var(--bg-white));
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    border: 2px solid var(--bg-light);
}

.prize-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.prize-value {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--success);
}

.prize-value.jackpot {
    color: var(--warning);
    animation: glow 2s infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 5px rgba(245, 158, 11, 0.5); }
    50% { text-shadow: 0 0 20px rgba(245, 158, 11, 0.8); }
}

.lottery-card-footer {
    padding: 16px 24px;
    background: var(--bg-light);
    display: flex;
    gap: 12px;
}

.lottery-card-footer a {
    flex: 1;
    padding: 14px 20px;
    text-align: center;
    font-weight: 600;
    font-size: var(--font-size-base);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: white !important;
}

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

.btn-outline {
    background: var(--bg-white);
    color: var(--text-body) !important;
    border: 2px solid var(--bg-light);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary) !important;
}

/* ============================================================
   ESTATÍSTICAS
============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--bg-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--primary);
}

.stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.stat-label {
    font-size: var(--font-size-base);
    color: var(--text-muted);
}

/* ============================================================
   NEWSLETTER
============================================================ */
.newsletter {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 60px 0;
    text-align: center;
}

.newsletter h2 {
    color: white;
    margin-bottom: 16px;
}

.newsletter p {
    color: rgba(255,255,255,0.9);
    font-size: var(--font-size-lg);
    margin-bottom: 30px;
}

.newsletter-form {
    display: flex;
    gap: 16px;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 18px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
}

.newsletter-form button {
    padding: 18px 36px;
    background: var(--mega-sena);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: var(--font-size-base);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-form button:hover {
    background: #1a7d56;
    transform: scale(1.05);
}

/* ============================================================
   FOOTER
============================================================ */
.footer {
    background: var(--text-dark);
    color: rgba(255,255,255,0.8);
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: white;
    font-size: var(--font-size-lg);
    margin-bottom: 20px;
}

.footer-col a {
    display: block;
    color: rgba(255,255,255,0.7);
    padding: 8px 0;
    font-size: var(--font-size-base);
}

.footer-col a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 30px;
    text-align: center;
    font-size: var(--font-size-sm);
}

/* ============================================================
   PÁGINA DE LOTERIA
============================================================ */
.lottery-hero {
    padding: 50px 0;
    text-align: center;
}

.lottery-hero .lottery-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    font-size: 2rem;
}

.lottery-hero h1 {
    margin-bottom: 10px;
}

.lottery-hero .contest-info {
    font-size: var(--font-size-xl);
    color: var(--text-muted);
}

.result-main {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
}

.result-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 30px;
}

.result-numbers .number-ball {
    width: 64px;
    height: 64px;
    font-size: var(--font-size-xl);
}

.result-prizes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.prize-tier {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.prize-tier-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: 8px;
}

.prize-tier-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-dark);
}

.prize-tier-winners {
    font-size: var(--font-size-sm);
    color: var(--success);
    margin-top: 8px;
}

/* Histórico de resultados */
.results-history {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--bg-light);
}

.results-table th {
    font-weight: 700;
    color: var(--text-dark);
    background: var(--bg-light);
}

.results-table tr:hover {
    background: var(--bg-light);
}

.mini-numbers {
    display: flex;
    gap: 6px;
}

.mini-ball {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.813rem;
    font-weight: 600;
    color: white;
    background: var(--mega-sena);
}

/* Gráfico de frequência */
.frequency-chart {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-top: 30px;
}

.frequency-bars {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 8px;
    margin-top: 20px;
}

.freq-bar {
    text-align: center;
}

.freq-bar-fill {
    height: 100px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
    margin-bottom: 8px;
}

.freq-bar-value {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary);
    border-radius: var(--radius-sm);
    transition: height 0.5s ease;
}

.freq-bar-number {
    width: 36px;
    height: 36px;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.freq-bar-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================================
   PÁGINA DE ESTATÍSTICAS
============================================================ */
.stats-hero {
    background: linear-gradient(135deg, var(--bg-white), var(--bg-light));
    padding: 60px 0;
    text-align: center;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 40px 0;
}

.stats-box {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
}

.stats-box h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stats-box h3 i {
    color: var(--primary);
}

.hot-numbers,
.cold-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hot-numbers .number-ball {
    background: var(--danger);
}

.cold-numbers .number-ball {
    background: var(--info);
}

/* ============================================================
   RESPONSIVO
============================================================ */
@media (max-width: 992px) {
    .nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 16px;
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        z-index: 999;
    }
    
    .nav.active {
        opacity: 1;
        visibility: visible;
    }
    
    .nav a {
        font-size: var(--font-size-xl);
        padding: 16px 32px;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .lottery-grid {
        grid-template-columns: 1fr;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .hero {
        padding: 40px 0 60px;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .lottery-card-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .lottery-info {
        flex-direction: column;
    }
    
    .number-ball {
        width: 42px;
        height: 42px;
        font-size: var(--font-size-base);
    }
    
    .lottery-card-footer {
        flex-direction: column;
    }
    
    .results-table {
        font-size: var(--font-size-sm);
    }
    
    .results-table th,
    .results-table td {
        padding: 12px 8px;
    }
}

/* ============================================================
   UTILITÁRIOS
============================================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* Loading spinner */
.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--bg-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Tooltip */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-dark);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    z-index: 100;
}

/* Print styles */
@media print {
    .header, .footer, .newsletter, .menu-toggle {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .lottery-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
