/* ============================================================================
   GARIMPEIRO DE IMÓVEIS - Estilos CSS
   ============================================================================ */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --light-bg: #ecf0f1;
    --text-color: #2c3e50;
    --border-color: #bdc3c7;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: #f5f7fa;
    line-height: 1.6;
}

/* ============================================================================
   CONTAINER
   ============================================================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================================
   NAVBAR
   ============================================================================ */

.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand h1 {
    font-size: 24px;
    font-weight: bold;
}

.navbar-brand .subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 5px;
}

.navbar-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-link:hover,
.nav-link.active {
    opacity: 0.7;
}

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */

.main-content {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

/* ============================================================================
   CARDS DE RESUMO
   ============================================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 32px;
    min-width: 50px;
}

.stat-content h3 {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: var(--secondary-color);
}

/* ============================================================================
   FILTROS
   ============================================================================ */

.filtros-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.filtros-section h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.filtros-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: flex-end;
}

.filtro-grupo {
    display: flex;
    flex-direction: column;
}

.filtro-grupo label {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 14px;
}

.filtro-grupo select,
.filtro-grupo input {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.filtro-grupo select:focus,
.filtro-grupo input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* ============================================================================
   BOTÕES
   ============================================================================ */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background-color: var(--light-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #d5dbeb;
}

.btn-danger {
    background-color: var(--accent-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* ============================================================================
   SEÇÃO DE IMÓVEIS
   ============================================================================ */

.imoveis-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.imoveis-section h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.info-texto {
    font-weight: 500;
    color: var(--secondary-color);
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

/* ============================================================================
   GRID DE IMÓVEIS
   ============================================================================ */

.imoveis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.imovel-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.imovel-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border-color: var(--secondary-color);
}

.imovel-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 15px;
}

.imovel-id {
    font-size: 12px;
    opacity: 0.8;
}

.imovel-bairro {
    font-size: 18px;
    font-weight: bold;
    margin-top: 5px;
}

.imovel-body {
    padding: 15px;
}

.imovel-campo {
    margin-bottom: 12px;
}

.imovel-label {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 600;
    text-transform: uppercase;
}

.imovel-valor {
    font-size: 16px;
    color: var(--text-color);
    margin-top: 4px;
}

.imovel-preco {
    font-size: 20px;
    font-weight: bold;
    color: var(--success-color);
    margin-bottom: 10px;
}

.imovel-descricao {
    font-size: 14px;
    color: #555;
    line-height: 1.4;
    margin-bottom: 10px;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.imovel-footer {
    border-top: 1px solid var(--light-bg);
    padding-top: 12px;
    display: flex;
    gap: 10px;
}

.imovel-footer .btn {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    font-size: 13px;
}

/* ============================================================================
   PAGINAÇÃO
   ============================================================================ */

.paginacao {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
}

#info-pagina {
    font-weight: 500;
    color: var(--text-color);
}

/* ============================================================================
   SEÇÃO DE ESTATÍSTICAS
   ============================================================================ */

.stats-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.stats-section h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.stats-detalhes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stats-box {
    background: var(--light-bg);
    padding: 15px;
    border-radius: 6px;
}

.stats-box h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 16px;
}

.lista-stats {
    list-style: none;
}

.lista-stats li {
    padding: 10px;
    background: white;
    margin-bottom: 8px;
    border-radius: 4px;
    border-left: 3px solid var(--secondary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.lista-stats strong {
    color: var(--secondary-color);
}

/* ============================================================================
   MODAL
   ============================================================================ */

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--accent-color);
}

.modal-campo {
    margin-bottom: 15px;
}

.modal-label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.modal-valor {
    font-size: 16px;
    color: var(--text-color);
}

.modal-preco {
    font-size: 24px;
    font-weight: bold;
    color: var(--success-color);
    margin: 15px 0;
}

.modal-link {
    display: inline-block;
    margin-top: 20px;
    width: 100%;
}

/* ============================================================================
   ALERTAS
   ============================================================================ */

.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    border-left: 4px solid;
}

.alert-danger {
    background-color: #fadbd8;
    border-color: var(--accent-color);
    color: #922b21;
}

.alert-success {
    background-color: #d5f4e6;
    border-color: var(--success-color);
    color: #186a3b;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

.footer a {
    color: var(--secondary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ============================================================================
   ERRO
   ============================================================================ */

.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.error-content {
    text-align: center;
}

.error-code {
    font-size: 120px;
    font-weight: bold;
    color: var(--accent-color);
    line-height: 1;
}

.error-content h2 {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.error-content p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

/* ============================================================================
   RESPONSIVO
   ============================================================================ */

@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }

    .navbar-menu {
        justify-content: center;
        gap: 15px;
    }

    .filtros-container {
        grid-template-columns: 1fr;
    }

    .controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .imoveis-grid {
        grid-template-columns: 1fr;
    }

    .paginacao {
        flex-wrap: wrap;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .error-code {
        font-size: 80px;
    }
}

@media (max-width: 480px) {
    .navbar-brand h1 {
        font-size: 18px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }
}
