/* ==========================================================================
   SIMULADOS OFICIAIS - VISUAL LUMUS PREMIUM (V2.1 - RESPONSIVO MELHORADO)
   ========================================================================== */

:root {
    --blue-primary: #1D4A91;       /* Azul Institucional */
    --blue-dark: #0d1b2a;          /* Azul Escuro */
    --bg-beige: #F5EFE6;           /* Fundo Lumus */
    --card-white: #FFFFFF;
    --text-dark: #333;
    --border: #D1C4B0;
    --success: #28a745;
    --error: #dc3545;
    --info: #3B82F6;
    --warning: #F59E0B;
    --gray: #9CA3AF;
}

/* 1. RESET GERAL & FUNDO */
body, 
html,
#page, 
.site, 
.content-area {
    background-color: var(--bg-beige) !important;
    font-family: 'Segoe UI', sans-serif;
}

#csh-root {
    width: 100%;
    min-height: 100vh;
    padding: 30px 15px;
    color: var(--text-dark);
}

.lumus-container-limitado {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

/* 2. DASHBOARD WRAPPER */
.csh-dashboard {
    animation: fadeIn 0.6s ease-out forwards;
}

/* 3. HEADER PRINCIPAL */
.csh-header-main {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--blue-primary), #2C5282);
    border-radius: 15px;
    color: white;
    box-shadow: 0 10px 25px rgba(30, 58, 95, 0.2);
}

.csh-title {
    color: white;
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
}

.csh-desc {
    color: #E2E8F0;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 400;
    opacity: 0.9;
}

/* 4. GRID DE CARDS */
.csh-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
    align-items: start;
    margin-bottom: 50px;
}

@media (max-width: 1024px) {
    .csh-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 800px) {
    .csh-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* 5. CARDS & ESTRUTURA */
.csh-card {
    background: var(--card-white);
    border-radius: 12px;
    border: 2px solid var(--border);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.csh-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(30, 58, 95, 0.15);
}

.csh-card-header {
    background: var(--bg-beige);
    padding: 20px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
}

.csh-card-header h2 {
    color: var(--blue-primary) !important;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.csh-card-header svg {
    width: 20px;
    height: 20px;
    stroke: var(--blue-primary);
    flex-shrink: 0;
}

.csh-card-body {
    padding: 25px;
}

/* 6. FORMULÁRIOS */
.csh-form-group {
    margin-bottom: 20px;
}

.csh-form-group:last-child {
    margin-bottom: 0;
}

.csh-form-group label {
    display: block;
    color: var(--blue-primary);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

/* SELECT */
.csh-select {
    width: 100%;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.95rem;
    color: var(--text-dark);
    background: white;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231D4A91' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 35px;
}

.csh-select:hover {
    border-color: var(--blue-primary);
}

.csh-select:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(29, 74, 145, 0.1);
}

/* RADIO GROUP */
.csh-radio-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.csh-radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--card-white);
    flex: 1;
    min-width: 140px;
    position: relative;
}

.csh-radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.csh-radio-option .label {
    color: var(--gray);
    font-weight: 600;
    font-size: 0.95rem;
    flex: 1;
}

.csh-radio-option:hover {
    border-color: var(--blue-primary);
    background: #F8FAFC;
}

.csh-radio-option.selected {
    background: var(--blue-primary);
    border-color: var(--blue-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(29, 74, 145, 0.2);
}

.csh-radio-option.selected .label {
    color: white;
}

/* BOTÕES */
.csh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Segoe UI', sans-serif;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    padding: 15px;
}

.csh-btn.primary,
#iniciar-prova-btn {
    background: var(--blue-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(29, 74, 145, 0.15);
}

.csh-btn.primary:hover,
#iniciar-prova-btn:hover {
    background: #153a72;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(29, 74, 145, 0.25);
}

.csh-btn.primary:active,
#iniciar-prova-btn:active {
    transform: translateY(0);
}

.csh-btn svg,
#iniciar-prova-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    flex-shrink: 0;
}

.csh-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none !important;
}

.btn-voltar-selecao {
    color: var(--text-dark);
    background: transparent;
    border: 2px solid var(--border);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    width: auto;
}

.btn-voltar-selecao:hover {
    background: var(--bg-beige);
    color: var(--blue-primary);
    border-color: var(--blue-primary);
}

/* 7. HISTÓRICO */
#historico-list {
    min-height: 150px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.loading-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--gray);
    font-weight: 600;
    min-height: 150px;
}

.loading-placeholder svg {
    width: 20px;
    height: 20px;
    animation: spin 2s linear infinite;
}

.historico-item {
    padding: 16px;
    background: var(--bg-beige);
    border: 2px solid var(--border);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
    flex-wrap: wrap;
    gap: 12px;
}

.historico-item:hover {
    background: #FFFFFF;
    border-color: var(--blue-primary);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(29, 74, 145, 0.1);
}

.historico-info {
    flex: 1;
    min-width: 150px;
}

.historico-titulo {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.historico-meta {
    color: var(--gray);
    font-size: 0.85rem;
}

.historico-score {
    background: var(--success);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    min-width: 70px;
    text-align: center;
}

/* 8. ÁREA DE RENDERIZAÇÃO DO SIMULADO */
#simulado-render-area {
    display: none;
}

#simulado-render-area.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

/* SIMULADO - HEADER */
.simulado-header {
    background: linear-gradient(135deg, var(--blue-primary), #2C5282);
    padding: 20px;
    border-radius: 12px 12px 0 0;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.2);
    gap: 20px;
    flex-wrap: wrap;
}

.simulado-header h2 {
    color: white !important;
    font-size: 1.4rem;
    font-weight: 700;
    text-shadow: none;
    margin: 0;
    flex: 1;
    min-width: 200px;
}

.simulado-controls {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.simulado-timer {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 16px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.2rem;
    color: #F5EFE6;
}

/* TOGGLE SWITCH */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
}

.toggle-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #666;
    transition: 0.3s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    top: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--success);
}

input:checked + .slider:before {
    transform: translateX(18px);
}

/* QUESTÕES */
.simulado-questoes-list {
    background: var(--card-white);
    padding: 20px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.08);
    border: 2px solid var(--border);
    border-top: none;
}

.questao-item {
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: 8px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
    background: var(--bg-beige);
}

.questao-item:hover {
    border-color: var(--blue-primary);
    box-shadow: 0 4px 12px rgba(29, 74, 145, 0.1);
    transform: translateX(2px);
}

.questao-numero {
    color: var(--blue-primary);
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.questao-texto {
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

/* RESULTADO */
.resultado-container {
    background: var(--card-white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.08);
    text-align: center;
    margin-bottom: 40px;
    border: 2px solid var(--border);
    position: relative;
    overflow: hidden;
}

.resultado-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--blue-primary), var(--border));
}

.resultado-titulo {
    color: var(--blue-primary);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.resultado-subtitle {
    color: var(--gray);
    font-size: 0.95rem;
    margin: 0 0 25px 0;
}

.resultado-stats {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-beige);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    min-width: 100px;
    transition: all 0.2s ease;
}

.stat-box:hover {
    transform: translateY(-3px);
    border-color: var(--blue-primary);
    box-shadow: 0 4px 12px rgba(29, 74, 145, 0.1);
}

.stat-val {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--gray);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-box.acerto .stat-val { color: var(--success); }
.stat-box.erro .stat-val { color: var(--error); }
.stat-box.chute-certo .stat-val { color: var(--info); }
.stat-box.chute-errado .stat-val { color: var(--warning); }
.stat-box.branco .stat-val { color: var(--gray); }

.chart-container {
    margin: 25px auto 0;
    padding: 20px;
    background: var(--card-white);
}

/* 9. UTILITÁRIOS E ANIMAÇÕES */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.spin {
    animation: spin 2s linear infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* RESPONSIVIDADE */
@media (max-width: 768px) {
    #csh-root {
        padding: 20px 10px;
    }
    
    .lumus-container-limitado {
        padding: 0 10px;
    }

    .csh-header-main {
        padding: 30px 15px;
        margin-bottom: 25px;
    }

    .csh-title {
        font-size: 1.6rem;
    }
    
    .csh-desc {
        font-size: 0.95rem;
    }
    
    .csh-radio-group {
        flex-direction: column;
    }
    
    .csh-radio-option {
        min-width: 100%;
    }

    .csh-card-body {
        padding: 18px;
    }

    .csh-form-group label {
        font-size: 0.9rem;
    }

    .csh-select {
        font-size: 0.9rem;
        padding: 10px 10px 10px 12px;
    }
    
    .simulado-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
        gap: 15px;
    }

    .simulado-header h2 {
        font-size: 1.2rem;
        width: 100%;
    }
    
    .simulado-controls {
        width: 100%;
        gap: 12px;
    }

    .simulado-timer {
        font-size: 1rem;
        padding: 5px 12px;
    }

    .toggle-wrapper {
        padding: 3px 10px;
    }

    .toggle-label {
        font-size: 0.75rem;
    }

    .simulado-questoes-list {
        padding: 15px;
    }

    .questao-item {
        padding: 15px;
        margin-bottom: 15px;
    }

    .questao-texto {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .historico-item {
        padding: 12px;
        gap: 8px;
    }

    .historico-titulo {
        font-size: 0.9rem;
    }

    .historico-meta {
        font-size: 0.8rem;
    }

    .historico-score {
        padding: 4px 10px;
        font-size: 0.8rem;
        min-width: 60px;
    }
    
    .resultado-stats {
        gap: 8px;
    }
    
    .stat-box {
        min-width: 80px;
        padding: 12px 10px;
    }

    .stat-val {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .resultado-titulo {
        font-size: 1.5rem;
    }

    .resultado-subtitle {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    #csh-root {
        padding: 15px 8px;
    }

    .lumus-container-limitado {
        padding: 0 8px;
    }

    .csh-header-main {
        padding: 20px 12px;
        margin-bottom: 20px;
        border-radius: 10px;
    }

    .csh-title {
        font-size: 1.4rem;
        margin-bottom: 8px;
    }

    .csh-desc {
        font-size: 0.9rem;
    }

    .csh-card {
        border-radius: 10px;
    }

    .csh-card-header h2 {
        font-size: 1.1rem;
    }

    .csh-card-body {
        padding: 15px;
    }

    .simulado-header {
        padding: 12px;
    }

    .simulado-header h2 {
        font-size: 1.1rem;
    }

    .simulado-timer {
        font-size: 0.95rem;
        padding: 4px 10px;
    }

    .questao-item {
        padding: 12px;
        margin-bottom: 12px;
    }

    .questao-numero {
        font-size: 0.9rem;
    }

    .questao-texto {
        font-size: 0.85rem;
    }

    .stat-box {
        min-width: 70px;
        padding: 10px 8px;
    }

    .stat-val {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .csh-btn {
        padding: 12px;
        font-size: 0.9rem;
    }

    .btn-voltar-selecao {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}