/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

body {
    font-family: 'Poppins', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #444;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    background-color: rgba(255, 255, 255, 0.98);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    max-width: 650px;
    width: 100%;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-sizing: border-box; /* Aggiunto per consistenza */
}

h1 {
    text-align: center;
    color: #333;
    font-weight: 600;
    margin-top: 0;
}

p {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.1em;
    color: #555;
    line-height: 1.6;
}

hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 30px 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

input[type="text"],
input[type="email"],
input[type="number"],
select {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
    box-sizing: border-box; 
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.4);
}

button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Stili per la pagina di risultato */
.result-container p {
    font-size: 1.2em;
    line-height: 1.6;
}
.result-container a {
    display: inline-block;
    margin-top: 15px; /* Aumentato spazio */
    padding: 10px 20px;
    background-color: #f0f0f0;
    color: #555;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}
.result-container a:hover {
    background-color: #e0e0e0;
}

/* Box per mostrare il codice in prenota.php */
.codice-box {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 20px;
    margin-top: 20px;
}
.codice-box p {
    font-size: 1em;
    margin-bottom: 10px;
}

/* Stili per i link in index.php e cancella.php */
.link-cancella, .link-torna {
    text-align: center;
    margin-top: 25px;
}
.link-cancella a, .link-torna a {
    color: #555;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    background-color: #f1f1f1;
    transition: background-color 0.3s;
}
.link-cancella a:hover, .link-torna a:hover {
    background-color: #e0e0e0;
}

/* Stili per visualizza.php e index.php (Riepilogo) */
.admin-container {
    max-width: 900px;
    align-items: flex-start;
}
.summary {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}
.summary h2 {
    margin-top: 0;
    font-size: 1.3em;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}
.summary ul {
    padding-left: 20px;
    margin: 0;
}
.summary li {
    margin-bottom: 8px;
    font-size: 1em;
}
.summary-box {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #764ba2;
}
.summary-box p {
    margin: 5px 0;
}

/* Stili Tabella */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
th, td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}
th {
    background-color: #f4f4f4;
}
tr:hover {
    background-color: #f1f1f1;
}

/* ==================================
RESPONSIVE DESIGN
==================================
*/

/* Tablet e Admin Panel più largo */
@media (max-width: 960px) {
    .admin-container {
        max-width: 100%;
        padding: 30px;
    }
}

/* Smartphone */
@media (max-width: 600px) {
    body {
        padding: 10px;
        /* Rimuovi flex center per top-align su mobile */
        display: block;
    }

    .container,
    .admin-container {
        padding: 20px;
    }

    h1 {
        font-size: 1.6em;
    }

    p {
        font-size: 1em;
    }

    .summary {
        padding: 15px;
    }
    .summary ul {
        padding-left: 15px;
    }
    .summary li {
        font-size: 0.95em;
    }

    /* Gestione tabella responsive per visualizza.php */
    table {
        border: 0;
    }
    
    table thead {
        /* Nascondi gli header */
        border: none;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
    }
    
    table tr {
        /* Trasforma le righe in "card" */
        display: block;
        border: 1px solid #ddd;
        border-radius: 8px;
        margin-bottom: 10px;
    }
    
    table td {
        display: block;
        padding-left: 50%; /* Spazio per il data-label */
        position: relative;
        text-align: left;
        border-bottom: 1px solid #f0f0f0;
    }
    
    table td:last-child {
        border-bottom: 0;
    }
    
    table td:before {
        /* Inserisci il data-label */
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
        color: #333;
    }
}

/* Stili aggiunti per il checkbox della privacy in index.php */
.privacy-container {
    display: flex;
    align-items: flex-start; /* Allinea all'inizio se il testo va a capo */
    margin-bottom: 20px;
    margin-top: 10px;
}
.privacy-container input[type="checkbox"] {
    width: auto;
    margin: 4px 10px 0 0; /* Aggiunge spazio a destra e allinea con la prima riga */
    flex-shrink: 0; /* Impedisce al checkbox di rimpicciolirsi */
}
.privacy-container label {
    margin: 0;
    font-weight: normal;
    font-size: 0.9em;
    color: #555;
    line-height: 1.5;
}
.privacy-container a {
    color: #667eea; /* Colore primario */
    text-decoration: underline;
    font-weight: 600;
}

/* --- STILI AGGIUNTI PER LA RICHIESTA DEL CLIENTE --- */

/* Stili per il pulsante di switch tra i form (già fornito) */
.link-switch-container {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.button-switch {
    display: inline-block;
    padding: 10px 20px;
    background-color: #f7b733; /* Colore distintivo (Arancione) */
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-right: 10px; /* Spazio tra i pulsanti di switch */
}

.button-switch:hover {
    background-color: #f5a000;
}

/* Stili per rendere tutti gli altri link all'interno del container come pulsanti */
/* Applicabile a <a> che non sono .button-switch e che sono al di fuori della .privacy-container */
.container a:not(.button-switch):not(.privacy-container a) {
    display: inline-block;
    padding: 8px 15px;
    background-color: #667eea; /* Colore di sfondo standard (Blu/Viola) */
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 400;
    margin-top: 15px;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}

.container a:not(.button-switch):not(.privacy-container a):hover {
    background-color: #556cdc;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* ECCEZIONE: Link all'interno del contenitore della privacy devono rimanere link standard */
.privacy-container a {
    color: #667eea; /* Ritorna al colore standard */
    text-decoration: underline;
    display: inline; /* Ritorna al display standard */
    padding: 0;
    background: none;
    margin: 0;
    box-shadow: none;
}

.privacy-container a:hover {
    color: #764ba2;
    background: none;
}