/* ===== ESTILOS GERAIS ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
}

#app-container {
    background-color: var(--surface);
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    width: 95%;
    max-width: 800px;
    text-align: center;
    margin: 24px auto;
}

.site-header {
    width: 100%;
    align-self: stretch;
}

.site-header .container {
    max-width: 800px;
    margin: 0 auto;
}

#app-container {
    width: 100%;
    max-width: 800px;
}

.site-header .logo {
    font-size: 1.8rem;
    letter-spacing: -0.2px;
}

#app-container,
.welcome-card,
#pergunta-container,
.conceito-card,
.stat-card,
.resultado-item {
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.welcome-card:hover,
.conceito-card:hover,
.resultado-item:hover {
    box-shadow: var(--shadow-hover);
}

.site-header .subtitle,
.site-header .tagline {
    color: rgba(255, 255, 255, 0.88);
}

[data-theme="dark"] .welcome-card,
[data-theme="dark"] #pergunta-container,
[data-theme="dark"] #bloom-info,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .resumo-container,
[data-theme="dark"] .conceito-card,
[data-theme="dark"] #historico-resultados,
[data-theme="dark"] #pontuacao-final {
    background: #1f2937;
    color: var(--text);
}

[data-theme="dark"] .alternativa-wrapper,
[data-theme="dark"] .resultado-item {
    background: #111827;
    border-color: var(--border);
}

[data-theme="dark"] footer {
    color: var(--muted);
}

/* ===== TELA DE INÍCIO ===== */
#inicio-area {
    text-align: center;
}

#inicio-area h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5em;
}

#inicio-area .subtitle {
    color: #7f8c8d;
    font-size: 1.2em;
    margin-bottom: 30px;
}

.welcome-card {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    padding: 25px;
    border-radius: 12px;
    margin: 20px 0;
    border-left: 6px solid #3498db;
}

.nome-input-group {
    margin: 25px 0;
}

.nome-input-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.nome-input-group input {
    width: 100%;
    max-width: 300px;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1.1em;
    text-align: center;
    transition: border-color 0.3s ease;
}

.nome-input-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.2);
}

/* ===== CABEÇALHO DO QUIZ ===== */
header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.2em;
}

header .subtitle {
    color: #7f8c8d;
    font-size: 1.1em;
    margin-bottom: 25px;
}

.usuario-info {
    background: linear-gradient(135deg, #d5f4e6 0%, #a8e6cf 100%);
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
    margin-bottom: 20px;
    font-weight: 600;
    color: #27ae60;
}

/* ===== ÁREA DA PERGUNTA ===== */
#pergunta-container {
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 12px;
    border-left: 6px solid #3498db;
}

#numero-questao {
    font-size: 1em;
    color: #555;
    margin-bottom: 8px;
    font-weight: 600;
}

#conceito-questao {
    font-size: 0.9em;
    color: #8e44ad;
    margin-bottom: 8px;
    font-weight: 500;
}

#pergunta-texto {
    font-size: 1.3em;
    color: #2c3e50;
    margin: 0;
    line-height: 1.4;
}

/* ===== INFORMAÇÕES DE BLOOM ===== */
#bloom-info {
    background: linear-gradient(135deg, #fff3e0 0%, #e8f5e8 100%);
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    border-left: 4px solid #ff9800;
}

.bloom-nivel {
    font-weight: bold;
    color: #e65100;
    font-size: 1.1em;
    margin-bottom: 8px;
}

.bloom-justificativa {
    color: #2e7d32;
    font-style: italic;
    line-height: 1.3;
}

/* ===== ALTERNATIVAS ===== */
.alternativa-wrapper {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 15px;
    padding: 12px 18px;
    transition: all 0.3s ease;
}

.alternativa-wrapper:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.alternativa-label {
    font-weight: bold;
    margin-right: 12px;
    color: #3498db;
    min-width: 25px;
    font-size: 1.1em;
}

.alternativa-texto {
    flex-grow: 1;
    text-align: left;
    font-size: 1.05em;
    line-height: 1.3;
}

/* ===== CANVAS DE RASPADINHA ===== */
.raspadinha-canvas {
    width: 130px;
    height: 40px;
    border: 2px dashed #6c757d;
    border-radius: 8px;
    cursor: grab;
    margin-left: 15px;
    flex-shrink: 0;
    touch-action: none;
    transition: opacity 0.3s ease;
}

.raspadinha-canvas:active {
    cursor: grabbing;
}

.raspadinha-canvas.disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

/* ===== FEEDBACK E BOTÕES ===== */
#feedback-area {
    margin-top: 25px;
    min-height: 30px;
}

#feedback-usuario {
    font-size: 1.2em;
    font-weight: bold;
    padding: 10px;
    border-radius: 8px;
}

/* ===== BOTÕES ===== */
button {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 999px;
    font-size: 1.1em;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
    margin: 10px 5px;
    font-weight: 600;
}

button:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:active {
    transform: scale(0.98);
}

#btn-proxima,
#btn-iniciar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

#btn-proxima:hover,
#btn-iniciar:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

#btn-iniciar {
    font-size: 1.2em;
    padding: 16px 32px;
}

#btn-reiniciar {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

#btn-reiniciar:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-secondary {
    background: var(--surface) !important;
    color: var(--primary) !important;
    border: 2px solid var(--primary) !important;
}

.btn-secondary:hover {
    background: var(--primary) !important;
    color: #fff !important;
}

.botoes-finais {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

/* ===== RESULTADO FINAL ===== */
#resultado-final-area {
    text-align: center;
}

#resultado-final-area h2 {
    color: #2c3e50;
    font-size: 2em;
    margin-bottom: 20px;
}

.mensagem-motivacional {
    font-size: 1.3em;
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 12px;
    font-weight: 600;
}

.mensagem-excelente {
    background: linear-gradient(135deg, #d5f4e6 0%, #a8e6cf 100%);
    color: #27ae60;
}

.mensagem-bom {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b3 100%);
    color: #e67e22;
}

.mensagem-pode-melhorar {
    background: linear-gradient(135deg, #fdeaa7 0%, #ffccaa 100%);
    color: #e74c3c;
}

#pontuacao-final {
    font-size: 1.4em;
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #e8f4f8 0%, #f8e8f4 100%);
    border-radius: 10px;
    font-weight: 600;
}

/* ===== ESTATÍSTICAS ===== */
#estatisticas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-card {
    background: linear-gradient(135deg, #e8f4f8 0%, #f8e8f4 100%);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #3498db;
}

.stat-title {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.2em;
    color: #3498db;
    font-weight: 600;
}

/* ===== DASHBOARD DE CONCEITOS ===== */
#dashboard-conceitos {
    margin: 30px 0;
}

#dashboard-conceitos h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.resumo-container {
    background: linear-gradient(135deg, #e8f4f8 0%, #f8e8f4 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid #3498db;
}

.resumo-header {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1.1em;
}

#resumo-conceitos {
    font-size: 1em;
    color: #555;
    line-height: 1.6;
}

.conceito-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    margin: 15px 0;
    padding: 20px;
    border-radius: 12px;
    border-left: 6px solid #3498db;
}

.conceito-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 15px;
}

.conceito-nome {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.05em;
}

.conceito-score {
    font-size: 1.1em;
    font-weight: bold;
    color: #3498db;
    white-space: nowrap;
}

.conceito-barra {
    background-color: #e9ecef;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin: 10px 0;
}

.conceito-progresso {
    height: 100%;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    transition: width 0.8s ease;
}

.conceito-detalhes {
    font-size: 0.95em;
    color: #6c757d;
    margin-top: 12px;
    line-height: 1.6;
}

/* ===== HISTÓRICO ===== */
#historico-resultados {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border-left: 4px solid #6c757d;
}

#historico-resultados h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.resultado-item {
    background: white;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 3px solid #3498db;
    text-align: left;
}

.resultado-header {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.resultado-info {
    font-size: 0.9em;
    color: #6c757d;
}

/* ===== STATUS DE ARMAZENAMENTO ===== */
.storage-status {
    margin: 20px 0;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9em;
    background: linear-gradient(135deg, #d5f4e6 0%, #a8e6cf 100%);
    color: #27ae60;
}

/* ===== FOOTER ===== */
footer {
    margin-top: 30px;
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

/* ===== ANIMAÇÕES ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 600px) {
    #app-container {
        padding: 20px;
    }
    
    .alternativa-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .raspadinha-canvas {
        margin-left: 0;
        margin-top: 10px;
        align-self: center;
    }

    .conceito-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .botoes-finais {
        flex-direction: column;
        align-items: center;
    }

    .botoes-finais button {
        width: 100%;
        max-width: 300px;
    }
}

/* ===== REFINO VISUAL FINAL ===== */
#inicio-area h1,
header h1,
#resultado-final-area h2,
.resultado-header,
.conceito-nome,
.stat-title {
    color: var(--text);
}

#inicio-area .subtitle,
header .subtitle,
.resultado-info,
#resumo-conceitos {
    color: var(--muted);
}

.nome-input-group input,
.alternativa-wrapper,
.resultado-item,
.raspadinha-canvas {
    border-color: var(--border);
}

.welcome-card,
#pergunta-container,
#bloom-info,
.stat-card,
.resumo-container,
.conceito-card,
#historico-resultados,
#pontuacao-final,
.storage-status {
    border-radius: var(--radius);
}

[data-theme="dark"] .usuario-info {
    background: rgba(16, 185, 129, 0.24);
    color: #a7f3d0;
}
