/**
 * SISTEMA DE FILTRO IMOBILIÁRIO
 * Design Black & Gold 2025
 * Responsivo e Moderno
 */

:root {
    --filter-bg: #ffffff;
    --filter-border: #e5e7eb;
    --filter-shadow: rgba(0, 0, 0, 0.08);
    --gold: #d4af37;
    --primary: #111827;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-400: #9ca3af;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
}

/* ========== SEÇÃO DE FILTRO ========== */
.filter-section {
    margin-bottom: 40px;
}

/* ========== BOTÃO TOGGLE (MOBILE) ========== */
.filter-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px 24px;
    background: var(--gray-900);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.filter-toggle-btn:hover {
    background: var(--gold);
    color: var(--gray-900);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.filter-toggle-btn svg {
    width: 20px;
    height: 20px;
}

/* ========== CONTAINER DE FILTROS ========== */
.filter-container {
    background: var(--filter-bg);
    border: 1px solid var(--filter-border);
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 16px var(--filter-shadow);
    margin-bottom: 40px;
    transition: all 0.3s ease;
}

/* ========== HEADER DO FILTRO ========== */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-100);
}

.filter-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.filter-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--gray-100);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-close-btn:hover {
    background: var(--gray-200);
    transform: rotate(90deg);
}

.filter-close-btn svg {
    width: 20px;
    height: 20px;
    color: var(--gray-600);
}

/* ========== GRID DE FILTROS ========== */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* ========== GRUPO DE FILTRO ========== */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input[type="number"] {
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 15px;
    color: var(--gray-900);
    background: var(--filter-bg);
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.filter-group select:focus,
.filter-group input[type="number"]:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.filter-group select:hover,
.filter-group input[type="number"]:hover {
    border-color: var(--gray-400);
}

/* Placeholder customizado */
.filter-group input[type="number"]::placeholder {
    color: var(--gray-400);
}

/* Remover spinner dos inputs number (opcional) */
.filter-group input[type="number"]::-webkit-inner-spin-button,
.filter-group input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ========== AÇÕES DO FILTRO ========== */
.filter-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    padding-top: 24px;
    border-top: 1px solid var(--gray-100);
}

.btn-clear,
.btn-apply {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.btn-clear {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-clear:hover {
    background: var(--gray-200);
    transform: translateY(-2px);
}

.btn-apply {
    background: var(--gray-900);
    color: white;
}

.btn-apply:hover {
    background: var(--gold);
    color: var(--gray-900);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ========== RESULTADOS DO FILTRO ========== */
#filterResults {
    margin-bottom: 20px;
}

.filter-result-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--gray-100);
    border-radius: 6px;
    font-size: 14px;
    color: var(--gray-700);
    font-weight: 500;
    margin-right: 8px;
    margin-bottom: 8px;
}

.filter-result-badge button {
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.filter-result-badge button:hover {
    color: var(--gray-900);
}

.no-results-message {
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    margin: 40px 0;
}

.no-results-message h3 {
    font-size: 20px;
    color: #92400e;
    margin-bottom: 12px;
}

.no-results-message p {
    font-size: 15px;
    color: #78350f;
    margin-bottom: 16px;
}

.no-results-message button {
    background: #92400e;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.no-results-message button:hover {
    background: #78350f;
    transform: translateY(-2px);
}

/* ========== CARD OCULTO ========== */
.imovel-card.hidden {
    display: none;
}

/* ========== ANIMAÇÃO DE FADE IN ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.imovel-card.show {
    animation: fadeIn 0.4s ease forwards;
}

/* ========== RESPONSIVE - TABLET ========== */
@media (max-width: 1024px) {
    .filter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========== RESPONSIVE - MOBILE ========== */
@media (max-width: 768px) {
    .filter-toggle-btn {
        display: flex;
    }

    .filter-container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        border-radius: 0;
        padding: 20px;
        margin: 0;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .filter-container.active {
        transform: translateX(0);
    }

    .filter-header {
        position: sticky;
        top: 0;
        background: var(--filter-bg);
        z-index: 10;
        margin: -20px -20px 20px;
        padding: 20px;
        border-bottom: 2px solid var(--gray-200);
    }

    .filter-close-btn {
        display: flex;
    }

    .filter-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .filter-actions {
        flex-direction: column;
        position: sticky;
        bottom: 0;
        background: var(--filter-bg);
        padding: 20px;
        margin: 0 -20px -20px;
        border-top: 2px solid var(--gray-200);
    }

    .btn-clear,
    .btn-apply {
        width: 100%;
        padding: 16px;
    }
}

/* ========== MOBILE PEQUENO ========== */
@media (max-width: 480px) {
    .filter-container {
        padding: 16px;
    }

    .filter-header {
        margin: -16px -16px 16px;
        padding: 16px;
    }

    .filter-header h3 {
        font-size: 18px;
    }

    .filter-actions {
        padding: 16px;
        margin: 0 -16px -16px;
    }
}

/* ========== OVERLAY PARA MOBILE ========== */
.filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(4px);
}

.filter-overlay.active {
    display: block;
}

/* ========== ESTADOS DE LOADING ========== */
.filter-loading {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 40px;
    gap: 12px;
    color: var(--gray-600);
    font-size: 15px;
}

.filter-loading.active {
    display: flex;
}

.filter-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== ACESSIBILIDADE ========== */
.filter-group select:focus-visible,
.filter-group input:focus-visible,
.btn-clear:focus-visible,
.btn-apply:focus-visible,
.filter-toggle-btn:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

/* ========== DARK MODE (OPCIONAL) ========== */
@media (prefers-color-scheme: dark) {
    /* Implementar se necessário */
}