/* =========================
   Base container
========================= */

.osm-map-container {
    position: relative;
    width: 100%;
    min-height: 300px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* =========================
   Leaflet overrides (light)
========================= */

.osm-map-container .leaflet-container {
    font-family: inherit;
    outline: none;
}

/* NON nascondere attribution (policy + correttezza) */
.osm-map-container .leaflet-control-attribution {
    font-size: 11px;
    opacity: 0.7;
}

/* =========================
   Zoom hint (Ctrl / Cmd)
========================= */

.osm-zoom-hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(17, 24, 39, 0.9);
    color: #fff;
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 999px;
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 500;
    white-space: nowrap;
}

.osm-zoom-hint.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* =========================
   Popup styling
========================= */

.leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 18px 20px 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #111827;
    padding-bottom: 20px;
    white-space: pre-line;
}

.leaflet-popup-content strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.leaflet-popup-content a {
    color: #2563eb;
    text-decoration: underline;
}

.leaflet-popup-content a:hover {
    text-decoration: none;
}

/* =========================
   Tooltip (title marker)
========================= */

.leaflet-tooltip {
    background: #111827;
    color: #fff;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    border: none;
}

/* =========================
   Marker icon improvements
========================= */

.leaflet-marker-icon {
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.25));
}

.osm-bounce-marker {
    background: transparent;
    border: 0;
}

.osm-bounce-marker-image {
    display: block;
    width: 100%;
    height: 100%;
    animation: osm-marker-bounce 1.1s ease-in-out infinite;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.25));
    transform-origin: 50% 100%;
}

@keyframes osm-marker-bounce {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    45% {
        transform: translateY(-18%) scale(1.03);
    }
}

@media (prefers-reduced-motion: reduce) {
    .osm-bounce-marker-image {
        animation: none;
    }
}

/* =========================
   Loading / fallback state
========================= */

.osm-map-container.is-loading::after {
    content: "Loading map...";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #6b7280;
}

/* =========================
   Error state
========================= */

.osm-error {
    padding: 12px 16px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 14px;
}

/* =========================
   Responsive tweaks
========================= */

@media (max-width: 768px) {
    .osm-map-container {
        border-radius: 10px;
    }

    .osm-zoom-hint {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* =========================
   Multiple maps spacing
========================= */

.osm-map-container + .osm-map-container {
    margin-top: 20px;
}
