/**
 * Sistema de Filtros Contextuais - Estilos
 *
 * @package WP_Classificados
 * @since 1.3.6
 */

/* Container de Filtros */
.classif-filters-container {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.classif-contextual-filters {
    margin-top: 1rem;
}

/* Botão de Filtros Avançados */
.classif-toggle-drawer {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.classif-toggle-drawer:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

.classif-toggle-drawer i {
    font-size: 1.1rem;
}

/* Botão Limpar Filtros */
.classif-clear-filters {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.classif-clear-filters:hover {
    background: #5a6268;
}

/* Drawer de Filtros Avançados */
.classif-filters-drawer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.classif-filters-drawer.active {
    opacity: 1;
    visibility: visible;
}

.classif-drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.classif-drawer-content {
    position: absolute;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.classif-filters-drawer.active .classif-drawer-content {
    right: 0;
}

.classif-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.classif-drawer-header h5 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.classif-drawer-header h5 i {
    color: #6366f1;
}

.classif-drawer-close {
    cursor: pointer;
}

.classif-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Estilos dos campos de filtro */
.classif-filter-basic,
.classif-filter-advanced {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.classif-filter-basic:focus,
.classif-filter-advanced:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

/* Badge de filtro ativo */
.classif-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.classif-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.classif-filter-badge button {
    background: none;
    border: none;
    color: #4338ca;
    cursor: pointer;
    padding: 0;
    margin: 0;
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.classif-filter-badge button:hover {
    opacity: 1;
}

/* Loading overlay */
.classif-loading {
    display: none;
    text-align: center;
    padding: 3rem;
}

.classif-loading.active {
    display: block;
}

/* Animação de loading */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.classif-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

/* Responsividade */
@media (max-width: 768px) {
    .classif-drawer-content {
        max-width: 100%;
    }

    .classif-filters-container {
        padding: 1rem;
    }

    .classif-toggle-drawer,
    .classif-clear-filters {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
    }
}

/* Prevenir scroll do body quando drawer está aberto */
body.classif-drawer-open {
    overflow: hidden;
}

/* Estilos para autocomplete */
.classif-filter-basic[data-filter-type="autocomplete"],
.classif-filter-advanced[data-filter-type="autocomplete"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

/* Transições suaves */
.classif-lista-resultado {
    transition: opacity 0.3s ease;
}

.classif-lista-resultado.d-none {
    opacity: 0;
}

/* Indicador de filtros ativos */
.classif-filters-active-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #10b981;
    color: white;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.classif-filters-active-indicator i {
    font-size: 1rem;
}

/* Hover effects nos cards */
.classif-ad-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.classif-ad-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Scrollbar customizada para o drawer */
.classif-drawer-body::-webkit-scrollbar {
    width: 8px;
}

.classif-drawer-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.classif-drawer-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.classif-drawer-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
