/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
}

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

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

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.cta-center {
    text-align: center;
    margin-top: 2rem;
}

/* Header */
.site-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.site-logo:hover {
    color: var(--primary-dark);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.main-nav a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.2s;
}

.main-nav a:hover::after {
    transform: scaleX(1);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
}

.hero-tagline {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Sections */
section {
    padding: 3rem 0;
}

.page-header {
    padding: 2rem 0;
    background: var(--background-color);
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

/* Filter Bar */
.filter-bar {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

/* Results Info */
.results-info {
    padding: 1rem 0;
    background: var(--background-color);
}

.results-info p {
    color: var(--text-muted);
}

/* Search Form */
.search-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-form input {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-form button {
    min-width: 150px;
}

.search-section {
    background: white;
    padding: 3rem 0;
}

.search-section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.search-section .search-form {
    max-width: 600px;
    margin: 0 auto;
}

/* Property Grid */
.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Property Card */
.property-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.property-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.property-image-wrapper {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.property-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.property-placeholder {
    width: 100%;
    height: 100%;
    background: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.property-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.property-badge.sold {
    background: var(--danger-color);
}

.property-info {
    padding: 1.5rem;
}

.property-title-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.property-title {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin: 0;
}

.property-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.property-location {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
}

.property-details {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.property-detail {
    background: var(--background-color);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

.property-detail.type {
    color: var(--primary-color);
    background: var(--primary-light);
}

.property-detail.subtype {
    color: var(--secondary-color);
    background: var(--primary-light);
}

/* Property Detail Page */
.property-header {
    padding: 2rem 0;
    background: white;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--primary-color);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

.breadcrumb-current {
    color: var(--text-primary);
}

.property-header .property-address {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.property-gallery {
    padding: 0;
    background: white;
}

.main-image {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.main-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.thumbnail-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.2s;
}

.thumbnail-grid img:hover {
    transform: scale(1.05);
}

/* Gallery Grid for all images */
.image-gallery {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.image-gallery h4,
.floorplans-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: white;
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item.floorplan {
    border: 2px solid var(--primary-color);
}

.gallery-item.floorplan img {
    height: 200px;
    background: #f0f9ff;
}

.image-caption {
    padding: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: white;
    text-align: center;
}

.floorplans-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Hero Image */
.property-hero {
    margin-bottom: 0;
    padding-bottom: 0;
}

.hero-image {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.hero-image img {
    width: 100%;
    height: auto;
    max-height: 600px;
    display: block;
    object-fit: cover;
}

/* Property Maps */
.property-maps-full {
    margin-top: 1.5rem;
}

.property-maps-full h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.map-image-full {
    width: 100%;
    max-width: 100%;
    margin-bottom: 1rem;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    background: white;
    border: 2px solid var(--success-color);
}

.map-image-full img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 600px;
    object-fit: contain;
    background: #f0fdf4;
}

/* Full-width images under description */
.property-images-full {
    margin-top: 1.5rem;
}

.main-image-full,
.property-image-full,
.floorplan-image-full {
    width: 100%;
    max-width: 100%;
    margin-bottom: 1rem;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    background: white;
}

.main-image-full img,
.property-image-full img,
.floorplan-image-full img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 600px;
    object-fit: contain;
    background: #f8f9fa;
}

.floorplan-image-full {
    border: 2px solid var(--primary-color);
    background: #f0f9ff;
}

.floorplan-image-full img {
    background: white;
}

.property-floorplans-full {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.property-floorplans-full h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.property-details {
    padding: 3rem 0;
    background: white;
}

.property-price-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.property-price-section .property-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.property-status {
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

.property-status.sold {
    background: var(--danger-color);
}

.property-status.for-sale {
    background: var(--success-color);
}

.property-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: var(--background-color);
    border-radius: var(--radius-lg);
}

.property-fact {
    text-align: center;
}

.fact-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.fact-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.property-description {
    margin-bottom: 2.5rem;
}

.property-description h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
}

.description-content {
    line-height: 1.8;
    color: var(--text-secondary);
}

.property-additional {
    margin-bottom: 2.5rem;
}

.property-additional h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
}

.additional-grid {
    display: block;
}

.additional-item {
    display: flex;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border-color);
}

.additional-item:last-child {
    border-bottom: none;
}

.additional-item .item-label {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 180px;
}

.additional-item .item-value {
    flex: 1;
}

.additional-item.full-width {
    display: block;
}

.additional-item.full-width .item-label {
    display: block;
    min-width: auto;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.additional-item.full-width .item-value {
    display: block;
    white-space: pre-wrap;
    margin-left: 0;
}

.item-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.item-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Related Properties */
.related-properties {
    padding: 3rem 0;
    background: var(--background-color);
}

.related-properties h2 {
    text-align: center;
    margin-bottom: 2rem;
}

/* Contact Section */
.contact-section {
    padding: 3rem 0;
    background: white;
    text-align: center;
}

.contact-section h2 {
    margin-bottom: 1rem;
}

.contact-section > p {
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Footer */
.site-footer {
    background: var(--text-primary);
    color: white;
    padding: 2.5rem 0;
    margin-top: 4rem;
}

.site-footer p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0;
    text-align: center;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1.125rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-stats {
        gap: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .property-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .main-nav {
        width: 100%;
        justify-content: flex-start;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-form input {
        width: 100%;
    }
    
    .search-form button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero-tagline {
        font-size: 1rem;
    }
    
    .property-grid {
        grid-template-columns: 1fr;
    }
}
