/*
    Map Component Styles
    Created: 2025-11-04
    Description: Styles for Leaflet/Mapbox map containers with responsive design
*/

/* Main map container */
#mapid {
    height: 450px;
    min-height: 300px;
    width: 100%;
    border-radius: var(--border-radius-sm, 4px);
    box-shadow: var(--shadow-md, 0 2px 4px rgba(0, 0, 0, 0.1));
    overflow: hidden; /* Ensures rounded corners work properly */
    background-color: #f0f0f0; /* Fallback while map loads */
}

/* Loading state */
#mapid.map-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Map wrapper for better layout control */
.map-container {
    margin: var(--spacing-lg, 24px) 0;
    padding: var(--spacing-md, 16px);
    background-color: var(--background-white, #ffffff);
    border-radius: var(--border-radius-md, 6px);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Map title styling */
.map-title {
    margin-bottom: var(--spacing-md, 16px);
    font-size: var(--font-size-xl, 1.25rem);
    color: var(--primary-color, #009688);
    font-weight: 600;
}

/* Map controls customization */
.leaflet-control-zoom,
.leaflet-control-attribution {
    font-family: var(--font-family-primary, 'Roboto', sans-serif);
}

/* Custom marker popup styles */
.leaflet-popup-content-wrapper {
    border-radius: var(--border-radius-sm, 4px);
    box-shadow: var(--shadow-lg, 0 4px 8px rgba(0, 0, 0, 0.15));
}

.leaflet-popup-content {
    font-family: var(--font-family-primary, 'Roboto', sans-serif);
    font-size: var(--font-size-base, 1rem);
    line-height: 1.6;
}

/* Map info panel (if needed) */
.map-info {
    padding: var(--spacing-md, 16px);
    background-color: var(--background-color, #f5f5f5);
    border-radius: var(--border-radius-sm, 4px);
    margin-top: var(--spacing-md, 16px);
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--text-light, #666666);
}

/* Responsive breakpoints */

/* Tablet screens */
@media (max-width: 768px) {
    #mapid {
        height: 350px;
        min-height: 250px;
    }

    .map-container {
        padding: var(--spacing-sm, 8px);
        margin: var(--spacing-md, 16px) 0;
    }

    .map-title {
        font-size: var(--font-size-lg, 1.125rem);
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    #mapid {
        height: 300px;
        min-height: 200px;
        border-radius: 0; /* Full width on small screens */
    }

    .map-container {
        padding: var(--spacing-xs, 4px);
        margin: var(--spacing-sm, 8px) 0;
        border-radius: 0;
    }

    .leaflet-control-zoom {
        transform: scale(0.9); /* Slightly smaller controls on mobile */
    }
}

/* Print styles - show map placeholder */
@media print {
    #mapid {
        height: 400px;
        border: 2px solid var(--border-color, #dddddd);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #mapid::after {
        content: "Map view - see online version for interactive map";
        color: var(--text-light, #666666);
        font-size: var(--font-size-sm, 0.875rem);
    }
}

/* Full-screen map variant */
#mapid.map-fullscreen {
    height: 100vh;
    min-height: 100vh;
    border-radius: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

/* Small map variant for embedded use */
#mapid.map-small {
    height: 250px;
    min-height: 200px;
}

/* Large map variant */
#mapid.map-large {
    height: 600px;
    min-height: 400px;
}
