/* --- MAPA DA BASE UI (V20 - Compact Sidebar) --- */

:root {
    --mapa-bg: #020617;
    --mapa-card: rgba(15, 23, 42, 0.85);
    --mapa-border: rgba(255,255,255,0.08);
    --mapa-primary: #4f46e5;
    --mapa-cyan: #06b6d4;
    --mapa-text: #f8fafc;
    --mapa-muted: #94a3b8;
    --mapa-danger: #ef4444;
    --mapa-success: #10b981;
    --mapa-gold: #d4af37;
}

body.page-template-page-mapa-da-base {
    background-color: var(--mapa-bg) !important;
    color: var(--mapa-text);
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), 
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center top;
    background-attachment: fixed;
    min-height: 100vh;
}

/* 1. Container Geral */
#metria-mapa {
    padding: 0.5rem 1rem 2rem 1rem;
    min-height: 85vh;
    max-width: 1280px;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
}

/* Utilitários */
.hidden { display: none !important; }
.full-width { width: 100%; }
.highlight { color: var(--mapa-cyan); text-shadow: 0 0 20px rgba(6, 182, 212, 0.4); }

/* --- TELA 1: SELEÇÃO --- */
.hero-mapa { text-align: center; margin-bottom: 4rem; margin-top: 2rem; }
.hero-mapa h1 { font-size: 3rem; font-weight: 800; margin-bottom: 0.8rem; color: white; letter-spacing: -0.02em; }
.hero-mapa p { color: var(--mapa-muted); font-size: 1.15rem; }

/* GRID COMPACTO */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 1.5rem;
    padding-bottom: 3rem;
    max-width: 980px; 
    margin: 0 auto;
    align-items: start; 
}

/* WRAPPER DO GRUPO */
.ma-card-group-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto; 
}

/* CARD PRINCIPAL */
.level-card {
    background: var(--mapa-card);
    border: 1px solid var(--mapa-border);
    border-radius: 24px;
    padding: 2rem 1.5rem;
    position: relative; overflow: hidden;
    backdrop-filter: blur(12px);
    cursor: pointer;
    transition: transform 0.1s ease-out, border-color 0.1s ease-out; 
    display: flex; flex-direction: column; align-items: center; text-align: center;
    width: 100%; 
    box-sizing: border-box;
    min-height: 410px; 
}

.level-card:hover {
    border-color: rgba(6, 182, 212, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

/* --- ESTILO VIP (DIAGNÓSTICO PROFUNDO) --- */
.level-card.vip-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(45, 35, 18, 0.4) 100%);
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.08), inset 0 0 10px rgba(212, 175, 55, 0.02);
}
.level-card.vip-card:hover {
    border-color: rgba(212, 175, 55, 0.6);
    transform: translateY(-4px); 
}
.level-card.vip-card .level-icon {
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.3));
}

.level-icon { font-size: 2.8rem; margin-bottom: 1.2rem; }
.level-card h3 { font-size: 1.4rem; margin-bottom: 0.8rem; color: white; font-weight: 700; }
.meta-list { list-style: none; display: flex; gap: 15px; justify-content: center; padding: 0; font-size: 0.85rem; color: var(--mapa-muted); margin-bottom: 1.8rem; margin-top: auto; }
.meta-list i { color: var(--mapa-primary); margin-right: 5px; }
.level-card p { font-size: 0.95rem; color: #cbd5e1; margin-bottom: 2rem; line-height: 1.5; flex-grow: 1; }

/* BOTÕES DOS CARDS */
.btn-ghost {
    background: rgba(255, 255, 255, 0.03); 
    border: 1px solid var(--mapa-border);
    color: var(--mapa-muted); 
    padding: 10px 24px; border-radius: 12px; font-weight: 600;
    pointer-events: none; transition: 0.1s; 
    display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.9rem;
    width: 100%; 
}
.level-card:hover .btn-ghost { 
    background: var(--mapa-primary); 
    border-color: var(--mapa-primary); 
    color: white; 
}

/* BOTÃO VIP */
.level-card.vip-card .btn-ghost {
    color: #fde047; 
    border-color: rgba(180, 138, 32, 0.4);
    background: rgba(180, 138, 32, 0.2);
}
.level-card.vip-card:hover .btn-ghost {
    background: linear-gradient(90deg, #d4af37, #fcd34d);
    border-color: #d4af37; 
    color: #020617; 
    box-shadow: none; 
}

/* BADGES */
.badge {
    position: absolute; top: 16px; right: 16px; padding: 5px 10px; border-radius: 8px; 
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    background: rgba(255,255,255,0.05); border: 1px solid var(--mapa-border); color: #cbd5e1;
}
.badge.standard {
    color: #a5b4fc; 
    border-color: rgba(165, 180, 252, 0.2);
    background: rgba(165, 180, 252, 0.1);
}
.badge.vip {
    color: #fde047;
    border-color: rgba(212, 175, 55, 0.3);
    background: rgba(212, 175, 55, 0.1);
    display: flex; align-items: center; gap: 5px;
}

/* --- BOTÃO DE HISTÓRICO --- */
.ma-btn-history {
    display: block;
    width: 100%;
    margin-top: 24px; 
    padding: 10px 0;
    background: transparent;
    border: 1px solid transparent; 
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.4); 
    transition: all 0.3s ease;
}
.ma-btn-history:hover {
    color: rgba(255, 255, 255, 0.9); 
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}
.ma-btn-history i { margin-right: 6px; font-size: 0.8rem; }


/* --- TELA 2: QUIZ INTERFACE (RE-COMPACTADA) --- */
.quiz-interface {
    display: grid;
    grid-template-columns: 1fr 280px; 
    gap: 2rem;
    align-items: start;
    margin-top: 2rem;
    max-width: 1280px;
    margin-left: auto; margin-right: auto;
}

.quiz-content-area {
    background: var(--mapa-card);
    border: 1px solid var(--mapa-border);
    border-radius: 20px; 
    padding: 2rem;
    min-height: 400px;
    position: relative;
    backdrop-filter: blur(15px);
    width: 100%; 
    box-sizing: border-box;
}

.q-header { margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center; }

.q-badge { 
    background: rgba(79, 70, 229, 0.1); color: #a5b4fc; 
    padding: 5px 14px; border-radius: 30px; 
    font-size: 0.8rem; font-weight: 600; 
    border: 1px solid rgba(79, 70, 229, 0.2); 
}

.q-enunciado { 
    font-size: 1.1rem; 
    line-height: 1.6; 
    margin-bottom: 1.8rem; 
    color: #e2e8f0; 
}
.q-enunciado img { max-width: 100%; border-radius: 12px; margin: 1.5rem 0; border: 1px solid var(--mapa-border); }

/* LISTA DE ALTERNATIVAS */
.alternativas-list { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    gap: 10px; 
}

.alternativa-item {
    background: rgba(255,255,255,0.02);
    /* Borda padrão transparente ou sutil para não pular pixels ao selecionar */
    border: 1px solid var(--mapa-border);
    border-radius: 10px; 
    padding: 0.8rem 1rem;
    display: flex; align-items: center; gap: 1rem;
    cursor: pointer; transition: all 0.1s ease;
}
.alternativa-item:hover { background: rgba(255,255,255,0.06); border-color: #cbd5e1; }

/* SELEÇÃO LIMPA (CORREÇÃO BORDA DUPLA) */
.alternativa-item.selected { 
    /* Apenas a borda sólida, sem box-shadow para evitar duplicação */
    border-color: var(--mapa-cyan); 
    background: rgba(6, 182, 212, 0.1); 
    /* Removido o box-shadow que causava o efeito duplicado */
}

.alt-letter {
    width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--mapa-border);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: var(--mapa-muted); flex-shrink: 0;
    font-size: 0.8rem;
}
.alternativa-item.selected .alt-letter { background: var(--mapa-cyan); color: #020617; border-color: var(--mapa-cyan); }
.alt-text { font-size: 0.95rem; }

.quiz-actions { margin-top: 3rem; display: flex; justify-content: space-between; padding-top: 1.5rem; border-top: 1px solid var(--mapa-border); }


/* --- SIDEBAR (COLUNA DIREITA) --- */
.quiz-sidebar {
    background: var(--mapa-card);
    border: 1px solid var(--mapa-border);
    border-radius: 20px;
    padding: 1.5rem;
    position: sticky; top: 80px;
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 280px; box-sizing: border-box;
}

.sidebar-header { display: none; }

.question-map-label { 
    font-size: 0.85rem;
    color: var(--mapa-muted);
    margin-bottom: 0.8rem; 
    text-align: center;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em; 
}

.question-map {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-bottom: 1.5rem;
}

.q-dot {
    aspect-ratio: 1; border-radius: 6px; background: rgba(255,255,255,0.02);
    border: 1px solid var(--mapa-border); color: var(--mapa-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 500; cursor: pointer; transition: all 0.1s ease;
}
.q-dot:hover { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.05); color: white; }
.q-dot.active { background: var(--mapa-primary); color: white; border-color: var(--mapa-primary); box-shadow: 0 0 10px rgba(79, 70, 229, 0.4); transform: scale(1.05); font-weight: 700; }
.q-dot.answered { background: rgba(6, 182, 212, 0.15); border-color: rgba(6, 182, 212, 0.4); color: #22d3ee; }
.q-dot.answered.active { background: var(--mapa-primary); color: white; border-color: var(--mapa-primary); }


/* --- BOTÕES DA SIDEBAR (Finalizar/Cancelar) --- */
.sidebar-footer { 
    display: flex; flex-direction: column; gap: 12px; 
    border-top: 1px solid var(--mapa-border); padding-top: 1.5rem;
}

.btn-finish {
    width: 100%; background: var(--mapa-primary); color: white; border: none; 
    padding: 12px; border-radius: 12px; font-weight: 600; font-size: 0.95rem; cursor: pointer;
    box-shadow: none; transition: background 0.2s ease;
}
.btn-finish:hover { background: #4338ca; transform: none; }

.btn-cancel {
    width: 100%; background: transparent; border: 1px solid rgba(239, 68, 68, 0.4); 
    color: var(--mapa-danger); padding: 12px; border-radius: 12px; 
    font-weight: 600; font-size: 0.95rem; cursor: pointer;
    transition: all 0.2s ease;
}
.btn-cancel:hover { 
    background: rgba(220, 38, 38, 0.15); /* Vermelho intenso no fundo */
    color: #fca5a5; border-color: #ef4444; 
    box-shadow: none; transform: none; 
}


/* --- BOTÕES DE NAVEGAÇÃO (Anterior/Próxima) - CORRIGIDOS --- */
.btn-outline { 
    background: transparent; 
    border: 1px solid var(--mapa-border); 
    color: white; 
    padding: 10px 24px; border-radius: 10px; cursor: pointer; 
    font-weight: 600; font-size: 0.95rem;
    transition: all 0.2s ease; 
    display: flex; align-items: center; gap: 8px; 
    /* Remove outline nativo azul */
    outline: none !important; 
}

/* Hover Sutil (Só muda quando o mouse está em cima) */
.btn-outline:hover:not(:disabled) { 
    border-color: rgba(255, 255, 255, 0.4); 
    background: rgba(255, 255, 255, 0.05); 
    color: white;
}

/* Active (Quando clica e segura) - Feedback tátil leve */
.btn-outline:active:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(1px);
}

/* FIX CRUCIAL: Reseta o estado "Focus" para ser igual ao normal */
/* Isso impede que o botão fique branco/selecionado depois do clique */
.btn-outline:focus,
.btn-outline:focus-visible {
    background: transparent;
    border-color: var(--mapa-border);
    color: white;
    box-shadow: none;
}

/* Disabled */
.btn-outline:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }


/* --- RESULTADOS --- */
.results-container { text-align: center; max-width: 500px; margin: 6rem auto; padding: 3rem; background: var(--mapa-card); border-radius: 24px; border: 1px solid var(--mapa-border); backdrop-filter: blur(15px); }
.result-stats { background: rgba(0,0,0,0.2); border-radius: 16px; padding: 2rem; margin: 2rem 0; border: 1px solid var(--mapa-border); }
#res-score { color: white; text-shadow: 0 0 20px rgba(255,255,255,0.2); font-size: 3.5rem; font-weight: 800; margin: 10px 0; }
.btn-primary { background: var(--mapa-primary); color: white; padding: 14px 30px; border-radius: 10px; font-weight: 600; text-decoration: none; display: inline-block; transition: 0.1s; }
.btn-primary:hover { background: #4338ca; box-shadow: 0 0 20px rgba(79, 70, 229, 0.4); }
.spinner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: var(--mapa-cyan); font-size: 1.2rem; }

/* MOBILE */
@media (max-width: 900px) {
    .levels-grid { grid-template-columns: 1fr; }
    .quiz-interface { grid-template-columns: 1fr; }
    .quiz-sidebar { order: 2; width: 100%; position: static; margin-top: 2rem; }
    .quiz-content-area { order: 1; padding: 2rem; }
    .question-map { grid-template-columns: repeat(6, 1fr); } 
    .alternativas-list { grid-template-columns: 1fr; }
}
/* --- METRIA DIALOG (POPUP PERSONALIZADO) --- */

.ma-dialog-overlay {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ma-dialog-overlay.is-active {
    opacity: 1; visibility: visible; pointer-events: auto;
}

.ma-dialog-box {
    width: 90%; max-width: 400px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    transform: scale(0.95) translateY(10px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
}

.ma-dialog-overlay.is-active .ma-dialog-box {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.ma-dialog-icon {
    width: 60px; height: 60px; margin: 0 auto 1.5rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--mapa-primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.ma-dialog-title {
    color: white; font-size: 1.25rem; font-weight: 700;
    margin-bottom: 0.5rem; letter-spacing: -0.02em;
}

.ma-dialog-msg {
    color: var(--mapa-muted); font-size: 0.95rem; line-height: 1.6;
    margin-bottom: 2rem;
}

.ma-dialog-actions {
    display: flex; gap: 10px; justify-content: center;
}

.ma-btn-dialog {
    flex: 1; padding: 12px; border-radius: 12px; font-weight: 600; font-size: 0.9rem;
    cursor: pointer; transition: 0.2s; border: none;
}

.ma-btn-cancel {
    background: transparent; border: 1px solid rgba(255,255,255,0.1); color: var(--mapa-muted);
}
.ma-btn-cancel:hover { background: rgba(255,255,255,0.05); color: white; }

.ma-btn-confirm {
    background: var(--mapa-primary); color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.ma-btn-confirm:hover { background: #4338ca; transform: translateY(-1px); }

/* Variação de Perigo (para sair do teste) */
.ma-dialog-box.danger .ma-dialog-icon { background: rgba(239, 68, 68, 0.1); color: var(--mapa-danger); box-shadow: 0 0 20px rgba(239, 68, 68, 0.2); }
.ma-dialog-box.danger .ma-btn-confirm { background: var(--mapa-danger); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
.ma-dialog-box.danger .ma-btn-confirm:hover { background: #dc2626; }