/* ==========================================
   FONTES CUSTOMIZADAS (TIPOGRAFIA ENEM)
   ========================================== */
@font-face {
    font-family: 'Bundesbahn';
    src: url('../fonts/bundesbahn.otf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Classe exclusiva para as letras das alternativas */
.letra-enem {
    font-family: 'Bundesbahn', sans-serif;
    font-size: 22px; /* Tamanho ideal para dar o destaque clássico */
    display: inline-block;
    width: 30px;
    text-align: center;
    color: var(--fpe-text-main);
}

/* ==========================================
   VARIÁVEIS DE COR (ESTILO FpE)
   ========================================== */
:root {
    --fpe-blue: #1a73e8;
    --fpe-blue-dark: #1557b0;
    --fpe-yellow: #fbbc05;
    --fpe-bg: #f4f6f8;
    --fpe-sidebar-bg: #ffffff;
    --fpe-text-main: #202124;
    --fpe-text-muted: #5f6368;
    --fpe-border: #e0e0e0;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--fpe-bg);
    color: var(--fpe-text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ==========================================
   SIDEBAR DESKTOP
   ========================================== */
.fpe-sidebar {
    width: var(--sidebar-width);
    background: var(--fpe-sidebar-bg);
    border-right: 1px solid var(--fpe-border);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    position: relative;
    z-index: 100;
}

.fpe-sidebar.collapsed { width: var(--sidebar-collapsed-width); }

.btn-collapse-sidebar {
    position: absolute;
    top: 24px;
    right: -14px;
    width: 28px;
    height: 28px;
    background: var(--fpe-blue);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 101;
    transition: background 0.2s;
}
.btn-collapse-sidebar:hover { background: var(--fpe-blue-dark); }

/* Branding */
.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-brand i {
    font-size: 24px;
    color: var(--fpe-yellow);
    background: var(--fpe-blue);
    padding: 8px 12px;
    border-radius: 8px;
}
.brand-text {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--fpe-blue);
    transition: opacity 0.3s;
}
.fpe-sidebar.collapsed .brand-text { opacity: 0; display: none; }

/* Navegação */
.fpe-nav {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}
.nav-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--fpe-text-muted);
    font-weight: 600;
    margin: 20px 0 8px 15px;
    white-space: nowrap;
}
.fpe-sidebar.collapsed .nav-label { display: none; }

.fpe-nav a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    color: var(--fpe-text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
    margin-bottom: 4px;
}
.fpe-nav a:hover { background: var(--fpe-bg); color: var(--fpe-blue); }
.fpe-nav a.active { background: #e8f0fe; color: var(--fpe-blue); }

.fpe-nav a i {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
}
.fpe-sidebar.collapsed .menu-text { display: none; }

/* Rodapé do Usuário */
.sidebar-footer {
    padding: 20px 15px;
    border-top: 1px solid var(--fpe-border);
}
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}
.user-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.user-details { display: flex; flex-direction: column; }
.user-name { font-weight: 600; font-size: 14px; }
.user-role { font-size: 12px; color: var(--fpe-text-muted); }
.fpe-sidebar.collapsed .user-details { display: none; }

/* ==========================================
   ÁREA PRINCIPAL
   ========================================== */
.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}
.page-header h1 { margin: 0; color: var(--fpe-text-main); font-size: 24px; }
.page-header p { color: var(--fpe-text-muted); margin-top: 5px; }

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}
.card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid var(--fpe-border);
}

/* Rodapé do Usuário */
.sidebar-footer {
    padding: 20px 15px;
    border-top: 1px solid var(--fpe-border);
    display: flex;
    flex-direction: column;
    gap: 15px; /* Dá um respiro entre a foto e o botão Sair */
}
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    padding: 0 5px;
}
.user-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.user-details { display: flex; flex-direction: column; }
.user-name { font-weight: 600; font-size: 14px; }
.user-role { font-size: 12px; color: var(--fpe-text-muted); }
.fpe-sidebar.collapsed .user-details { display: none; }

/* Botão de Sair (Vermelhinho) */
.btn-logout {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    color: var(--fpe-text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-logout i {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
}
.btn-logout:hover {
    background-color: #fee2e2; /* Fundo vermelho bem clarinho */
    color: #ef4444; /* Texto e ícone vermelho vivo */
}
.fpe-sidebar.collapsed .btn-logout .menu-text { 
    display: none; 
}
/* ==========================================
   CABEÇALHOS E BOTÕES
   ========================================== */
.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;
}
.fpe-btn-primary {
    background-color: var(--fpe-blue);
    color: white;
}
.fpe-btn-primary:hover {
    background-color: var(--fpe-blue-dark);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.fpe-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--fpe-text-muted);
    background: #f1f3f4;
    text-decoration: none;
    transition: all 0.2s;
    margin-left: 5px;
}
.fpe-btn-icon:hover {
    background: #e8eaed;
    color: var(--fpe-blue);
}

/* ==========================================
   TABELAS FPE
   ========================================== */
.fpe-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid var(--fpe-border);
    overflow: hidden;
}
.fpe-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.fpe-table th {
    background: #f8f9fa;
    padding: 15px 20px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--fpe-text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--fpe-border);
}
.fpe-table td {
    padding: 15px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--fpe-border);
    color: var(--fpe-text-main);
    vertical-align: middle;
}
.fpe-table tr:last-child td { border-bottom: none; }
.fpe-table tr:hover td { background-color: #fcfcfc; }

.fpe-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.fpe-badge.success { background: #e6f4ea; color: #137333; }
.fpe-badge.warning { background: #fef7e0; color: #b06000; }

/* ==========================================
   EDITOR DE QUESTÕES (GRID E FORMULÁRIOS)
   ========================================== */
.fpe-editor-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .fpe-editor-grid {
        grid-template-columns: 1fr;
    }
}

.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;
}

.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;
}

/* ==========================================
   FRONTEND: EXPLORADOR E VITRINE (SAAS)
   ========================================== */
.fpe-front-layout {
    display: flex;
    gap: 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 0;
}

/* SIDEBAR PÚBLICA */
.fpe-front-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    align-self: flex-start;
    position: sticky;
    top: 20px;
}

.fpe-front-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.fpe-front-sidebar-title {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 1px;
    margin: 25px 0 10px 10px;
}

.fpe-front-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fpe-front-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 10px;
    color: #475569;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.fpe-front-nav-link i { font-size: 16px; width: 20px; text-align: center; }
.fpe-front-nav-link:hover { background: #f8fafc; color: #3b82f6; }
.fpe-front-nav-link.active { background: #eff6ff; color: #2563eb; }
.fpe-front-nav-link.disabled { opacity: 0.5; cursor: not-allowed; }

/* PALCO PRINCIPAL */
.fpe-front-main {
    flex: 1;
    min-width: 0; /* Previne overflow do grid */
}

.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: #3b82f6; background: #fff; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); }
.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;
}

/* CARDS DO GRID */
.fpe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; }
.fpe-card-app { background: #fff; border: 1px solid #e2e8f0; border-radius: 20px; 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: #cbd5e1; }
.fpe-card-img { height: 160px; background-color: #f1f5f9; background-size: cover; background-position: center; position: relative; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; justify-content: center; color: #94a3b8; }
.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-body { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.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; }
.fpe-card-app:hover .fpe-card-title { color: #3b82f6; }
.fpe-card-footer { margin-top: auto; padding-top: 15px; border-top: 1px solid #f1f5f9; font-size: 13px; color: #64748b; font-weight: 500; }
.fpe-card-btn { margin-top: 20px; background: #f8fafc; color: #3b82f6; text-align: center; padding: 12px; font-weight: 700; border-radius: 12px; transition: all 0.2s; border: 1px solid transparent; font-size: 14px; }
.fpe-card-app:hover .fpe-card-btn { background: #eff6ff; border-color: #bfdbfe; }
.fpe-card-footer font { font-weight: 800; padding: 2px 6px; border-radius: 4px; background: rgba(0,0,0,0.05); }

/* RESPONSIVO MÁXIMO */
@media(max-width: 992px) {
    .fpe-front-layout { flex-direction: column; }
    .fpe-front-sidebar { width: 100%; position: relative; top: 0; margin-bottom: 20px; }
}
@media(max-width: 768px) {
    .fpe-search-box { flex-direction: column; }
}

/* ==========================================
   SIDEBAR UNIVERSAL (FpE 2.0)
   ========================================== */
.fpe-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    padding: 25px 20px;
    box-sizing: border-box;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.02);
}

.fpe-sidebar-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.fpe-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Tira as bolinhas feias e as margens da lista */
.fpe-menu {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.fpe-menu li {
    list-style: none !important;
    margin-bottom: 5px;
}

/* O título pequenininho (Ex: ÁREA DO ALUNO) */
.fpe-menu-title {
    font-size: 11px;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 800;
    margin: 25px 0 10px 10px;
    letter-spacing: 1px;
}

/* Os botões do menu */
.fpe-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 10px;
    color: #475569;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.fpe-menu-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* Efeito ao passar o mouse e Item Ativo */
.fpe-menu-link:hover {
    background: #f8fafc;
    color: var(--fpe-blue, #3b82f6);
}

.fpe-menu-link.active {
    background: #eff6ff;
    color: var(--fpe-blue, #2563eb);
}