/* ==========================================
   FONTES CUSTOMIZADAS E VARIÁVEIS
   ========================================== */
@font-face {
    font-family: 'Bundesbahn';
    src: url('../fonts/bundesbahn.otf') format('truetype');
    font-weight: normal; font-style: normal; font-display: swap;
}

/* ==========================================
   AJUSTES DA PÁGINA INICIAL (HOME)
   ========================================== */
/* Esconde o " / EXPLORAR" da topbar mobile na página principal */
.home .mobile-brand-divider,
.home .mobile-brand-module {
    display: none !important;
}

.letra-enem { font-family: 'Bundesbahn', sans-serif; font-size: 22px; display: inline-block; width: 30px; text-align: center; color: var(--fpe-text-main); }

:root {
    --fpe-bg: #f8f9fa;
    --fpe-surface: #ffffff;
    --fpe-sidebar-bg: #ffffff; 
    
    /* 🔥 Nova Paleta FpE 2.0 - Verde Militar */
    --fpe-blue-dark: #3a0ca3; /* Mantido por enquanto, podemos alterar depois se necessário */
    --fpe-blue: #3a4032;      /* <-- Novo Verde Militar! Mantive o nome da variável para não quebrar seu HTML */
    --fpe-blue-hover: #4a5240;/* <-- Um tom levemente mais claro para o efeito de hover */
    
    --fpe-text-main: #1e293b;
    --fpe-text-muted: #64748b;
    --fpe-border: #e2e8f0;
    --fpe-radius: 16px; 
    --fpe-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body { margin: 0; font-family: 'Inter', sans-serif; background-color: var(--fpe-bg); color: var(--fpe-text-main); }

.fpe-math-display {
    display: block;
    text-align: center;
    margin: 12px 0;
}

/* A FUNDAÇÃO: O FIM DA DIVISÃO LATERAL */
.fpe-admin-wrap {
    flex-direction: column !important; /* A mágica que empilha menu em cima e conteúdo embaixo */
    display: flex;
    min-height: 100vh;
}

/* ==========================================
   TOPBAR GLOBAL (DESKTOP) E GAVETA (MOBILE)
   ========================================== */
.fpe-topbar-global {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 2px solid #000;
    padding: 0 30px;
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.fpe-topbar-brand { display: flex; align-items: center; }
.fpe-brand-logo-top { height: 48px; width: auto; }
.btn-mobile-menu {
    display: none; /* Só aparece no celular */
    background: transparent; border: none; font-size: 24px; color: var(--fpe-text-main); cursor: pointer;
}

/* Container do Menu no Desktop */
.fpe-topbar-menu-container {
    display: flex; align-items: center; flex: 1; justify-content: flex-end; gap: 20px;
}
.fpe-mobile-drawer-header { display: none; }
.fpe-nav-top { display: flex; align-items: center; gap: 5px; margin: 0; padding: 0; }
.fpe-top-link {
    display: flex; align-items: center; gap: 8px; padding: 10px 15px; color: #475569;
    font-weight: 600; font-size: 14px; border-radius: 10px; text-decoration: none;
    transition: all 0.2s; cursor: pointer;
}
.fpe-top-link:hover { background-color: #f8fafc; color: var(--fpe-blue); }
.fpe-top-link.active { background-color: #eff6ff; color: var(--fpe-blue); }

/* Dropdowns (Flutuantes no Desktop) */
.fpe-dropdown-wrap { position: relative; }
.fpe-dropdown-menu {
    position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid var(--fpe-border);
    border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.05); min-width: 220px; padding: 10px;
    display: flex; flex-direction: column; gap: 5px; opacity: 0; visibility: hidden;
    transform: translateY(10px); transition: all 0.2s ease; z-index: 100;
}
.fpe-dropdown-wrap:hover .fpe-dropdown-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.fpe-dropdown-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 15px; color: #475569;
    font-size: 13px; font-weight: 600; text-decoration: none; border-radius: 8px; transition: 0.2s;
}
.fpe-dropdown-item:hover { background: #f8fafc; color: var(--fpe-blue); }

/* Usuário no Topo */
.fpe-topbar-user {
    display: flex; align-items: center; gap: 15px; padding-left: 20px; border-left: 1px solid var(--fpe-border);
}
.user-pill { display: flex; align-items: center; gap: 10px; }
.user-pill img { border-radius: 50%; border: 2px solid #f1f5f9; width: 36px; height: 36px; }
.user-pill-info { display: flex; flex-direction: column; }
.user-name-top { font-size: 13px; font-weight: 800; color: #0f172a; }
.user-role-top { font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--fpe-blue); letter-spacing: 0.5px; }

.btn-logout-top {
    background: #fef2f2; color: #ef4444; padding: 10px 12px; border-radius: 10px; font-size: 14px;
    transition: 0.2s; border: 1px solid #fee2e2; text-decoration: none; display: flex; align-items: center;
}
.btn-logout-top:hover { background: #fee2e2; }

/* <-- AJUSTE DE CONTRASTE: Letra branca no fundo Verde Militar */
.btn-login-top {
    background: var(--fpe-blue); color: #ffffff; padding: 10px 20px; border-radius: 10px; font-weight: 700;
    text-decoration: none; font-size: 14px; transition: 0.2s; display: flex; align-items: center; gap: 8px;
}
/* <-- AJUSTE DE SOMBRA: Tonalidade militar */
.btn-login-top:hover { background: var(--fpe-blue-hover); box-shadow: 0 4px 12px rgba(58, 64, 50, 0.4); color: #ffffff; }

/* MOBILE (A GAVETA LATERAL OFF-CANVAS) */
.sidebar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); z-index: 1000;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.sidebar-overlay.active { opacity: 1; pointer-events: all; }

@media(max-width: 768px) {
    .fpe-topbar-global { padding: 0 20px; }
    .btn-mobile-menu { display: block; }
    .fpe-topbar-user {
        border-left: none; padding-left: 0; padding-top: 20px; border-top: 1px solid var(--fpe-border);
        margin-top: auto; justify-content: space-between; 
    }
    .fpe-topbar-menu-container {
        position: fixed; top: 0; left: -280px; width: 260px; height: 100vh; background: #fff;
        flex-direction: column; justify-content: flex-start; align-items: stretch; padding: 20px;
        box-shadow: 5px 0 25px rgba(0,0,0,0.2); transition: left 0.3s ease; z-index: 1001; gap: 10px;
    }
    .fpe-topbar-menu-container.mobile-active { left: 0; }
    .fpe-mobile-drawer-header {
        display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
        padding-bottom: 15px; border-bottom: 1px solid var(--fpe-border);
    }
    .fpe-mobile-drawer-header img { height: 25px; }
    .btn-close-mobile { background: none; border: none; font-size: 20px; color: #64748b; cursor: pointer; }
    .fpe-nav-top { flex-direction: column; align-items: stretch; }
    
    .fpe-dropdown-wrap:hover .fpe-dropdown-menu { opacity: 0; visibility: hidden; transform: none; display: none; }
    .fpe-dropdown-wrap.mobile-open .fpe-dropdown-menu {
        display: flex; opacity: 1; visibility: visible; position: static; box-shadow: none; border: none;
        padding-left: 15px; border-left: 2px solid #e2e8f0; margin-left: 10px; margin-top: 5px; background: transparent;
    }
    .fpe-dropdown-wrap.mobile-open .drop-icon { transform: rotate(180deg); }
    .drop-icon { transition: 0.3s; margin-left: auto; }
}

/* ==========================================
   ELEMENTOS GERAIS DO FPE (Botões, Inputs, Cards)
   ========================================== */
.fpe-page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.fpe-page-header h1 { margin: 0; font-size: 24px; color: var(--fpe-text-main); }
.fpe-page-header p { margin: 5px 0 0; color: var(--fpe-text-muted); font-size: 14px; }

.fpe-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; transition: all 0.2s; border: none; }

/* <-- AJUSTE DE CONTRASTE E SOMBRA */
.fpe-btn-primary { background-color: var(--fpe-blue); color: #ffffff; font-weight: 700; }
.fpe-btn-primary:hover { background-color: var(--fpe-blue-hover); box-shadow: 0 4px 12px rgba(58, 64, 50, 0.4); }

/* Ajuste para as Tabs (Abas) do Explorador e seus ícones - <-- AJUSTE DE CONTRASTE */
.fpe-tab.active { background-color: var(--fpe-blue) !important; color: #ffffff !important; font-weight: 700; }
.fpe-tab.active i { color: #ffffff !important; }

.fpe-card { background: white; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.02); border: 1px solid var(--fpe-border); overflow: hidden; }

.fpe-label { display: block; font-weight: 600; font-size: 13px; color: var(--fpe-text-main); margin-bottom: 8px; }
.fpe-input, .fpe-textarea, select.fpe-input { width: 100%; padding: 12px; border: 1px solid var(--fpe-border); border-radius: 8px; font-family: 'Inter', sans-serif; font-size: 14px; box-sizing: border-box; transition: border-color 0.2s; background: #fafafa; }
.fpe-input:focus, .fpe-textarea:focus, select.fpe-input:focus { outline: none; border-color: var(--fpe-blue); background: white; }

/* VITRINE DE QUESTÕES */
.fpe-search-box { display: flex; gap: 15px; background: #fff; padding: 20px; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); margin-bottom: 30px; border: 1px solid #f1f5f9; }
.fpe-input-app { flex: 1; border: 2px solid #e2e8f0; border-radius: 10px; padding: 14px 20px; font-size: 15px; outline: none; transition: all 0.2s; background: #f8fafc; color: #1e293b; }
.fpe-input-app:focus { border-color: var(--fpe-blue); background: #fff; box-shadow: 0 0 0 4px rgba(58, 64, 50, 0.1); } /* <-- Sombra atualizada */
.fpe-select-app { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23475569%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"); background-repeat: no-repeat; background-position: right 1rem top 50%; background-size: 0.65rem auto; }

/* Feedback visual das alternativas nas aulas e nos shortcodes de questao */
.fpe-alt-btn {
    position: relative;
    color: #1e293b !important;
}

.fpe-alt-btn:hover {
    color: #0f172a !important;
}

.fpe-alt-btn.selected {
    background: #eff6ff !important;
    border-color: #2563eb !important;
    color: #1d4ed8 !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16), 0 10px 18px rgba(37, 99, 235, 0.12) !important;
    transform: translateY(-1px);
}

.fpe-alt-btn.selected::after {
    content: "\2713";
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
}

.fpe-alt-btn.correct::after,
.fpe-alt-btn.wrong::after,
.fpe-alt-btn.locked::after {
    display: none;
}

.fpe-alt-btn.locked {
    opacity: 1 !important;
}

.fpe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }

/* ==========================================
   CARDS ESTILO BENTO BOX (COM MOLDURA INTERNA)
   ========================================== */
.fpe-card-app {
    background: #fff;
    border: 1px solid var(--fpe-border);
    border-radius: 20px;
    padding: 12px; 
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.fpe-card-app:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    border-color: var(--fpe-blue);
}

.fpe-card-img {
    height: 160px;
    background-color: #f1f5f9;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    border-radius: 12px; 
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.fpe-card-body {
    padding: 20px 8px 5px 8px; 
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.fpe-badge-app { position: absolute; top: 15px; left: 15px; padding: 6px 14px; border-radius: 20px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); backdrop-filter: blur(4px); }
.fpe-card-subject { font-size: 12px; color: #059669; font-weight: 800; text-transform: uppercase; margin-bottom: 10px; letter-spacing: 1px; display: flex; align-items: center; gap: 5px; }
.fpe-card-title { font-size: 17px; font-weight: 800; color: #0f172a; margin: 0 0 15px 0; line-height: 1.4; transition: color 0.2s; }


@media(max-width: 768px) { .fpe-search-box { flex-direction: column; } }

/* ==========================================
   VITRINE DE QUESTÕES (O EXPLORADOR)
   ========================================== */
.fpe-search-box { display: flex; gap: 15px; background: #fff; padding: 20px; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); margin-bottom: 30px; border: 1px solid #f1f5f9; }
.fpe-input-app { flex: 1; border: 2px solid #e2e8f0; border-radius: 10px; padding: 14px 20px; font-size: 15px; outline: none; transition: all 0.2s; background: #f8fafc; color: #1e293b; }
.fpe-input-app:focus { border-color: var(--fpe-blue); background: #fff; box-shadow: 0 0 0 4px rgba(58, 64, 50, 0.1); } /* <-- Sombra ajustada */

/* AJUSTE DO DROPDOWN: Mais espaço para a seta não cortar o texto */
.fpe-select-app { 
    cursor: pointer; 
    appearance: none; 
    padding-right: 35px !important; 
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23475569%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"); 
    background-repeat: no-repeat; 
    background-position: right 1rem top 50%; 
    background-size: 0.65rem auto; 
    text-overflow: ellipsis;
}

/* ==========================================
   PAGINAÇÃO BLINDADA (FOGE DO TEMA DO SITE)
   ========================================== */
.fpe-pagination {
    grid-column: 1 / -1; 
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--fpe-border);
}

.fpe-btn-page {
    background: #fff !important; 
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
    padding: 8px 15px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 !important;
    font-family: 'Inter', sans-serif !important;
}

.fpe-btn-page:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: var(--fpe-blue) !important;
}

/* O Botão da Página Atual (Acende em Verde Militar) */
.fpe-btn-page.active {
    background: var(--fpe-blue) !important;
    border-color: var(--fpe-blue) !important;
    color: #ffffff !important; /* <-- Ajuste de contraste para texto branco! */
    box-shadow: 0 4px 10px rgba(58, 64, 50, 0.4) !important; /* <-- Sombra militar */
    pointer-events: none;
}

.fpe-pagination-dots {
    color: #94a3b8;
    font-weight: 700;
    padding: 0 5px;
}

/* ==========================================
   EDITOR DE QUESTÕES E ARTIGOS (GRID)
   ========================================== */
.fpe-editor-grid { 
    display: grid; 
    grid-template-columns: 2fr 1fr; 
    gap: 25px; 
    align-items: start; 
}

@media (max-width: 900px) { 
    .fpe-editor-grid { 
        grid-template-columns: 1fr; 
    } 
}

.fpe-textarea { 
    resize: vertical; 
}

.fpe-categories-box { 
    border: 1px solid var(--fpe-border); 
    padding: 10px; 
    border-radius: 8px; 
    max-height: 200px; 
    overflow-y: auto; 
    background: #fafafa; 
}

/* ==========================================
   BLINDAGEM E ISOLAMENTO DOS CARDS
   ========================================== */

/* 1. Limite físico do Card */
.fpe-card-app {
    display: flex !important;
    flex-direction: column !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important; 
    border-radius: 18px !important; 
    padding: 15px !important; 
    overflow: hidden !important; 
    text-decoration: none !important;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.08) !important; 
    transition: all 0.3s ease;
}

/* Efeito Hover: O Card pula pra fora da tela */
.fpe-card-app:hover {
    transform: translateY(-5px); 
    box-shadow: 0 15px 25px -5px rgba(0,0,0,0.1); 
    border-color: var(--fpe-blue); 
}

/* 2. Área da Imagem */
.fpe-card-img {
    height: 180px; 
    width: 100%;
    position: relative;
    display: flex;
    align-items: flex-end; 
    padding: 15px;
    box-sizing: border-box;
    border-radius: 10px;
}

/* 3. Área de Texto e Conteúdo */
.fpe-card-body {
    padding: 15px 5px 5px 5px; 
    display: flex;
    flex-direction: column;
    flex: 1; 
}

/* O Título */
.fpe-card-title {
    font-size: 17px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fpe-card-excerpt {
    font-size: 13px;
    color: #64748b; 
    margin: 10px 0 15px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 4. O Botão (Call to Action) */
.fpe-card-btn {
    background-color: #f8fafc;
    color: #0f172a; 
    padding: 12px;
    font-size: 14px;
    font-weight: 800; 
    border-radius: 8px;
    text-align: center;
    margin-top: auto;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

/* <-- AJUSTE DE CONTRASTE: Botão acende junto com o Hover do card */
.fpe-card-app:hover .fpe-card-btn {
    background-color: var(--fpe-blue);
    color: #ffffff; /* <-- Letra branca garantida sobre o fundo verde-militar! */
    border-color: var(--fpe-blue);
}

/* ==========================================
   SKELETON LOADING (Efeito Netflix / Youtube)
   ========================================== */
@keyframes fpe-skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.fpe-skeleton-box {
    animation: fpe-skeleton-pulse 1.5s ease-in-out infinite;
    background-color: #e2e8f0;
    border-radius: 6px;
}
