/**
 * CSS per Clustering POI - EcoMuseo
 * Stili per i cluster di markers sulla mappa
 */

/* Stile Default */
.ecomuseo-cluster-default {
    border-radius: 50%;
    text-align: center;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    border: 2px solid white;
}

.ecomuseo-cluster-default .cluster-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.ecomuseo-cluster-default.cluster-small .cluster-icon {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
}

.ecomuseo-cluster-default.cluster-medium .cluster-icon {
    background: linear-gradient(135deg, #FF9800, #F57C00);
}

.ecomuseo-cluster-default.cluster-large .cluster-icon {
    background: linear-gradient(135deg, #F44336, #D32F2F);
}

/* Stile Colorful */
.ecomuseo-cluster-colorful {
    border-radius: 50%;
    text-align: center;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
    box-shadow: 0 3px 6px rgba(0,0,0,0.4);
    border: 3px solid white;
    animation: pulse 2s infinite;
}

.ecomuseo-cluster-colorful .cluster-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ecomuseo-cluster-colorful .cluster-icon:before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3), transparent 50%);
    pointer-events: none;
}

.ecomuseo-cluster-colorful .cluster-icon.cluster-small {
    font-size: 12px;
}

.ecomuseo-cluster-colorful .cluster-icon.cluster-medium {
    font-size: 14px;
}

.ecomuseo-cluster-colorful .cluster-icon.cluster-large {
    font-size: 16px;
    font-weight: 900;
}

/* Stile Minimal */
.ecomuseo-cluster-minimal {
    background: transparent;
    border: none;
}

.ecomuseo-cluster-minimal .cluster-icon-minimal {
    width: 35px;
    height: 35px;
    background: rgba(33, 150, 243, 0.9);
    border: 2px solid white;
    border-radius: 4px;
    color: white;
    font-weight: 600;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.ecomuseo-cluster-minimal:hover .cluster-icon-minimal {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Stile Custom */
.ecomuseo-cluster-custom {
    background: transparent;
    border: none;
}

.ecomuseo-cluster-custom .cluster-icon-custom {
    width: 45px;
    height: 45px;
    background: linear-gradient(145deg, #667eea 0%, #764ba2 100%);
    border: 3px solid #fff;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.ecomuseo-cluster-custom .cluster-icon-custom:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.ecomuseo-cluster-custom:hover .cluster-icon-custom:before {
    left: 100%;
}

/* Animazioni */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

/* Hover effects per tutti gli stili */
.leaflet-marker-icon.ecomuseo-cluster-default:hover,
.leaflet-marker-icon.ecomuseo-cluster-colorful:hover {
    animation: bounce 0.6s ease-in-out;
}

/* Responsive */
@media (max-width: 768px) {
    .ecomuseo-cluster-default,
    .ecomuseo-cluster-colorful {
        transform: scale(0.9);
    }
    
    .ecomuseo-cluster-minimal .cluster-icon-minimal {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }
    
    .ecomuseo-cluster-custom .cluster-icon-custom {
        width: 38px;
        height: 38px;
        font-size: 12px;
    }
}

/* Fix per MarkerClusterGroup */
.marker-cluster-small {
    background-color: rgba(181, 226, 140, 0.8);
}

.marker-cluster-small div {
    background-color: rgba(110, 204, 57, 0.8);
}

.marker-cluster-medium {
    background-color: rgba(241, 211, 87, 0.8);
}

.marker-cluster-medium div {
    background-color: rgba(240, 194, 12, 0.8);
}

.marker-cluster-large {
    background-color: rgba(253, 156, 115, 0.8);
}

.marker-cluster-large div {
    background-color: rgba(241, 128, 23, 0.8);
}

/* Spiderfication (quando il cluster si espande) */
.leaflet-cluster-anim .leaflet-marker-icon, 
.leaflet-cluster-anim .leaflet-marker-shadow {
    transition: transform 0.3s ease-out, opacity 0.3s ease-in;
}

/* Tooltip per cluster */
.cluster-tooltip {
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
}
