/* assets/css/pages/banco.css - V4.2 (Sticky Fix + High Padding) */

/* =========================================
   1. FORÇAR FUNDO DEEP SPACE
   ========================================= */
body.page-template-page-banco-de-questoes {
    background-color: #020617 !important;
    min-height: 100vh;
}

body.page-template-page-banco-de-questoes::before {
    content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -10; pointer-events: none;
    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; 
    mask-image: radial-gradient(circle at center top, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center top, black 40%, transparent 100%);
}

/* =========================================
   2. LAYOUT "ILHA" (FIX SIDEBAR)
   ========================================= */

.metria-bank-wrapper {
    max-width: 1600px; /* Largura Super Wide */
    width: 96%;
    margin: 40px auto 100px;
    
    background-color: #F8F9FA !important; 
    color: #202124;
    
    border-radius: 24px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.1), 0 50px 100px -20px rgba(0, 0, 0, 0.7);
    
    position: relative;
    /* CORREÇÃO CRÍTICA: Remover overflow: hidden permite que o sticky funcione */
    overflow: visible; 
    z-index: 1;
}

/* Grid de Fundo (Papel) */
.metria-bank-wrapper::before {
    content: "";
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; pointer-events: none;
    background-image: 
        linear-gradient(#E8EAED 1px, transparent 1px),
        linear-gradient(90deg, #E8EAED 1px, transparent 1px);
    background-size: 24px 24px;
    
    /* Arredondamento aplicado aqui para não vazar, já que o pai não tem overflow:hidden */
    border-radius: 24px; 
}

/* ESPAÇAMENTO INTERNO (PADDING AUMENTADO) */
.bank-content-inner {
    /* AQUI ESTÁ A CORREÇÃO DO "COLADO NA BORDA" */
    padding: 80px; 
    position: relative;
    z-index: 2;
}

/* =========================================
   3. HEADER
   ========================================= */
.bank-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 60px; /* Mais espaço antes dos filtros */
    border-bottom: 1px solid #E0E0E0; 
    padding-bottom: 30px;
}
.bank-header h1 { color: #202124; font-size: 2.5rem; margin-bottom: 10px; letter-spacing: -1.5px; }
.bank-header p { color: #5F6368; font-size: 1.1rem; margin: 0; }

.bh-stat-val { color: #4f46e5; font-size: 1.8rem; font-weight: 800; text-align: right; display: block; }
.bh-stat-label { color: #5F6368; font-size: 0.8rem; text-transform: uppercase; font-weight: 600; }

/* =========================================
   4. GRID E SIDEBAR FIXA
   ========================================= */
.bank-grid {
    display: grid; 
    grid-template-columns: 340px 1fr; 
    gap: 80px; /* Mais espaço entre a Sidebar e as Questões */
    align-items: start;
}

.bank-sidebar {
    background-color: #FFFFFF !important; 
    border: 1px solid #E0E0E0;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    
    /* LÓGICA DO STICKY (Flutuante) */
    position: -webkit-sticky; /* Safari */
    position: sticky; 
    /* Ajuste este valor se o header fixo do site cobrir o topo */
    top: 100px; 
    
    z-index: 10;
}

/* Estilos de Filtros */
.filter-group { gap: 24px; display: flex; flex-direction: column; }
.filter-header { 
    color: #202124; font-weight: 800; font-size: 0.85rem; text-transform: uppercase;
    display: flex; justify-content: space-between; margin-bottom: 15px; border-bottom: 1px solid #F1F3F4; padding-bottom: 10px;
}
.filter-item label { color: #4A4A4A; font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; display: block; }
.btn-clear-filters { color: #4f46e5; font-weight: 600; font-size: 0.8rem; background: none; border: none; cursor: pointer; }

/* Inputs */
.input-search-wrapper { position: relative; width: 100%; display: flex; align-items: center; }
.input-search-wrapper i {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: #9AA0A6; font-size: 1.1rem; pointer-events: none;
}
.input-search-wrapper input {
    width: 100%; height: 48px; background: #F8F9FA; 
    border: 1px solid #DADCE0; border-radius: 8px;
    padding: 0 16px 0 50px !important;
    color: #202124; font-size: 0.95rem; outline: none; transition: 0.2s;
}
.input-search-wrapper input:focus { background: #FFFFFF; border-color: #4f46e5; box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1); }

.metria-select {
    height: 44px; background: #F8F9FA; border: 1px solid #DADCE0; color: #3C4043;
    border-radius: 8px; padding: 0 12px; width: 100%; cursor: pointer; font-weight: 500;
}
.checkbox-group label { margin-bottom: 10px; gap: 10px; }
input[type="checkbox"] { width: 18px; height: 18px; border: 2px solid #9AA0A6; border-radius: 4px; accent-color: #4f46e5; }
.difficulty-selector { gap: 8px; margin-top: 5px; }
.dif-btn { height: 10px; border-radius: 5px; background: #EEE; border:none; cursor: pointer; }
.dif-btn:hover { transform: scaleY(1.3); }
.dif-btn.easy { background: #34A853; } .dif-btn.medium { background: #FBBC04; }
.dif-btn.hard { background: #EA4335; } .dif-btn.insane { background: #A142F4; }
details { border-bottom: 1px solid #F1F3F4; padding: 16px 0; }
summary { color: #3C4043; font-weight: 700; font-size: 0.95rem; cursor: pointer; display: flex; justify-content: space-between; }

/* =========================================
   5. LISTA DE QUESTÕES
   ========================================= */
.questions-feed { gap: 30px; }

.q-card {
    background-color: #FFFFFF !important; 
    border: 1px solid #E0E0E0;
    border-radius: 16px;
    padding: 40px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); 
    transition: all 0.2s ease;
    position: relative; z-index: 5; 
}
.q-card:hover {
    box-shadow: 0 15px 35px rgba(0,0,0,0.1); transform: translateY(-3px); border-color: #4f46e5;
}

.q-header { margin-bottom: 25px; display: flex; justify-content: space-between; }
.q-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Tags */
.q-tag { font-size: 0.7rem; font-weight: 700; padding: 6px 12px; border-radius: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.q-tag.year { background: #F1F3F4; color: #5F6368; border: 1px solid #DADCE0; }
.q-tag.type { background: #E6F4EA; color: #137333; }
.q-tag.topic { background: #F3E8FD; color: #7627BB; }
.q-tag.id { font-size: 1rem; color: #9AA0A6; font-family: monospace; font-weight: 600; margin-left: 10px; }
.btn-icon { color: #5F6368; background: none; border: none; cursor: pointer; font-size: 1.2rem; }
.btn-icon:hover { color: #4f46e5; }

/* Conteúdo */
.q-body { color: #202124; font-size: 1.1rem; line-height: 1.7; margin-bottom: 35px; }
.q-body p { margin-bottom: 20px; color: #3C4043 !important; }
.q-image {
    padding: 20px; border: 1px solid #F1F3F4; border-radius: 12px;
    margin: 30px auto; background: #fff; display: table;
}

/* Opções */
.q-options { display: flex; flex-direction: column; gap: 14px; }
.q-opt {
    background: #FFFFFF; border: 1px solid #DADCE0;
    padding: 16px 24px; border-radius: 10px;
    display: flex; align-items: center; gap: 20px; cursor: pointer; transition: 0.1s;
}
.q-opt:hover { background: #F8F9FA; border-color: #5F6368; }
.opt-letter {
    width: 36px; height: 36px; border-radius: 50%;
    background: #F1F3F4; color: #5F6368; font-size: 1rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid #DADCE0;
}
.opt-content { font-size: 1.05rem; font-weight: 500; }
.q-opt input:checked ~ .opt-letter { background: #4f46e5; color: white; border-color: #4f46e5; }
.q-opt input:checked ~ .opt-content { font-weight: 700; color: #4f46e5; }
.q-opt:has(input:checked) { background: #EEF2FF; border-color: #4f46e5; box-shadow: 0 0 0 1px #4f46e5; }

/* Grid Imagens */
.grid-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 15px; }
.q-opt-img {
    background: white; border: 1px solid #DADCE0; border-radius: 10px;
    padding: 15px; cursor: pointer; transition: 0.2s; text-align: center; position: relative;
}
.q-opt-img:hover { border-color: #202124; }
.q-opt-img .opt-letter { position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; font-size: 0.8rem; }
.q-opt-img input { display: none; }
.q-opt-img:has(input:checked) { border-color: #4f46e5; box-shadow: 0 0 0 2px #4f46e5; }

.q-footer { margin-top: 30px; padding-top: 25px; border-top: 1px solid #F1F3F4; }
.btn-resolve {
    background: #4f46e5; color: white; border: none; padding: 12px 32px; border-radius: 50px;
    font-weight: 600; font-size: 1rem; cursor: pointer; box-shadow: 0 4px 10px rgba(79,70,229,0.2);
}

/* Responsivo */
@media (max-width: 1024px) {
    .metria-bank-wrapper { width: 98%; max-width: 98%; margin-top: 20px; }
    .bank-content-inner { padding: 40px; }
}
@media (max-width: 900px) {
    .bank-grid { grid-template-columns: 1fr; }
    .bank-content-inner { padding: 25px; }
    .bank-sidebar { position: relative; top: 0; width: 100%; z-index: 2; } /* Em mobile, sidebar volta ao fluxo normal */
}