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

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --text-color: #1e293b;
    --text-light: #64748b;
    --bg-color: #ffffff;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light);
}

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

/* Header */
.site-header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

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

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

/* Breadcrumbs and Search Row */
.breadcrumb-search-row {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

.breadcrumb-search-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.breadcrumbs {
    flex: 1;
    min-width: 0;
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
}

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

.breadcrumb-item a:hover {
    color: #1e40af;
    text-decoration: underline;
}

.breadcrumb-item.active span {
    color: var(--text-color);
    font-weight: 500;
}

.breadcrumb-item:not(:last-child)::after {
    content: "/";
    margin-left: 0.5rem;
    color: var(--text-light);
}

/* Search Form */
.search-form {
    flex-shrink: 0;
}

.search-input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.search-input {
    min-width: 300px;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-button {
    padding: 0.5rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.search-button:hover {
    background-color: #1e40af;
}

.search-button:active {
    background-color: #1e3a8a;
}

/* Hero Section with Background Image */
.hero {
    background: url('/images/hero.webp');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

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

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

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

/* Sections */
.featured-section {
    padding: 4rem 0;
}

.featured-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.section-footer {
    text-align: center;
    margin-top: 3rem;
}

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

/* Listing Card */
.listing-card {
    background-color: var(--bg-color);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

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

.listing-image {
    aspect-ratio: 4/3;
    overflow: hidden;
}

.listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-details {
    padding: 1.5rem;
}

.listing-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.listing-location {
    color: var(--text-light);
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.listing-teaser {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.listing-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.listing-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.price-frequency {
    font-size: 1rem;
    color: var(--text-light);
}

/* Listings Page */
.listings-page {
    padding: 2rem 0;
}

.page-header {
    margin-bottom: 2rem;
}

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

.listings-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.listings-layout.no-filters {
    grid-template-columns: 1fr;
}

/* Filter Form */
.filters-sidebar {
    background-color: var(--bg-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    height: fit-content;
}

.filter-form h3 {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    font-size: 1rem;
}

.filter-form .btn {
    width: 100%;
    margin-top: 0.5rem;
}

/* Listings Header */
.listings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.results-count {
    font-size: 0.875rem;
    color: var(--text-light);
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-options label {
    font-size: 0.875rem;
    color: var(--text-light);
}

.sort-select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    font-size: 0.875rem;
    background-color: var(--bg-color);
}

/* Detail Page */
.detail-page {
    padding: 2rem 0;
}

.detail-header {
    margin-bottom: 2rem;
}

.detail-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.detail-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

.detail-main {
    background-color: var(--bg-color);
    padding: 2rem;
    border-radius: 0.5rem;
}

.hero-image {
    margin-bottom: 1.5rem;
}

.hero-image img {
    width: 100%;
    border-radius: 0.75rem;
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    cursor: zoom-in;
}

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.thumb-item {
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.thumb-item:hover,
.thumb-item:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
    outline: none;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.property-price {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

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

.property-features,
.property-description,
.key-highlights,
.amenities,
.location-info,
.map-section {
    margin-bottom: 2rem;
}

.property-features h3,
.property-description h3,
.key-highlights h3,
.amenities h3,
.location-info h3,
.map-section h3 {
    margin-bottom: 1rem;
}

.features-list,
.amenities-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.features-list li,
.amenities-list li {
    padding: 0.5rem;
    background-color: var(--bg-light);
    border-radius: 0.25rem;
}

.key-highlights ul {
    list-style: disc;
    padding-left: 1.5rem;
}

.key-highlights li {
    margin-bottom: 0.5rem;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 9999;
    padding: 1.5rem;
}

.lightbox-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-figure {
    margin: 0;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 0.5rem;
    box-shadow: 0 15px 40px rgba(0,0,0,0.35);
    background: #0f172a;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    border: none;
    background: rgba(255,255,255,0.14);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.15s ease, transform 0.15s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}

.lightbox-close {
    top: 16px;
    right: 16px;
    font-size: 28px;
    font-weight: 600;
}

.lightbox-prev {
    left: 18px;
}

.lightbox-next {
    right: 18px;
}

@media (max-width: 768px) {
    .lightbox-prev,
    .lightbox-next {
        top: unset;
        bottom: 16px;
    }
    .lightbox-prev { left: 20%; }
    .lightbox-next { right: 20%; }
}

/* Location Info */
.location-info p {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.location-info .landmark {
    color: var(--text-light);
    font-style: italic;
}

/* Map Section */
.map-container {
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.map-container iframe {
    display: block;
    width: 100%;
}

.map-links {
    text-align: center;
    font-size: 0.875rem;
}

.map-links a {
    color: var(--primary-color);
    text-decoration: none;
}

.map-links a:hover {
    text-decoration: underline;
}

/* Sidebar */
.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.agent-card,
.property-details-box,
.contact-form-card {
    background-color: var(--bg-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
}

.agent-card h3,
.property-details-box h3,
.contact-form-card h3 {
    margin-bottom: 1rem;
}

.agent-info h4 {
    margin-bottom: 0.5rem;
}

.agent-info p {
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.property-details-box dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.property-details-box dt {
    font-weight: 500;
}

.property-details-box dd {
    color: var(--text-light);
}

/* Contact Form */
.contact-intro {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.contact-form .form-group {
    margin-bottom: 1rem;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.contact-form textarea {
    resize: vertical;
    min-height: 100px;
}

.contact-form .btn-block {
    width: 100%;
    margin-top: 0.5rem;
}

.contact-privacy {
    margin-top: 1rem;
    margin-bottom: 0;
    color: var(--text-light);
    text-align: center;
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
}

.alert-error {
    background-color: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.alert strong {
    font-weight: 600;
}

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

.footer-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
}

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

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icon:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.social-icon svg {
    width: 20px;
    height: 20px;
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 0;
}

/* Error Pages */
.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
}

.error-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.error-code {
    font-size: 8rem;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 1rem;
}

.error-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.error-message {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Pagination */
.pagination {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.pagination-list {
    display: flex;
    list-style: none;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-item {
    display: inline-block;
}

.pagination-link {
    display: block;
    padding: 0.5rem 0.75rem;
    min-width: 2.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s;
    background-color: var(--bg-color);
}

.pagination-link:hover:not(.disabled):not(.current) {
    background-color: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-link.current {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 500;
}

.pagination-link.disabled {
    color: var(--text-light);
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination-link.ellipsis {
    border: none;
    background: none;
    cursor: default;
}

.pagination-link.ellipsis:hover {
    background: none;
    border: none;
}

/* Content Pages (Privacy, Terms, etc.) */
.content-page {
    padding: 3rem 0;
}

.content {
    background-color: var(--bg-color);
    padding: 3rem;
    border-radius: 0.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.content h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.content h2 {
    font-size: 1.75rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.content h3 {
    font-size: 1.375rem;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.content h4 {
    font-size: 1.125rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 600;
}

.content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.content ul,
.content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.content strong {
    font-weight: 600;
    color: var(--text-color);
}

.content a {
    color: var(--primary-color);
    text-decoration: none;
}

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

.content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

.content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-style: italic;
}

.footer-links {
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    margin: 0 0.5rem;
}

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

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
        font-size: 0.875rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .breadcrumb-search-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .search-form {
        width: 100%;
    }

    .search-input-wrapper {
        width: 100%;
    }

    .search-input {
        min-width: 0;
        flex: 1;
    }

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

    .listings-layout {
        grid-template-columns: 1fr;
    }

    .filters-sidebar {
        order: 2;
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 1.5rem;
    }

    .content h1 {
        font-size: 2rem;
    }

    .content h2 {
        font-size: 1.5rem;
    }

    .content h3 {
        font-size: 1.25rem;
    }
}
