/**
 * Map Search Styles
 * Full-page property map search interface
 */

/* Container Layout */
.map-search-container {
    display: flex;
    height: calc(100vh - 200px); /* Adjust based on header/footer height */
    min-height: 600px;
    position: relative;
}

/* Sidebar */
.map-search-sidebar {
    width: 320px;
    background: #fff;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    margin: 0;
    font-weight: 600;
}

.btn-close-sidebar {
    font-size: 2rem;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    opacity: 0.5;
}

.btn-close-sidebar:hover {
    opacity: 1;
}

.sidebar-content {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
}

/* Property Count */
.property-count {
    text-align: center;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.property-count span {
    color: #0d6efd;
    font-size: 1.5rem;
}

/* Filter Groups */
.filter-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.filter-group:last-child {
    border-bottom: none;
}

.filter-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #495057;
}

.filter-group .form-check {
    margin-bottom: 0.5rem;
}

.filter-group .form-check:last-child {
    margin-bottom: 0;
}

/* Filter Actions */
.filter-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #dee2e6;
}

/* Map Wrapper */
.map-search-map-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Map Container */
.property-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Loading Overlay */
.map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.map-loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Mobile Toggle Button */
.btn-toggle-sidebar {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1001;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.btn-toggle-sidebar .icon {
    margin-right: 0.5rem;
}

/* Custom Markers */
.custom-marker {
    background: transparent;
    border: none;
}

.marker-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.custom-marker:hover .marker-inner {
    transform: scale(1.2);
}

/* Marker Colors by Status */
.marker-active .marker-inner {
    background-color: #28a745;
}

.marker-pending .marker-inner {
    background-color: #ffc107;
}

.marker-sold .marker-inner {
    background-color: #dc3545;
}

.marker-default .marker-inner {
    background-color: #6c757d;
}

/* Property Popup */
.property-popup .leaflet-popup-content-wrapper {
    border-radius: 8px;
    padding: 0;
}

.property-popup .leaflet-popup-content {
    margin: 0;
    width: 280px !important;
}

.property-popup-content {
    padding: 1rem;
}

.popup-header {
    margin-bottom: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.popup-header .badge {
    font-size: 0.75rem;
}

.popup-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #212529;
}

.popup-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0d6efd;
    margin-bottom: 0.75rem;
}

.popup-details {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.popup-details span {
    white-space: nowrap;
}

.popup-actions {
    margin-top: 1rem;
}

/* Marker Cluster Customization */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: rgba(13, 110, 253, 0.6);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background-color: rgba(13, 110, 253, 0.8);
    color: #fff;
    font-weight: 700;
}

/* Responsive Design */
@media (max-width: 991px) {
    .map-search-sidebar {
        position: absolute;
        left: -320px;
        height: 100%;
        transition: left 0.3s ease-in-out;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }

    .map-search-sidebar.show {
        left: 0;
    }

    .btn-toggle-sidebar {
        display: block;
    }
}

@media (min-width: 992px) {
    .btn-toggle-sidebar,
    .btn-close-sidebar {
        display: none;
    }
}

/* Small Screens */
@media (max-width: 575px) {
    .map-search-container {
        height: calc(100vh - 150px);
    }

    .map-search-sidebar {
        width: 280px;
        left: -280px;
    }

    .sidebar-content {
        padding: 0.75rem;
    }

    .filter-group {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .popup-title {
        font-size: 0.9rem;
    }

    .popup-price {
        font-size: 1.1rem;
    }

    .popup-details {
        font-size: 0.8rem;
        flex-wrap: wrap;
    }
}

/* Parcel Popup Styles */
.parcel-popup-content {
    padding: 0.5rem;
    min-width: 200px;
}

.parcel-popup-content h6 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: #212529;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5rem;
}

.parcel-details p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
    line-height: 1.4;
}

.parcel-details strong {
    color: #495057;
    font-weight: 600;
}

/* Parcel Layer Styles */
.leaflet-interactive.parcel-boundary {
    stroke: #3388ff;
    stroke-width: 2;
    stroke-opacity: 0.6;
    fill-opacity: 0.1;
}

.leaflet-interactive.parcel-boundary:hover {
    stroke: #0d6efd;
    stroke-width: 3;
    fill-opacity: 0.2;
}

/* Parcel Toggle Hint */
.filter-group small.text-muted {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Print Styles */
@media print {
    .map-search-sidebar,
    .btn-toggle-sidebar,
    .map-loading-overlay {
        display: none !important;
    }

    .map-search-container {
        height: auto;
    }

    .property-map {
        height: 800px;
    }
}
