/* mappa.css - Layout coerente con le altre pagine */
.mappa-container {
    padding: 2rem 3rem;
    max-width: none;
    margin: 0;
    min-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
}

.mappa-header {
    text-align: center;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.mappa-header h1 {
    font-size: 2.2rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.mappa-header p {
    font-size: 1.1rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
}

.mappa-controls {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: end;
}

.input-group, .regione-selector {
    flex: 1;
    min-width: 300px;
}

.input-group label, .regione-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}

.input-with-button {
    display: flex;
    gap: 0.5rem;
}

.input-with-button input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
}

.regione-selector select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    background-color: white;
}

.btn-primary {
    background-color: #4361ee;
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.btn-primary:hover {
    background-color: #3a56d4;
}

.mappa-content {
    display: flex;
    gap: 1.5rem;
    flex: 1;
    min-height: 500px;
    margin-bottom: 1.5rem;
}

#mappa {
    flex: 2;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    min-height: 500px;
    z-index: 1;
}

.mappa-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 300px;
}

.info-box {
    background: white;
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.info-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.info-box-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
}

.info-box-icon {
    font-size: 1.25rem;
}

.info-box-content {
    color: #64748b;
}

.costo-dettaglio {
    margin-top: 1rem;
}

.costo-voce {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}

.costo-totale {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #e2e8f0;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    color: #1e293b;
}

#scuole-vicine-list {
    max-height: 350px;
    overflow-y: auto;
}

.scuola-vicina {
    padding: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 6px;
}

.scuola-vicina:last-child {
    border-bottom: none;
}

.scuola-vicina:hover {
    background-color: #f8fafc;
}

.scuola-vicina h4 {
    margin: 0 0 0.4rem 0;
    font-size: 1rem;
    color: #1e293b;
    font-weight: 600;
}

.scuola-vicina p {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
}

.distanza {
    display: inline-block;
    background: #4361ee;
    color: white;
    padding: 0.3rem 0.7rem;
    border-radius: 14px;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

.placeholder-text {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    margin: 1rem 0;
}

.mappa-legenda {
    background: #f8fafc;
    padding: 1.2rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.mappa-legenda h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
}

.legenda-item {
    display: flex;
    align-items: center;
    margin: 0;
    font-size: 0.95rem;
}

.legenda-color {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-right: 0.8rem;
    display: inline-block;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Marker personalizzati */
.custom-marker {
    background: transparent !important;
    border: none !important;
}

/* Controlli mappa più grandi */
.leaflet-control-zoom a {
    width: 35px !important;
    height: 35px !important;
    line-height: 35px !important;
    font-size: 1.2rem !important;
}

/* Stile per i popup della mappa */
.leaflet-popup-content {
    margin: 15px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .mappa-container {
        padding: 1.5rem 2rem;
    }
    
    .mappa-header h1 {
        font-size: 2rem;
    }
    
    .mappa-content {
        flex-direction: column;
    }
    
    .mappa-sidebar {
        min-width: auto;
    }
    
    #mappa {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .mappa-container {
        padding: 1rem;
    }
    
    .mappa-header {
        margin-bottom: 1.5rem;
    }
    
    .mappa-header h1 {
        font-size: 1.8rem;
    }
    
    .mappa-header p {
        font-size: 1rem;
    }
    
    .mappa-controls {
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem;
    }
    
    .input-group, .regione-selector {
        min-width: auto;
    }
    
    .input-with-button {
        flex-direction: column;
    }
    
    .mappa-legenda {
        padding: 1rem;
        flex-direction: column;
        gap: 0.8rem;
        align-items: flex-start;
    }
    
    .mappa-legenda h3 {
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .mappa-container {
        padding: 0.8rem;
    }
    
    .mappa-header h1 {
        font-size: 1.6rem;
    }
    
    #mappa {
        min-height: 350px;
        border-radius: 8px;
    }
    
    .leaflet-control-zoom a {
        width: 30px !important;
        height: 30px !important;
        line-height: 30px !important;
    }
    
    .info-box {
        padding: 1rem;
    }
}