/* ============================================
   SISTEMA DE FILTROS - ESTRATÉGIAS DE ESTUDO
   VERSÃO FINAL CORRIGIDA
   Blue Concursos
============================================ */

/* ========================================
   1. BOTÃO FILTROS (SEMPRE VISÍVEL)
======================================== */

.bc-btn-filtros-mobile {
    display: flex;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 998;
    padding: 14px 24px;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
    align-items: center;
    gap: 10px;
}


.bc-btn-filtros-mobile:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.5);
}

.bc-btn-filtros-mobile:active {
    transform: translateY(-2px);
}

.bc-badge-filtros-ativos {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: #ef4444;
    color: #ffffff;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
}

/* Botão menu mobile Astra */
.menu-toggle.main-header-menu-toggle {
    background: transparent;
    color: white !important;
}

/* ========================================
   2. OVERLAY ESCURO (NOVO!)
======================================== */

.bc-filtros-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.bc-filtros-overlay.bc-overlay-ativo {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   3. SIDEBAR DE FILTROS
======================================== */

.bc-filtros-sidebar {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 24px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    z-index: 999;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.bc-filtros-sidebar.bc-sidebar-aberta {
    transform: translateX(0);
}

.bc-filtros-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.bc-filtros-titulo {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bc-filtros-titulo svg {
    color: #2563eb;
    flex-shrink: 0;
}

/* ========================================
   BOTÃO FECHAR - CORRIGIDO!
======================================== */

.bc-filtros-fechar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
}

.bc-filtros-fechar:hover {
    background: #e2e8f0;
    transform: rotate(90deg);
}

.bc-filtros-fechar svg {
    width: 20px;
    height: 20px;
    color: #475569;
    stroke-width: 2.5;
}

/* Se o SVG não renderizar, criar X com CSS */
.bc-filtros-fechar::before,
.bc-filtros-fechar::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: #475569;
    top: 50%;
    left: 50%;
}

.bc-filtros-fechar::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.bc-filtros-fechar::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Esconder o "before/after" se SVG existir */
.bc-filtros-fechar svg + ::before,
.bc-filtros-fechar svg + ::after {
    display: none;
}

/* ========================================
   4. FORMULÁRIO DE FILTROS
======================================== */

.bc-filtros-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bc-filtro-grupo {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bc-filtro-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bc-filtro-label svg {
    color: #64748b;
    flex-shrink: 0;
}

/* Input de Busca */
.bc-filtro-input-busca {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1e293b;
    transition: all 0.3s ease;
    background: #ffffff;
}

.bc-filtro-input-busca:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.bc-filtro-input-busca::placeholder {
    color: #94a3b8;
}

/* Selects */
.bc-filtro-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1e293b;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.bc-filtro-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.bc-filtro-select:hover {
    border-color: #cbd5e1;
}

/* ========================================
   5. BOTÕES DE AÇÃO
======================================== */

.bc-filtros-acoes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

.bc-btn-limpar-filtros,
.bc-btn-aplicar-filtros {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bc-btn-limpar-filtros {
    background: #f1f5f9;
    color: #475569;
}

.bc-btn-limpar-filtros:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.bc-btn-aplicar-filtros {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.bc-btn-aplicar-filtros:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* ========================================
   6. CONTADOR DE RESULTADOS
======================================== */

.bc-filtros-resultados {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f2ff 100%);
    border-radius: 8px;
    text-align: center;
    font-size: 0.9rem;
    color: #1e40af;
    font-weight: 600;
}

.bc-resultados-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
    display: inline-block;
    margin-right: 4px;
}

/* ========================================
   7. LAYOUT COM FILTROS
======================================== */

.bc-estrategias-com-filtros {
    display: block;
    margin: 40px 0;
}

.bc-conteudo-filtrado {
    width: 100%;
}

/* ========================================
   8. ESTADO "SEM RESULTADOS"
======================================== */

.bc-no-results {
    text-align: center;
    padding: 80px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
}

.bc-no-results svg {
    color: #cbd5e1;
    margin-bottom: 20px;
}

.bc-no-results p {
    font-size: 1.1rem;
    color: #64748b;
    margin: 20px 0;
}

.bc-no-results .bc-btn-limpar-filtros {
    display: inline-flex;
    margin-top: 16px;
    background: #2563eb;
    color: #ffffff;
}

.bc-no-results .bc-btn-limpar-filtros:hover {
    background: #1e40af;
}

/* ========================================
   9. FIX - MENU HAMBÚRGUER INVISÍVEL
======================================== */

/* FORÇAR visibilidade do menu hambúrguer nesta página */


/* Forçar visibilidade dos SVGs do menu */
.menu-toggle svg,
.ast-mobile-menu-trigger-minimal svg,
.main-header-menu-toggle svg {
    opacity: 1 !important;
    visibility: visible !important;
    fill: currentColor !important;
    stroke: currentColor !important;
}

/* Forçar z-index do container do menu */
.site-header .ast-mobile-menu-buttons,
.site-header .ast-button-wrap {
    z-index: 999 !important;
}

/* ========================================
   10. RESPONSIVIDADE
======================================== */

@media (max-width: 640px) {
    .bc-filtros-sidebar {
        max-width: 100%;
        padding: 20px;
    }
    
    .bc-filtros-titulo {
        font-size: 1rem;
    }
    
    .bc-filtros-acoes {
        grid-template-columns: 1fr;
    }
    
    .bc-btn-aplicar-filtros {
        order: -1;
    }
    
    .bc-btn-filtros-mobile {
        bottom: 100px;
        right: 15px;
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .bc-filtro-input-busca,
    .bc-filtro-select {
        font-size: 16px;
    }
}

/* ========================================
   11. ANIMAÇÕES
======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bc-estrategia-card {
    animation: fadeIn 0.4s ease;
}

.bc-estrategia-card:nth-child(1) { animation-delay: 0s; }
.bc-estrategia-card:nth-child(2) { animation-delay: 0.05s; }
.bc-estrategia-card:nth-child(3) { animation-delay: 0.1s; }
.bc-estrategia-card:nth-child(4) { animation-delay: 0.15s; }
.bc-estrategia-card:nth-child(5) { animation-delay: 0.2s; }
.bc-estrategia-card:nth-child(6) { animation-delay: 0.25s; }

/* ========================================
   12. ACESSIBILIDADE
======================================== */

.bc-filtro-select:focus-visible,
.bc-filtro-input-busca:focus-visible,
.bc-btn-limpar-filtros:focus-visible,
.bc-btn-aplicar-filtros:focus-visible,
.bc-btn-filtros-mobile:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}