/**
 * Nexa Real Estate - Map Styles
 * Styles for map components including MapPicker and property maps.
 */

/* Map container base styles */
.nexa-map-container {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
    position: relative;
}

.nexa-map-container.nexa-map-picker {
    height: 300px;
    border: 1px solid #e2e8f0;
}

.nexa-map-container.nexa-map-single {
    height: 350px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.nexa-map-container.nexa-map-list {
    height: 100%;
    min-height: 500px;
    border-radius: 12px;
}

/* Map loading state */
.nexa-map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #64748b;
    font-size: 14px;
}

/* Coordinate inputs styling */
.nexa-coords-wrapper {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.nexa-coord-field {
    flex: 1;
    min-width: 140px;
}

.nexa-coord-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 4px;
}

.nexa-coord-field input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    color: #1f2937;
}

.nexa-coord-field input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.nexa-coord-field input.nexa-input-error {
    border-color: #ef4444;
}

.nexa-coord-error {
    color: #ef4444;
    font-size: 11px;
    margin-top: 2px;
}

.nexa-map-hint {
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid #4f46e5;
}

/* Two-column properties layout */
.nexa-properties-split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.nexa-properties-list-column {
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.nexa-properties-map-column {
    position: sticky;
    top: 20px;
    height: calc(100vh - 200px);
    min-height: 500px;
}

/* Popup styling for clustered markers */
.nexa-map-popup {
    padding: 0;
    min-width: 200px;
}

.nexa-map-popup .leaflet-popup-content {
    margin: 0;
    padding: 0;
}

.nexa-map-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
}

.nexa-popup-content {
    padding: 0;
    min-width: 200px;
}

.nexa-popup-image {
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: linear-gradient(145deg, #e2e8f0, #f8fafc);
}

.nexa-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nexa-popup-details {
    padding: 12px;
}

.nexa-popup-title {
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
    margin: 0 0 4px;
}

.nexa-popup-address {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 8px;
}

.nexa-popup-price {
    font-weight: 700;
    color: #16a34a;
    font-size: 14px;
    margin: 0 0 8px;
}

.nexa-popup-link {
    display: inline-block;
    font-size: 12px;
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
}

.nexa-popup-link:hover {
    text-decoration: underline;
}

/* Property card hover state for map interaction */
.nexa-property-card.nexa-property-highlighted {
    border: 2px solid #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

/* Location section on single property */
.nexa-location-section {
    margin-top: 24px;
    background: #ffffff;
    border-radius: 5px;
    padding: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.nexa-location-section h3 {
    margin-top: 0;
    margin-bottom: 14px;
    font-size: 18px;
    color: #0f172a;
}

.nexa-location-address {
    font-size: 14px;
    color: #475569;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Marker cluster styles */
.nexa-cluster-icon {
    background: #4f46e5;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.nexa-cluster-icon-small {
    width: 36px;
    height: 36px;
}

.nexa-cluster-icon-medium {
    width: 42px;
    height: 42px;
    font-size: 14px;
}

.nexa-cluster-icon-large {
    width: 48px;
    height: 48px;
    font-size: 15px;
}

/* Location tab in modal */
.nexa-location-tab-content {
    padding: 8px 0;
}

/* Responsive styles */
@media (max-width: 1024px) {
    .nexa-properties-split-layout {
        grid-template-columns: 1fr;
    }

    .nexa-properties-map-column {
        height: 400px;
        min-height: 400px;
        position: relative;
        top: 0;
        order: -1;
    }

    .nexa-properties-list-column {
        max-height: none;
    }
}

@media (max-width: 640px) {
    .nexa-coords-wrapper {
        flex-direction: column;
    }

    .nexa-coord-field {
        width: 100%;
    }

    .nexa-map-container.nexa-map-picker {
        height: 250px;
    }

    .nexa-properties-map-column {
        height: 300px;
        min-height: 300px;
        margin-bottom: 50%;
    }
}
