﻿/* Stili personalizzati per le mappe degli impianti */

/* Container principale mappa */
.plant-map-container {
    position: relative;
}

    .plant-map-container .leaflet-container {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        border-radius: 0.375rem; /* Bootstrap border-radius */
    }

/* Popup personalizzati impianti */
.plant-popup .leaflet-popup-content-wrapper {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e3e6f0;
}

.plant-popup .leaflet-popup-content {
    margin: 12px 16px;
    line-height: 1.4;
    font-size: 13px;
}

.plant-popup .leaflet-popup-tip {
    background: #fff;
    border: 1px solid #e3e6f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Contenuto popup impianto */
.plant-popup-content h6 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    border-bottom: 1px solid #f8f9fa;
    padding-bottom: 4px;
}

.plant-popup-content .plant-info {
    font-size: 12px;
}

    .plant-popup-content .plant-info small {
        line-height: 1.3;
    }

.plant-popup-content .text-muted {
    color: #6c757d !important;
}

.plant-popup-content .border-top {
    border-top: 1px solid #f8f9fa !important;
}

/* Marker personalizzati */
.plant-marker {
    background: transparent;
    border: none;
}

    /* Stati hover per marker */
    .plant-marker:hover {
        transform: scale(1.1);
        transition: transform 0.2s ease;
    }

/* Controlli mappa */
.leaflet-control-zoom {
    border: 1px solid #e3e6f0 !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

    .leaflet-control-zoom a {
        background-color: #fff !important;
        border-color: #e3e6f0 !important;
        color: #495057 !important;
        font-weight: 600;
    }

        .leaflet-control-zoom a:hover {
            background-color: #f8f9fa !important;
            color: #212529 !important;
        }

/* Attribution control */
.leaflet-control-attribution {
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-radius: 4px !important;
    font-size: 10px !important;
    padding: 2px 6px !important;
}

/* Loading states */
.plant-map-container .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .plant-popup .leaflet-popup-content {
        margin: 8px 12px;
        font-size: 12px;
    }

    .plant-popup-content h6 {
        font-size: 13px;
    }

    .plant-popup-content .plant-info {
        font-size: 11px;
    }

    /* Popup più stretti su mobile */
    .plant-popup .leaflet-popup-content-wrapper {
        max-width: 250px;
    }
}

/* Stili per diversi tipi di impianto nei popup */
.plant-popup-content[data-plant-type="Consumo"] h6 {
    border-bottom-color: #4dabf7;
}

.plant-popup-content[data-plant-type="Produzione"] h6 {
    border-bottom-color: #51cf66;
}

.plant-popup-content[data-plant-type="Ibrido"] h6 {
    border-bottom-color: #ff922b;
}

.plant-popup-content[data-plant-type="Sconosciuto"] h6 {
    border-bottom-color: #adb5bd;
}

/* Animazione marker quando vengono aggiunti */
@keyframes markerAppear {
    0% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.plant-marker {
    animation: markerAppear 0.3s ease-out;
}

/* Stili per mappa in modalità dark (se implementata) */
@media (prefers-color-scheme: dark) {
    .plant-popup .leaflet-popup-content-wrapper {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .plant-popup .leaflet-popup-tip {
        background: #2d3748;
        border-color: #4a5568;
    }

    .plant-popup-content h6 {
        color: #e2e8f0;
        border-bottom-color: #4a5568;
    }

    .plant-popup-content .text-muted {
        color: #a0aec0 !important;
    }

    .plant-popup-content .border-top {
        border-top-color: #4a5568 !important;
    }
}
