/* Reset di base */
* { margin: 0; padding: 0; box-sizing: border-box; }

#map {
    height: 100%;
    width: 100%;
    min-height: 20rem;
    background-color: #f0f0f0;
    z-index: 10;
}

.maplibregl-map { font: inherit; }
.maplibregl-ctrl-attrib { font-size: 11px; }

#map-message {
    position: absolute;
    z-index: 1000;
    top: 1rem;
    left: 50%;
    max-width: min(90%, 32rem);
    transform: translateX(-50%);
    padding: 0.75rem 1rem;
    border: 1px solid #fecaca;
    border-radius: 0.75rem;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgb(0 0 0 / 12%);
}

#map-message[hidden] { display: none; }

#status-message {
    margin-top: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.875rem;
}

#status-message[hidden] { display: none; }

/* Gestione Responsive */
@media (max-width: 1024px) {
    /* Su Tablet e Mobile, la sidebar si sposta sopra o diventa un overlay */
    .flex.h-screen {
        flex-direction: column;
        overflow-y: auto;
    }

    aside {
        width: 100% !important;
        height: auto !important;
        position: relative;
        border-right: none;
        border-bottom: 1px solid #cbd5e1;
    }

    main {
        height: 400px; /* Altezza fissa per la mappa su mobile */
        flex: none;
    }
    
    .fixed.top-0 {
        position: sticky;
    }
}

/* Ottimizzazione scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
