/* ===== VARIÁVEIS CSS ===== */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    
    --font-family: 'Inter', sans-serif;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* ===== RESET E BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #fff;
}

.main-content {
    padding-top: 76px; /* Altura da navbar fixa */
    min-height: calc(100vh - 76px);
}

/* ===== NAVBAR ===== */
.navbar {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95) !important;
    transition: var(--transition);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.navbar-logo {
    max-height: 40px;
    width: auto;
}

.nav-link {
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--primary-color);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* ===== HERO SECTION ===== */
.hero-section {
    position: relative;
    height: 70vh;
    min-height: 500px;
    overflow: hidden;
}

.hero-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.slide-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,123,255,0.8) 0%, rgba(0,123,255,0.4) 100%);
}

.slide-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
}

.slide-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.slide-subtitle {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 2rem;
}

.slide-location {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 1rem;
}

.slide-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--warning-color);
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.slide-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.slider-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
}

.slider-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.slider-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.slider-dots {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 3;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background: white;
}

/* ===== SEARCH SECTION ===== */
.search-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    padding: 2rem 0;
    margin-top: -100px;
    position: relative;
    z-index: 4;
}

.search-form-wrapper {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.search-form .form-select,
.search-form .form-control {
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: var(--transition);
}

.search-form .form-select:focus,
.search-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* ===== SECTIONS ===== */
.section-header {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.featured-section {
    background: var(--light-color);
}

.category-section {
    padding: 4rem 0;
}

/* ===== IMÓVEL CARD ===== */
.imovel-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.imovel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.imovel-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.imovel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.imovel-card:hover .imovel-image img {
    transform: scale(1.05);
}

.imovel-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
}

.imovel-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transition: var(--transition);
}

.imovel-card:hover .imovel-actions {
    opacity: 1;
}

.imovel-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.imovel-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.imovel-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.imovel-title a {
    color: var(--dark-color);
    transition: var(--transition);
}

.imovel-title a:hover {
    color: var(--primary-color);
}

.imovel-location {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.imovel-features {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.feature {
    font-size: 0.85rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.imovel-corretor {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.corretor-nome {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.imovel-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

/* ===== CTA SECTION ===== */
.cta-section {
    background: linear-gradient(135deg, var(--success-color) 0%, #1e7e34 100%);
    color: white;
}

.cta-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cta-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* ===== CHAT WIDGET ===== */
.chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.chat-toggle {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.chat-toggle:hover {
    transform: scale(1.1);
    background: #0056b3;
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 80%;
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.bot-message {
    align-self: flex-start;
}

.bot-message .message-content {
    background: var(--light-color);
    color: var(--dark-color);
}

.user-message {
    align-self: flex-end;
}

.user-message .message-content {
    background: var(--primary-color);
    color: white;
}

.chat-input {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 0.5rem;
}

.chat-input input {
    flex: 1;
    border: 1px solid #e9ecef;
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    outline: none;
}

.chat-send {
    background: var(--primary-color);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== WHATSAPP FLOAT ===== */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 999;
}

.whatsapp-btn {
    width: 60px;
    height: 60px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    animation: pulse 2s infinite;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    color: white;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* ===== EXIT POPUP ===== */
.exit-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.exit-popup-content {
    background: white;
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideIn 0.3s ease;
}

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

.exit-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-color);
}

.exit-popup-body {
    padding: 2rem;
}

.exit-popup-body h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--dark-color) !important;
}

.footer-brand h5 {
    font-weight: 700;
}

.footer-logo {
    max-height: 60px;
    width: auto;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    transform: translateY(-2px);
    color: white;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #adb5bd;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

.footer-links-inline a {
    text-decoration: none;
    transition: var(--transition);
}

.footer-links-inline a:hover {
    color: white !important;
}

.contact-item {
    display: flex;
    align-items: center;
}

.contact-item a {
    text-decoration: none;
    transition: var(--transition);
}

.contact-item a:hover {
    color: white !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .slide-title {
        font-size: 2.5rem;
    }
    
    .slide-price {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .chat-window {
        width: 300px;
        height: 400px;
    }
    
    .slider-controls {
        padding: 0 1rem;
    }
    
    .slider-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .search-form-wrapper {
        padding: 1.5rem;
    }
    
    .slide-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cta-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .slide-title {
        font-size: 2rem;
    }
    
    .slide-price {
        font-size: 1.5rem;
    }
    
    .chat-widget {
        bottom: 1rem;
        right: 1rem;
    }
    
    .whatsapp-float {
        bottom: 1rem;
        left: 1rem;
    }
    
    .chat-toggle,
    .whatsapp-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .search-form .row > div {
        margin-bottom: 1rem;
    }
    
    .imovel-features {
        gap: 0.5rem;
    }
    
    .feature {
        font-size: 0.8rem;
    }
}

/* ===== UTILITIES ===== */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #1e7e34 100%);
}

.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.form-control,
.form-select {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background: var(--primary-color) !important;
}

/* ===== LOADING ===== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}