/* 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;
    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;
}

/* Tabella modificabile */
.editable-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background-color: #ffffff;
    font-size: 0.9rem;
}

/* Intestazioni e celle della tabella */
.editable-table th,
.editable-table td {
    border: 1px solid #d1d5db;
    padding: 0.75rem;
    text-align: left;
}

/* Intestazioni della tabella */
.editable-table th {
    background-color: #000000;
    color: #ffffff;
    font-weight: 600;
}

/* Input nella tabella */
.editable-table td input {
    width: 100%;
    border: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #000000;
    padding: 0.25rem;
}

/* Stile focus per gli input della tabella */
.editable-table td input:focus {
    outline: none;
    background-color: #f1f5f9;
    border-radius: 4px;
}

/* Contenitore per la tabella con scroll orizzontale */
.table-container {
    overflow-x: auto;
    width: 100%;
    margin-bottom: 1.5rem;
    -webkit-overflow-scrolling: touch;
}

/* Stile per la barra di scorrimento */
.table-container::-webkit-scrollbar {
    height: 6px;
}

/* Thumb della barra di scorrimento */
.table-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

/* Pulsante di download */
.download-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 */
.download-button:hover,
.download-button:focus {
    background-color: #1b7227;
    transform: translateY(-1px);
}

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

/* 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;
    }

    .editable-table {
        font-size: 0.75rem;
    }

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

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

    footer {
        padding: 1rem 0.5rem;
    }

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