/* Stili base e reset leggero */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    background-color: #f4f7f6; /* Sfondo leggermente grigio */
    color: #333;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 900px; /* Aumentato per risultati multipli */
    margin: 20px auto;
    background: #ffffff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

h1 {
    color: #2c3e50; /* Blu scuro */
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
}

hr {
    border: none;
    height: 1px;
    background-color: #e0e0e0;
    margin: 25px 0;
}

/* Stili Form (index.html) */
.search-form {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Spazio tra elementi del form */
}

.search-form p {
    text-align: center;
    color: #555;
    margin-bottom: 10px;
}

.form-row {
    display: flex;
    flex-wrap: wrap; /* Va a capo su schermi piccoli */
    gap: 20px; /* Spazio tra gruppi nella stessa riga */
}

.form-group {
    flex: 1; /* Occupa spazio disponibile */
    min-width: 200px; /* Larghezza minima prima di andare a capo */
    display: flex;
    flex-direction: column;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #34495e; /* Blu-grigio */
    font-size: 0.95em;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #fff;
}

input:focus {
    border-color: #3498db; /* Blu */
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

input::placeholder {
    color: #aaa;
    font-style: italic;
}

/* Stili specifici per prezzo e checkbox */
.price-group label {
    margin-bottom: 6px; /* Spazio sopra gli input */
}
.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}
.price-inputs input {
    flex: 1;
    text-align: center;
}
.price-inputs span {
    color: #777;
}

.checkbox-group {
    align-items: center; /* Centra verticalmente */
    padding-top: 20px; /* Allinea con altri campi */
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0; /* Rimuovi spazio sotto */
}

.checkbox-group input[type="checkbox"] {
    width: auto; /* Non full width */
    margin-right: 8px;
    accent-color: #3498db; /* Colora il check */
}

/* Bottone Submit */
.submit-button {
    background: linear-gradient(135deg, #3498db, #2980b9); /* Gradiente blu */
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 500;
    transition: background 0.3s ease, transform 0.1s ease;
    align-self: center; /* Centra il bottone */
    margin-top: 15px;
}

.submit-button:hover {
    background: linear-gradient(135deg, #2980b9, #2471a3);
}

.submit-button:active {
    transform: scale(0.98);
}

/* Messaggi Flash (index.html) */
.flash-messages {
    margin-bottom: 20px;
    padding: 0;
    list-style: none;
}

.alert {
    padding: 12px 18px;
    margin-bottom: 10px;
    border-radius: 6px;
    font-size: 0.95em;
    border: 1px solid transparent;
}

.alert-error {
    color: #721c24; /* Rosso scuro */
    background-color: #f8d7da; /* Rosso chiaro */
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404; /* Giallo/marrone scuro */
    background-color: #fff3cd; /* Giallo chiaro */
    border-color: #ffeeba;
}

.alert-success { /* Se mai ne aggiungerai */
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

/* Risultati (risultato.html) */
.result-container h1 {
    margin-bottom: 20px;
}

#map {
    height: 350px; /* Altezza fissa per la mappa */
    width: 100%;
    margin-bottom: 30px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.results-list {
    display: grid;
    /* Crea colonne responsive: min 250px, max 1fr */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px; /* Spazio tra le card */
}

.ristorante-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden; /* Per contenere immagine */
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-in-out;
}
.ristorante-card:hover {
     transform: translateY(-3px);
     box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}


.ristorante-photo {
    width: 100%;
    height: 180px; /* Altezza fissa per l'immagine */
    object-fit: cover; /* Copre l'area senza distorcere */
    display: block; /* Rimuove spazio sotto l'immagine */
    background-color: #eee; /* Sfondo per immagini in caricamento */
}

.no-photo {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e9ecef; /* Grigio chiaro */
    color: #6c757d; /* Grigio scuro */
    font-style: italic;
    font-size: 0.9em;
}

.ristorante-details {
    padding: 15px 20px;
    flex-grow: 1; /* Occupa spazio rimanente nella card */
}

.ristorante-details h2 {
    margin-bottom: 8px;
    font-size: 1.3em;
    color: #34495e;
}

.ristorante-details p {
    margin-bottom: 6px;
    font-size: 0.95em;
    color: #555;
}
.ristorante-details p strong {
    color: #333;
    font-weight: 500;
}

.map-link {
    display: inline-block;
    margin-top: 10px;
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9em;
}

.map-link:hover {
    text-decoration: underline;
}

/* Link navigazione sotto i risultati */
.navigation-links {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.navigation-links a {
    background-color: #6c757d; /* Grigio */
    color: white;
    padding: 10px 25px;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.navigation-links a:hover {
    background-color: #5a6268;
}


/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    .form-row {
        flex-direction: column; /* Mette i gruppi uno sotto l'altro */
        gap: 15px;
    }
    .results-list {
         /* Mantiene la griglia ma con meno spazio */
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }
    h1 {
        font-size: 1.8em;
    }
    #map {
        height: 300px; /* Riduci altezza mappa */
    }
}

@media (max-width: 480px) {
    .ristorante-photo, .no-photo {
        height: 150px; /* Immagini più piccole */
    }
     .ristorante-details h2 {
        font-size: 1.15em;
     }
}
/* ... (tutto il CSS precedente) ... */

/* Stile per il pulsante Geolocalizzazione e feedback */
.location-button-group {
    display: flex;
    flex-direction: column; /* Metti il feedback sotto il pulsante */
    justify-content: flex-end; /* Allinea il pulsante in basso se c'è spazio */
    padding-bottom: 5px; /* Aggiusta allineamento con altri input */
}

#use-location-btn {
    padding: 10px 15px;
    background-color: #6c757d; /* Grigio */
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
    white-space: nowrap; /* Evita che il testo vada a capo */
}

#use-location-btn:hover {
    background-color: #5a6268;
}

.location-feedback {
    font-size: 0.8em;
    margin-top: 4px;
    height: 1em; /* Riserva spazio per evitare salti di layout */
}


/* Stile per l'icona utente sulla mappa (opzionale) */
/* Usa filter per cambiare colore all'icona di default */
.user-marker-icon {
    filter: hue-rotate(190deg) saturate(1.5) brightness(0.9); /* Blu/Azzurro */
}

/* Responsive aggiuntivo per il gruppo geoloc */
@media (max-width: 768px) {
    .location-button-group {
         padding-bottom: 0;
         align-items: flex-start; /* Allinea a sinistra su mobile */
    }
}
