/**
 * Map Widget Styles for ICDP Projects
 * Provides responsive styling for Leaflet maps with custom markers and circles
 */

/* Map tile container */
.icdp-map-tile {
    margin-bottom: 1.5rem;
}

.icdp-map-tile .tile-header {
    margin-bottom: 1rem;
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

/* Map container */
.icdp-map-tile .map-container {
    width: 100%;
    height: 300px;
    min-height: 200px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    background-color: #f0f0f0;
}

/* Leaflet map styling */
.icdp-map-tile .leaflet-container {
    width: 100% !important;
    height: 100% !important;
    font-family: inherit;
}

/* Custom wellhole markers - red pins as specified in FR-012 */
.icdp-wellhole-marker {
    background: transparent;
    border: none;
}

.icdp-wellhole-marker .marker-pin {
    width: 12px;
    height: 20px;
    background-color: #900;
    border: 2px solid white;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: relative;
}

.icdp-wellhole-marker .marker-pin::after {
    content: '';
    width: 4px;
    height: 4px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
}

/* No coordinates message */
.icdp-map-tile .no-coordinates-message {
    padding: 2rem;
    text-align: center;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #6c757d;
}

/* No JavaScript fallback */
.icdp-map-tile .no-js-fallback {
    padding: 1.5rem;
    text-align: center;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
    margin: 0;
}

/* Map fallback message */
.icdp-map-tile .map-fallback {
    padding: 20px;
    text-align: center;
    color: #666;
    border: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .icdp-map-tile .map-container {
        height: 250px;
        min-height: 200px;
    }
    
    .icdp-map-tile .tile-header {
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
    .icdp-map-tile .map-container {
        height: 200px;
    }
    
    .icdp-map-tile .no-coordinates-message,
    .icdp-map-tile .no-js-fallback {
        padding: 1rem;
        font-size: 0.9em;
    }
}

/* Ensure Leaflet controls are properly styled */
.icdp-map-tile .leaflet-control-zoom {
    border: 1px solid #ccc;
    border-radius: 4px;
}

.icdp-map-tile .leaflet-control-layers {
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
}

.icdp-map-tile .leaflet-control-layers-toggle {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='%23666' d='M1 2.5A1.5 1.5 0 0 1 2.5 1h3A1.5 1.5 0 0 1 7 2.5v3A1.5 1.5 0 0 1 5.5 7h-3A1.5 1.5 0 0 1 1 5.5v-3zM2.5 2a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zm6.5.5A1.5 1.5 0 0 1 10.5 1h3A1.5 1.5 0 0 1 15 2.5v3A1.5 1.5 0 0 1 13.5 7h-3A1.5 1.5 0 0 1 9 5.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zM1 10.5A1.5 1.5 0 0 1 2.5 9h3A1.5 1.5 0 0 1 7 10.5v3A1.5 1.5 0 0 1 5.5 15h-3A1.5 1.5 0 0 1 1 13.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zm6.5.5A1.5 1.5 0 0 1 10.5 9h3a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-3A1.5 1.5 0 0 1 9 13.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3z'/%3e%3c/svg%3e");
    width: 36px;
    height: 36px;
}

.icdp-map-tile .leaflet-control-layers-expanded {
    padding: 6px 10px 6px 6px;
}

.icdp-map-tile .leaflet-control-layers-list {
    font-size: 13px;
    line-height: 1.4;
}

.icdp-map-tile .leaflet-control-layers input[type="radio"] {
    margin-right: 5px;
}

.icdp-map-tile .leaflet-control-attribution {
    background-color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    line-height: 1.3;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .icdp-map-tile .map-container {
        border: 2px solid #000;
    }
    
    .icdp-wellhole-marker .marker-pin {
        border: 3px solid white;
        box-shadow: 0 2px 6px rgba(0,0,0,0.8);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .icdp-map-tile .leaflet-zoom-animated {
        transition: none !important;
    }
}