/* Stili generali del corpo della pagina */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9fafb;
    color: #000000;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

/* Navbar orizzontale in alto */
.navbar {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    width: 100%;
    height: 90px; /* Aumentato per accogliere il tooltip */
    display: flex;
    justify-content: center; /* Centrato per icone vicine */
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow-x: auto;
    white-space: nowrap;
}

/* Stili per i link della navbar */
.navbar a {
    color: #000000;
    margin: 0 0.75rem; /* Ridotto il margine per avvicinare le icone */
    font-size: 1.5rem;
    text-decoration: none;
    position: relative;
    transition: color 0.2s ease;
}

/* Effetto hover sui link */
.navbar a:hover {
    color: #28a745;
}

/* Icona corrente in verde */
.navbar a.active {
    color: #28a745;
}

/* Contenitore principale centrato */
.container {
    width: 90%; /* Occupa il 90% della larghezza */
    margin: 80px 5% 4rem; /* 5% di margine a sinistra e destra */
    padding: 2rem 1rem;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

/* Stili per il titolo principale */
.container h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

/* Stili per i sottotitoli */
.container h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1.25rem;
}

/* Sezione di upload */
.upload-section {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Nasconde l'input file nativo */
.file-input {
    display: none;
}

/* Area di drag-and-drop per i file */
.file-drop-area {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 450px;
    height: 140px;
    background-color: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    color: #4b5563;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Effetto hover e stato attivo per l'area di drag-and-drop */
.file-drop-area:hover,
.file-drop-area.drag-active {
    background-color: #e2e8f0;
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Testo all'interno dell'area di drag-and-drop */
.file-drop-area span {
    padding: 0.75rem;
    font-weight: 500;
}

/* Testo di errore */
.error-text {
    color: #dc2626;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    margin-top: 0.5rem;
}

/* Nome del file caricato */
.file-name {
    font-size: 0.875rem;
    color: #4b5563;
    text-align: center;
    font-weight: 500;
}

/* Sezione card */
.section-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Classe per nascondere elementi */
.hidden {
    display: none;
}

/* Gruppo di input per il form */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

/* Contenitore per checkbox */
.checkbox-container {
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Stile per il checkbox */
.checkbox-container input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
}

/* Etichetta per il checkbox */
.checkbox-container label {
    font-size: 1rem;
    color: #4b5563;
    font-weight: 500;
}

/* Etichette per il form */
.form-group label {
    display: block;
    color: #4b5563;
    font-weight: 500;
    margin-bottom: 0.25rem;
    text-align: left;
}

/* Input del form */
.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    font-size: 1rem;
    box-sizing: border-box;
}

/* Stile focus per gli input */
.form-group input:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* Contenitore per la tabella */
.table-container {
    overflow-x: auto;
    width: 100%;
}

/* Stili per la tabella dati */
.data-table {
    width: 100%;
    font-size: 0.9rem;
    border-collapse: collapse;
}

/* Celle della tabella */
.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid #e2e8f0;
}

/* Intestazione della tabella */
.data-table thead tr {
    background-color: #f8f9fa;
}

/* Input nella tabella */
.data-table input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    box-sizing: border-box;
}

/* Stile focus per gli input della tabella */
.data-table input:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* Pulsante di calcolo */
.calculate-button {
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    background-color: #28a745;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

/* Effetto hover e focus per il pulsante */
.calculate-button:hover,
.calculate-button:focus {
    background-color: #1b7227;
    transform: translateY(-1px);
}

/* Effetto attivo per il pulsante */
.calculate-button:active {
    transform: translateY(0);
}

/* Testo di riepilogo */
.summary-text {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #4b5563;
}

/* Footer */
footer {
    background-color: #ffffff;
    color: #4b5563;
    text-align: center;
    padding: 1.5rem 1rem;
    border-top: 1px solid #e2e8f0;
    width: 100%;
    box-sizing: border-box;
    position: fixed;
    bottom: 0;
    left: 0;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
}

/* Testo del footer */
footer p {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Stili per dispositivi mobili */
@media (max-width: 414px) {
    .navbar {
        height: 50px;
        justify-content: space-between;
        padding: 0 0.5rem;
    }

    .navbar a {
        margin: 0 0.5rem; /* Ulteriore riduzione per mobile */
        font-size: 1.2rem;
    }

    .navbar a::after {
        display: none;
    }

    .container {
        margin-top: 70px;
        margin-left: 5%;
        margin-right: 5%;
        padding: 1.5rem 1rem;
        margin-bottom: 4rem;
    }

    body {
        font-size: 0.875rem;
    }

    .container h1 {
        font-size: 1.75rem;
        line-height: 1.3;
        padding: 0.75rem 0;
        margin-bottom: 1rem;
    }

    .container h2 {
        font-size: 1.25rem;
    }

    .upload-section {
        gap: 0.75rem;
    }

    .file-drop-area {
        max-width: 100%;
        height: 100px;
        font-size: 0.875rem;
    }

    .file-drop-area span {
        padding: 0.5rem;
    }

    .error-text {
        font-size: 0.75rem;
    }

    .file-name {
        font-size: 0.75rem;
    }

    .section-card {
        padding: 1rem;
    }

    .form-group {
        max-width: 100%;
    }

    .checkbox-container {
        margin: 0.75rem 0;
    }

    .checkbox-container input[type="checkbox"] {
        width: 1rem;
        height: 1rem;
    }

    .checkbox-container label {
        font-size: 0.875rem;
    }

    .form-group input {
        font-size: 0.9rem;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }

    .data-table input {
        font-size: 0.8rem;
    }

    .calculate-button {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }

    .summary-text {
        font-size: 0.8rem;
    }

    footer {
        padding: 1rem 0.5rem;
    }

    footer p {
        font-size: 0.75rem;
    }
}