/* Properties Page Specific Styles */

/* Map Section */
.map-section {
    background: var(--light-grey);
    padding: 100px 0;
}

.map-section .section-header {
    text-align: center;
    margin-bottom: 60px;
}

.map-section .section-header h2 {
    font-size: 3rem;
    color: var(--deep-black) !important;
    margin-bottom: 20px;
}

.map-section .section-header p {
    font-size: 1.2rem;
    color: var(--warm-grey) !important;
    max-width: 600px;
    margin: 0 auto;
}

/* Override any dark mode or conflicting styles */
.map-section h2,
.map-section .section-header h2,
body.dark-mode .map-section .section-header h2,
[data-theme="dark"] .map-section .section-header h2 {
    color: var(--deep-black) !important;
}

.map-section p,
.map-section .section-header p,
body.dark-mode .map-section .section-header p,
[data-theme="dark"] .map-section .section-header p {
    color: var(--warm-grey) !important;
}

.map-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    align-items: start;
}

#properties-map {
    width: 100% !important;
    height: 500px !important;
    min-height: 500px;
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 50%, #1a237e 100%);
    border-radius: 15px;
    border: 3px solid var(--primary-gold);
    position: relative;
    overflow: hidden;
    display: block;
}

/* Ensure Google Maps displays properly */
#properties-map .gm-style,
#properties-map > div {
    height: 100% !important;
    width: 100% !important;
    border-radius: 12px;
}

/* Legacy Leaflet support (if needed) */
#properties-map .leaflet-container {
    height: 100% !important;
    width: 100% !important;
    border-radius: 12px;
}

.map-legend {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--primary-gold);
}

.map-legend h4 {
    font-size: 1.5rem;
    color: var(--deep-black);
    margin-bottom: 25px;
    text-align: center;
}

.location-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.location-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-radius: 10px;
    background: var(--light-grey);
    transition: all 0.3s ease;
    cursor: pointer;
}

.location-item:hover {
    background: var(--primary-gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.location-item:hover span {
    color: var(--deep-black);
}

.location-item.active {
    background: var(--primary-gold);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.location-item.active span {
    color: var(--deep-black);
}

.location-item span:first-of-type {
    flex: 1;
    font-weight: 500;
    color: var(--deep-black);
}

.property-count {
    font-size: 0.85rem;
    color: var(--warm-grey);
    font-weight: 400;
}

.location-item:hover .property-count,
.location-item.active .property-count {
    color: var(--deep-black);
    opacity: 0.8;
}

.location-item .icon {
    color: var(--primary-gold);
    flex-shrink: 0;
}

.location-item:hover .icon,
.location-item.active .icon {
    color: var(--deep-black);
}

/* Responsive design for map section */
@media (max-width: 768px) {
    .map-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .map-legend {
        order: -1;
    }

    #properties-map {
        min-height: 400px;
    }

    .map-section .section-header h2 {
        font-size: 2.2rem;
    }
}

/* Properties Hero */
.properties-hero {
    height: 60vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.properties-hero .hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.unsplash.com/photo-1600607687920-4e2a09cf159d?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80') center/cover;
    z-index: 0;
}

/* Dark mode support for properties hero */
@media (prefers-color-scheme: dark) {
    .properties-hero .hero-background {
        filter: brightness(0.85) contrast(1.1);
    }

    .properties-hero .hero-overlay {
        background: rgba(26, 26, 26, 0.4) !important;
    }
}

[data-theme="dark"] .properties-hero .hero-background,
body.dark-mode .properties-hero .hero-background {
    filter: brightness(0.85) contrast(1.1);
}

[data-theme="dark"] .properties-hero .hero-overlay,
body.dark-mode .properties-hero .hero-overlay {
    background: rgba(26, 26, 26, 0.4) !important;
}

.properties-hero .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.6);
    z-index: 2;
}

.properties-hero .hero-content {
    z-index: 10;
    padding-top: 80px;
}

.properties-hero h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.properties-hero p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Search Section */
.search-section {
    background: var(--light-grey);
    padding: 60px 0;
}

.search-container {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.search-container h3 {
    font-size: 2rem;
    color: var(--deep-black);
    margin-bottom: 30px;
    text-align: center;
}

.search-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 500;
    color: var(--deep-black);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.filter-group select {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-gold);
}

.search-btn {
    background: var(--primary-gold);
    color: var(--deep-black);
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.search-btn:hover {
    background: #B8941F;
    transform: translateY(-2px);
}

/* Properties Section */
.properties-section {
    padding: 80px 0;
}

.properties-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
}

.properties-section .section-header h2 {
    margin-bottom: 0;
}

.view-options {
    display: flex;
    gap: 10px;
}

.view-btn {
    background: transparent;
    border: 2px solid var(--warm-grey);
    color: var(--warm-grey);
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn.active,
.view-btn:hover {
    background: var(--primary-gold);
    border-color: var(--primary-gold);
    color: var(--deep-black);
}

/* Enhanced Property Cards */
.properties-grid .property-card {
    position: relative;
}

.property-status {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.image-gallery-indicator {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
}

.property-overlay {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.property-highlights {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.property-highlights span {
    background: var(--primary-gold);
    color: var(--deep-black);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Active Navigation */
.nav-link.active {
    color: var(--primary-gold);
}

.nav-link.active::after {
    width: 100%;
}

/* Load More */
.load-more {
    text-align: center;
    margin-top: 60px;
}

/* Map Section */
.map-section {
    background: var(--light-grey);
    padding: 80px 0;
}

.map-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.map-placeholder {
    height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    color: var(--warm-grey);
    font-size: 1.1rem;
    text-align: center;
}

.map-placeholder p:first-child {
    font-size: 3rem;
    margin-bottom: 10px;
}

/* Map Legend */
.map-legend {
    background: var(--light-grey);
    padding: 25px;
    margin-top: 20px;
    border-radius: 10px;
}

.map-legend h4 {
    color: var(--deep-black);
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
}

.location-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.location-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.location-item:hover {
    border-color: var(--primary-gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.location-item span:first-of-type {
    font-weight: 500;
    color: var(--deep-black);
    flex: 1;
}

.location-item .property-count {
    font-size: 0.85rem;
    color: var(--warm-grey);
    font-weight: 400;
}

.location-item.active {
    border-color: var(--primary-gold);
    background: rgba(212, 175, 55, 0.1);
}

/* Map Marker Animation */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(212, 175, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

/* Map Marker Hover Effects */
.map-marker:hover {
    transform: scale(1.2);
    transition: transform 0.2s ease;
}

.map-marker:hover .marker-label {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(-5px);
}

.map-marker.active {
    background: white !important;
    transform: scale(1.3);
}

/* Google Maps Overlay Marker Styling */
.map-marker-overlay {
    transition: all 0.3s ease;
    z-index: 1000;
}

.map-marker-overlay:hover {
    z-index: 1001;
}

.marker-popup {
    z-index: 1002;
}

/* Ensure markers are clickable */
.map-overlay {
    pointer-events: none;
}

.map-marker-overlay {
    pointer-events: auto;
}

/* List View */
.properties-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.properties-grid.list-view .property-card {
    display: grid;
    grid-template-columns: 300px 1fr;
    max-height: 200px;
}

.properties-grid.list-view .property-image {
    height: 200px;
}

.properties-grid.list-view .property-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.properties-grid.list-view .property-features {
    flex-wrap: wrap;
}

.properties-grid.list-view .property-highlights {
    margin-top: 10px;
}

/* Property Card Hover Effects */
.property-card:hover .property-image img {
    transform: scale(1.05);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .properties-hero h1 {
        font-size: 2.5rem;
    }

    .search-filters {
        grid-template-columns: 1fr;
    }

    .properties-section .section-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .properties-grid.list-view .property-card {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .properties-grid.list-view .property-image {
        height: 250px;
    }

    .view-options {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .properties-hero h1 {
        font-size: 2.2rem;
    }

    .properties-section h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .properties-hero h1 {
        font-size: 2rem;
    }

    .search-container {
        padding: 20px;
    }

    .search-container h3 {
        font-size: 1.5rem;
    }

    .location-list {
        grid-template-columns: 1fr;
    }

    .location-item {
        padding: 10px 12px;
    }
}

/* Loading Animation */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-grey);
    border-top: 4px solid var(--primary-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Filter Animation */
.property-card.filtered-out {
    display: none;
}

.property-card.filtered-in {
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}