/* enem_modal.css - Visual Refinado, Compacto e Elegante */

:root {
    --enem-primary: #0284c7; /* Azul mais sóbrio */
    --enem-primary-light: #e0f2fe;
    --enem-bg-light: #f8fafc; /* Slate 50 */
    --enem-border: #e2e8f0; /* Slate 200 */
    --enem-text-main: #1e293b; /* Slate 800 */
    --enem-text-muted: #64748b; /* Slate 500 */
}

/* Estrutura Principal - Compacta */
.enem-modal-body {
    display: flex;
    flex-direction: row;
    height: 100%;
    overflow: hidden;
    padding: 0;
    background: var(--enem-bg-light);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Sidebar - Refinada */
.enem-sidebar {
    width: 320px; /* Um pouco mais estreita */
    border-right: 1px solid var(--enem-border);
    display: flex;
    flex-direction: column;
    background: white;
}

/* Área de Filtros - Trocado o azul forte por tom neutro e compacto */
.enem-filters {
    padding: 10px; /* Padding reduzido */
    display: flex;
    flex-direction: column;
    gap: 6px; /* Gaps menores */
    border-bottom: 1px solid var(--enem-border);
    background: #f1f5f9; /* Slate 100 - Mais neutro */
}

.enem-filters input, .enem-filters select {
    width: 100%;
    padding: 6px 10px; /* Inputs mais baixos */
    border: 1px solid var(--enem-border);
    border-radius: 6px; /* Bordas mais suaves */
    font-size: 13px;
    color: var(--enem-text-main);
    background-color: white;
    transition: border-color 0.2s;
}

.enem-filters input:focus, .enem-filters select:focus {
    outline: none;
    border-color: var(--enem-primary);
    box-shadow: 0 0 0 2px var(--enem-primary-light);
}

.enem-results-count {
    font-size: 11px;
    color: var(--enem-text-muted);
    text-align: right;
    margin-top: 2px;
}

/* Lista de Itens - Super Compacta e Elegante */
.enem-list {
    flex: 1;
    overflow-y: auto;
    padding: 5px 0;
}

.enem-list-item {
    padding: 8px 12px; /* Reduzido o padding vertical */
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s;
}

.enem-list-item:hover {
    background: #f8fafc;
}

/* Item selecionado - Destaque elegante */
.enem-list-item.selected {
    background: var(--enem-primary-light);
    border-left: 3px solid var(--enem-primary);
}

.enem-list-item h4 {
    margin: 0 0 2px 0;
    font-size: 13px;
    font-weight: 600; /* Negrito mais leve */
    color: var(--enem-text-main);
    /* Garante que o título não estoure em duas linhas */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Se for selecionado, a cor do título muda */
.enem-list-item.selected h4 {
    color: #0369a1;
}

.enem-list-item p {
    margin: 0;
    font-size: 11px;
    color: var(--enem-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Área de Pré-visualização - Mais Limpa */
.enem-preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.enem-preview {
    flex: 1;
    padding: 15px 25px; /* Reduzido padding vertical (top/bottom) */
    overflow-y: auto;
    font-size: 13px; /* Fonte ligeiramente menor */
    line-height: 1.6;
    color: var(--enem-text-main);
}

/* Hierarquia de texto na pré-visualização */
.enem-preview h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--enem-primary);
    margin: 0 0 10px 0;
    border-bottom: 2px solid var(--enem-primary-light);
    padding-bottom: 5px;
}

/* Imagens dentro da pré-visualização, centralizadas */
.enem-preview img {
    max-width: 90%;
    height: auto;
    display: block;
    margin: 8px auto;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Alternativas - Visual "Pill" Elegante */
.enem-preview-alt {
    padding: 6px 12px;
    margin-bottom: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 20px; /* Estilo pílula */
    background: #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

/* O texto da alternativa não deve ser todo negrito */
.enem-preview-alt strong {
    color: var(--enem-primary);
    font-weight: 700;
}

/* Alternativa correta - Refinada */
.enem-preview-alt.correct {
    background: #dcfce7; /* Verde suave */
    border-color: #86efac;
    color: #166534;
    font-weight: 500;
}

.enem-preview-alt.correct strong {
    color: #166534;
}

/* Rodapé do Modal - Compacto */
.enem-preview-footer {
    padding: 8px 15px; /* Padding reduzido */
    border-top: 1px solid var(--enem-border);
    display: flex;
    justify-content: flex-end;
    background: #f1f5f9;
}

/* Ajuste do botão no rodapé para ficar mais baixo */
.enem-preview-footer .btn-primary {
    padding: 6px 15px;
    font-size: 13px;
    border-radius: 6px;
}

/* --- ANIMAÇÃO DE DOWNLOAD DO BANCO --- */
.enem-download-overlay {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(3px);
    display: none; /* Começa escondido */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.enem-download-box {
    background: white;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 350px;
}

.enem-download-box i {
    font-size: 48px;
    color: #0284c7;
    margin-bottom: 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin { 
    100% { transform: rotate(360deg); } 
}

.enem-download-box h3 {
    margin: 0 0 10px 0;
    color: #1e293b;
    font-size: 18px;
}

.enem-download-box p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}