/**
 * Simple Map CSS
 * Minimal CSS for the visual map shortcode with enhanced Elementor compatibility
 */

/* Map wrapper for better Elementor compatibility */
.simple-map-wrapper {
    width: 100%;
    height: 100%;
    min-height: 400px;
    position: relative;
    overflow: hidden;
}

/* Map container */
.simple-map-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Elementor compatibility classes */
/* These classes work with Elementor's structure */
.elementor-widget-wrap .simple-map-wrapper,
.elementor-widget-container .simple-map-wrapper,
.elementor-inner-section .simple-map-wrapper,
.elementor-column .simple-map-wrapper {
    height: 100%;
    min-height: 400px;
}

/* Full height in Elementor sections */
.elementor-section.elementor-section-height-full .simple-map-wrapper {
    height: 100vh;
}

/* Make parent Elementor widgets have height - crucial for map to display */
.elementor-widget:has(.simple-map-wrapper) {
    height: 100%;
}

/* Fix for Elementor columns with no height */
.elementor-column:has(.simple-map-wrapper) {
    min-height: 400px;
}

/* Simple marker popup */
.simple-marker-popup {
    padding: 5px 0;
    text-align: center;
}

.simple-marker-popup h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.simple-marker-popup .view-listing-button {
    display: inline-block;
    background-color: #4CAF50;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
    margin: 5px auto;
}

.simple-marker-popup .view-listing-button:hover {
    background-color: #3e8e41;
    color: white;
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: 6px;
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    width: 180px !important;
    padding: 10px;
}

.leaflet-popup-tip {
    background-color: white;
}

/* Custom controls appearance */
.leaflet-control-zoom {
    margin-top: 70px !important; /* Give space at the top for Elementor editor */
}

.leaflet-control-zoom a {
    color: #333 !important;
    background-color: white !important;
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 15px;
    border-radius: 4px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

.leaflet-control-zoom a:hover {
    background-color: #f8f8f8 !important;
    color: #4CAF50 !important;
}

/* Attribution positioning and styling */
.leaflet-control-attribution {
    font-size: 9px !important;
    background-color: rgba(255, 255, 255, 0.7) !important;
    padding: 3px 8px !important;
    border-radius: 4px 0 0 0 !important;
}

/* Make map look good at different screen sizes */
@media (max-width: 1024px) {
    .simple-map-wrapper {
        min-height: 350px;
    }
    
    .elementor-column:has(.simple-map-wrapper) {
        min-height: 350px;
    }
}

@media (max-width: 768px) {
    .simple-map-wrapper {
        min-height: 300px;
    }
    
    .elementor-column:has(.simple-map-wrapper) {
        min-height: 300px;
    }
    
    .leaflet-control-zoom a {
        width: 32px;
        height: 32px;
        line-height: 32px;
    }
}

@media (max-width: 480px) {
    .simple-map-wrapper {
        min-height: 250px;
    }
    
    .elementor-column:has(.simple-map-wrapper) {
        min-height: 250px;
    }
} 