/* Search Engine Styles */
:root {
    --hero-bg: #0A192F;
    --hero-overlay: rgba(0, 0, 0, 0.4);
    --search-bar-bg: #FFFFFF;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    background-color: #F8FAFC;
}

/* Navbar (Public) */
.public-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    margin-left: 30px;
}

.nav-links .btn-login {
    background: white;
    color: var(--primary);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.nav-links .btn-login:hover {
    background: #E2E8F0;
}

/* Hero Section */
.hero {
    position: relative;
    height: 70vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary); /* Fallback */
    background-image: linear-gradient(var(--hero-overlay), var(--hero-overlay)), url('https://images.unsplash.com/photo-1512917774080-9991f1c4c750?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
}

.hero-content {
    text-align: center;
    color: white;
    width: 100%;
    max-width: 900px;
    padding: 0 20px;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

/* Unified Search Bar */
.search-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
}

.search-tabs {
    display: flex;
    padding: 5px 10px;
    border-bottom: 1px solid #E2E8F0;
    margin-bottom: 10px;
}

.search-tab {
    padding: 10px 20px;
    color: var(--text-light);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.search-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.search-fields {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
}

.search-field {
    flex: 1;
    position: relative;
    text-align: left;
}

.search-field label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 5px;
    padding-left: 5px;
}

.search-field select,
.search-field input {
    width: 100%;
    padding: 12px;
    border: none;
    background: #F8FAFC;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: var(--text-main);
    box-sizing: border-box;
}

.search-field select:focus,
.search-field input:focus {
    outline: 2px solid var(--primary);
}

.btn-search {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 30px;
    height: 50px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
    align-self: flex-end;
}

.btn-search:hover {
    background: #002D1A;
}

/* Map Section */
.map-section {
    padding: 40px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Results Grid Area */
.results-section {
    padding: 60px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.results-header h2 {
    font-size: 2rem;
    color: var(--text-main);
    margin: 0;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.property-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.property-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 30px rgba(0,0,0,0.1);
    border-color: var(--secondary);
}

.card-image-container {
    height: 220px;
    background: #E2E8F0;
    position: relative;
    overflow: hidden;
}

.card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F8FAFC, #E2E8F0);
}

.avm-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.avm-badge.great-deal { color: #D97706; } /* Orange/Fire */
.avm-badge.fair-price { color: #059669; } /* Green */

.card-content {
    padding: 20px;
}

.card-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 5px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 10px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-location {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.card-specs {
    display: flex;
    gap: 15px;
    border-top: 1px solid #E2E8F0;
    padding-top: 15px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Loading State */
.loading-spinner {
    text-align: center;
    padding: 50px;
    color: var(--text-light);
    grid-column: 1 / -1;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.empty-state span {
    font-size: 4rem;
    color: #E2E8F0;
}

/* Pagination Controls */
#paginationControls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 24px;
}

#paginationControls button {
    padding: 8px 20px;
    border: 1px solid #E2E8F0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    color: #1e293b;
    transition: all 0.2s;
}

#paginationControls button:hover:not(:disabled) {
    background: #004225;
    color: white;
    border-color: #004225;
}

#paginationControls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #F1F5F9;
}

#paginationControls span {
    font-weight: 500;
    color: #64748B;
    min-width: 80px;
    text-align: center;
}

/* ==================== Responsive ==================== */

@media (max-width: 768px) {
    .public-nav {
        padding: 15px 5%;
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav-links a {
        margin-left: 15px;
        font-size: 0.9rem;
    }

    .hero {
        height: auto;
        min-height: 420px;
        padding: 90px 0 50px;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-content p {
        font-size: 1rem;
        margin-bottom: 25px;
    }

    .search-container {
        padding: 8px;
    }

    .search-fields {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 8px;
    }

    .search-field {
        flex: none;
    }

    .btn-search {
        width: 100%;
        justify-content: center;
        align-self: stretch;
    }

    .results-section,
    .map-section {
        padding: 30px 4%;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 25px;
    }

    .results-header h2 {
        font-size: 1.5rem;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .nav-links {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }

    .nav-links a {
        margin-left: 12px;
    }

    .nav-links .btn-login {
        padding: 8px 16px;
    }

    .hero-content h1 {
        font-size: 1.7rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .card-image-container {
        height: 180px;
    }
}