/**
 * Leaflet Custom Styles - Mifra Security
 * Stile personalizzato per replicare l'aspetto di Google Maps
 */

/* Import Leaflet base styles */
@import '~leaflet/dist/leaflet.css';

/* Stile generale della mappa */
.leaflet-container {
    font-family: 'Roboto', Arial, sans-serif;
    background: #e5e3df;
}

/* Zoom controls - posizionati in basso a sinistra come Google Maps */
.leaflet-bottom.leaflet-left {
    bottom: 20px;
    left: 20px;
}

.leaflet-control-zoom {
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border-radius: 2px;
}

.leaflet-control-zoom a {
    width: 40px;
    height: 40px;
    line-height: 40px;
    font-size: 18px;
    color: #666;
    background-color: #fff;
    border: none;
    transition: background-color 0.3s;
}

.leaflet-control-zoom a:hover {
    background-color: #f5f5f5;
    color: #333;
}

.leaflet-control-zoom-in {
    border-radius: 2px 2px 0 0;
}

.leaflet-control-zoom-out {
    border-radius: 0 0 2px 2px;
}

/* Toggle buttons per Styled/Satellite */
.leaflet-map-type-control {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    gap: 5px;
}

.leaflet-map-type-btn {
    background: white;
    border: none;
    padding: 8px 16px;
    border-radius: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.leaflet-map-type-btn:hover {
    background-color: #f5f5f5;
    color: #333;
}

.leaflet-map-type-btn.active {
    background-color: #1a73e8;
    color: white;
}

/* Search box autocomplete */
.leaflet-search-container {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 400px;
    max-width: 90%;
}

.leaflet-search-input {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    font-size: 16px;
    outline: none;
}

.leaflet-search-input:focus {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.leaflet-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.leaflet-search-suggestions.show {
    display: block;
}

.leaflet-search-suggestion {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

.leaflet-search-suggestion:last-child {
    border-bottom: none;
}

.leaflet-search-suggestion:hover {
    background-color: #f5f5f5;
}

.leaflet-search-suggestion-main {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.leaflet-search-suggestion-secondary {
    font-size: 13px;
    color: #666;
}

/* Custom marker icon */
.leaflet-marker-icon.custom-marker {
    background: none;
    border: none;
}

/* Popup personalizzato */
.leaflet-popup-content-wrapper {
    border-radius: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    padding: 0;
}

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

.leaflet-popup-tip-container {
    display: none;
}

/* Info window custom */
.leaflet-info-window {
    padding: 12px;
}

.leaflet-info-window-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.leaflet-info-window-address {
    font-size: 14px;
    color: #666;
}

/* Polyline e direzioni */
.leaflet-interactive {
    cursor: pointer;
}

/* Loading spinner */
.leaflet-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.leaflet-loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1a73e8;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .leaflet-search-container {
        width: calc(100% - 20px);
        left: 10px;
        transform: none;
    }

    .leaflet-map-type-control {
        top: 70px;
    }

    .leaflet-control-zoom {
        display: none;
    }
}

/* Attributions - NASCOSTI COMPLETAMENTE */
.leaflet-control-attribution {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.leaflet-bottom.leaflet-right {
    display: none !important;
}

/* Draggable marker cursor */
.leaflet-marker-draggable {
    cursor: move;
}

/* Cluster markers (se necessario in futuro) */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: rgba(26, 115, 232, 0.6);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background-color: rgba(26, 115, 232, 0.8);
    color: white;
    font-weight: bold;
}
