/**
 * ============================================================================
 * FILTRO DE QUESTÕES E REVISÕES - ESTILOS CSS
 * ============================================================================
 * 
 * Arquivo: fqr-styles.css
 * Versão: 1.4.0 - Grid 3 colunas + Contagem de questões
 * ============================================================================
 */

/* ========== CONTAINER PRINCIPAL ========== */
.fqr-filter-wrapper {
    position: relative;
    margin-bottom: 0;
}

/* ========== HEADER DO FILTRO ========== */
.fqr-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fqr-filter-header:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.fqr-filter-wrapper.active .fqr-filter-header {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

.fqr-filter-label {
    font-weight: 600;
    font-size: 14px;
}

.fqr-filter-toggle {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.fqr-filter-wrapper.active .fqr-filter-toggle {
    transform: rotate(180deg);
}

/* ========== DROPDOWN ========== */
.fqr-filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ========== BUSCA ========== */
.fqr-filter-search {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
}

.fqr-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.fqr-search-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* ========== OPÇÕES ========== */
.fqr-filter-options {
    overflow-y: auto;
    max-height: 300px;
    padding: 8px 0;
}

.fqr-filter-option {
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.fqr-filter-option:hover {
    background: #f8f9fa;
}

.fqr-filter-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
}

.fqr-checkbox {
    margin-right: 8px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* ========== FILTROS ATUAIS (TAGS) ========== */
.fqr-current-filters-display {
    margin-top: 16px;
}

.fqr-current-filters-label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: #495057;
    display: none;
}

.fqr-current-filters-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fqr-current-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #007cba;
    color: #fff;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

.fqr-current-filter-tag-remove {
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.fqr-current-filter-tag-remove:hover {
    opacity: 1;
}

/* ========== INDICADOR DE FILTRO APLICADO ========== */
#fqr-applied-filter-indicator {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #0c5460;
    font-size: 14px;
}

#fqr-applied-filter-name {
    font-weight: 600;
}

/* ========== CONTADOR DE RESULTADOS ========== */
.fqr-results-count {
    padding: 12px 16px;
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    color: #0c5460;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

/* ========== MENSAGEM SEM RESULTADOS ========== */
.fqr-no-results {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #6c757d;
    font-size: 16px;
    margin-top: 16px;
}

/* ========== BARRA DE LOADING NO TOPO ========== */
.fqr-top-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, #007cba, #00a0e9);
    z-index: 99999;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(0, 124, 186, 0.6);
}

.fqr-top-loading-bar.active {
    width: 100%;
    transition: width 1.5s ease-out;
}

/* ========== FILTROS SALVOS ========== */
.fqr-saved-filters-wrapper {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
}

.fqr-saved-filters-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #212529;
}

.fqr-save-filter-section {
    margin-bottom: 24px;
}

/* ========== BOTÕES DE AÇÃO (APLICAR, LIMPAR E SALVAR) ========== */
.fqr-filter-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

button.fqr-apply-filters-btn,
button.fqr-clear-filters-btn,
button.fqr-save-filter-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.5;
}

button.fqr-apply-filters-btn {
    background: transparent !important;
    color: #FF9800 !important;
    border: 2px solid #FF9800 !important;
}

button.fqr-apply-filters-btn:hover {
    background: #FF9800 !important;
    color: #fff !important;
    border-color: #FF9800 !important;
}

button.fqr-clear-filters-btn {
    background: transparent !important;
    color: #CE4654 !important;
    border: 2px solid #CE4654 !important;
}

button.fqr-clear-filters-btn:hover {
    background: #CE4654 !important;
    color: #fff !important;
    border-color: #CE4654 !important;
}

button.fqr-save-filter-btn {
    background: transparent !important;
    color: #28A745 !important;
    border: 2px solid #28A745 !important;
}

button.fqr-save-filter-btn:hover {
    background: #28A745 !important;
    color: #fff !important;
    border-color: #28A745 !important;
}

/* ========================================
   LISTA DE FILTROS SALVOS - GRID 3 COLUNAS
   ======================================== */
.fqr-saved-filters-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.fqr-saved-filter-item {
    display: flex;
    flex-direction: column;
    padding: 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.fqr-saved-filter-item:hover {
    background: #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fqr-saved-filter-info {
    flex: 1;
    margin-bottom: 12px;
}

.fqr-saved-filter-name {
    font-weight: 600;
    font-size: 15px;
    color: #212529;
    margin-bottom: 8px;
}

.fqr-saved-filter-terms {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 6px;
    line-height: 1.4;
}

.fqr-saved-filter-date {
    font-size: 12px;
    color: #adb5bd;
    margin-bottom: 6px;
}

.fqr-saved-filter-count {
    display: block !important;
    font-size: 13px;
    color: #007cba;
    font-weight: 600;
    margin-top: 6px;
    visibility: visible !important;
}

.fqr-saved-filter-actions {
    display: flex;
    gap: 8px;
}

.fqr-btn-apply,
.fqr-btn-delete {
    flex: 1;
    padding: 8px 16px;
    border: 2px solid;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fqr-btn-apply {
    background: transparent !important;
    color: #28A745 !important;
    border-color: #28A745 !important;
}

.fqr-btn-apply:hover {
    background: #28A745 !important;
    color: #fff !important;
    border-color: #28A745 !important;
}

.fqr-btn-delete {
    background: transparent !important;
    color: #721C24 !important;
    border-color: #721C24 !important;
}

.fqr-btn-delete:hover {
    background: #721C24 !important;
    color: #fff !important;
    border-color: #721C24 !important;
}

/* ========== MODAL ========== */
.fqr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.fqr-modal-content {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    position: relative;
    margin: auto;
}

.fqr-modal-close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    color: #adb5bd;
    cursor: pointer;
    line-height: 1;
}

.fqr-modal-close:hover {
    color: #495057;
}

.fqr-modal h3 {
    margin: 0 0 20px;
    font-size: 20px;
    color: #212529;
}

.fqr-form-group {
    margin-bottom: 16px;
}

.fqr-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #495057;
}

.fqr-form-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.fqr-form-group input[type="text"]:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.fqr-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.fqr-btn-primary,
.fqr-btn-cancel {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fqr-btn-primary {
    background: #007cba;
    color: #fff;
}

.fqr-btn-primary:hover {
    background: #006ba1;
}

.fqr-btn-cancel {
    background: #6c757d;
    color: #fff;
}

.fqr-btn-cancel:hover {
    background: #5a6268;
}

/* ========== LOADING DO LISTING ========== */
.fqr-listing-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 124, 186, 0.9);
    color: #fff;
    padding: 15px 30px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ========== RESPONSIVO ========== */
@media (max-width: 1200px) {
    .fqr-saved-filters-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .fqr-saved-filters-list {
        grid-template-columns: 1fr;
    }
    
    .fqr-filter-dropdown {
        max-height: 300px;
    }
    
    .fqr-filter-options {
        max-height: 200px;
    }
    
    .fqr-filter-buttons {
        flex-direction: column;
    }
    
    button.fqr-apply-filters-btn,
    button.fqr-save-filter-btn,
    button.fqr-clear-filters-btn {
        width: 100%;
    }
    
    .fqr-saved-filter-actions {
        width: 100%;
    }
    
    .fqr-btn-apply,
    .fqr-btn-delete {
        flex: 1;
    }
    
    .fqr-modal-content {
        padding: 20px;
    }
    
    .fqr-current-filters-items {
        gap: 6px;
    }
    
    .fqr-current-filter-tag {
        font-size: 12px;
        padding: 4px 10px;
    }
    
    /* Garantir visibilidade do contador de questões no mobile */
    .fqr-saved-filter-count {
        display: block !important;
        visibility: visible !important;
        font-size: 13px;
    }
}

/* ========== SCROLLBAR CUSTOMIZADA ========== */
.fqr-filter-options::-webkit-scrollbar {
    width: 8px;
}

.fqr-filter-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.fqr-filter-options::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 4px;
}

.fqr-filter-options::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* ========== ANIMAÇÕES ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fqr-filter-dropdown {
    animation: fadeIn 0.3s ease;
}

/* ========== COMPATIBILIDADE COM TEMAS ========== */
.fqr-filter-wrapper * {
    box-sizing: border-box;
}

.fqr-filter-wrapper a {
    text-decoration: none;
}

/* ========== ESTADOS DE ITENS OCULTOS ========== */
.ltq-listing-item[style*="display: none"],
.ltq-listing-item[style*="display:none"] {
    display: none !important;
}

/* ========== FIM ========== */