/**
 * Custom Leaflet Styles for Privacy-First Maps
 * Overrides and enhancements for Leaflet default styles
 */

/* Ensure map container has proper sizing */
.leaflet-container {
    width: 100%;
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Fix marker icon paths (Leaflet default icons) */
.leaflet-default-icon-path {
    background-image: url('https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png');
}

/* Custom marker styles for wellness resources */
.wellness-marker {
    background-color: #10b981;
    border: 2px solid white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.wellness-marker.yoga {
    background-color: #8b5cf6;
}

.wellness-marker.meditation {
    background-color: #3b82f6;
}

.wellness-marker.food {
    background-color: #10b981;
}

.wellness-marker.healing {
    background-color: #ec4899;
}

.wellness-marker.farm {
    background-color: #84cc16;
}

.wellness-marker.market {
    background-color: #f59e0b;
}

/* Custom popup styles */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.leaflet-popup-tip {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Geolocation control styling */
.leaflet-control-locate {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

.leaflet-control-locate a {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #333;
    font-size: 18px;
}

.leaflet-control-locate a:hover {
    background-color: #f9fafb;
}

/* Attribution styling */
.leaflet-control-attribution {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
}

.leaflet-control-attribution a {
    color: #0ea5e9;
    text-decoration: none;
}

.leaflet-control-attribution a:hover {
    text-decoration: underline;
}

/* Zoom control styling */
.leaflet-control-zoom {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
}

.leaflet-control-zoom a {
    width: 34px;
    height: 34px;
    line-height: 34px;
    font-size: 20px;
    color: #333;
    background: white;
    border: none;
}

.leaflet-control-zoom a:hover {
    background: #f3f4f6;
    color: #0ea5e9;
}

.leaflet-control-zoom-in {
    border-bottom: 1px solid #e5e7eb;
}

/* Route polyline styling */
.route-polyline {
    stroke: #0ea5e9;
    stroke-width: 4;
    stroke-opacity: 0.7;
    fill: none;
}

/* Loading indicator for map */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
}

.map-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .leaflet-control-zoom {
        margin-right: 8px;
        margin-top: 8px;
    }

    .leaflet-control-attribution {
        font-size: 10px;
        padding: 2px 6px;
    }

    .leaflet-popup-content {
        margin: 12px;
        font-size: 13px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .leaflet-control-zoom a,
    .leaflet-control-locate a {
        background: #1f2937;
        color: #f9fafb;
    }

    .leaflet-control-zoom a:hover,
    .leaflet-control-locate a:hover {
        background: #374151;
    }

    .leaflet-popup-content-wrapper {
        background: #1f2937;
        color: #f9fafb;
    }

    .leaflet-control-attribution {
        background: rgba(31, 41, 55, 0.8);
        color: #f9fafb;
    }
}
