/* Reset base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    margin: 0;
    padding: 0;
}

/* --- Contenitori principali --- */
.container {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    text-align: center;
}

/* Contenitore login */
.container-login {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
    margin: 70px auto;
    text-align: center;
}

/* Contenitore per il messaggio di benvenuto */
.welcome-container {
    text-align: left;
    margin-bottom: 20px;
    width: 90%;
    max-width: 1250px;
}

/* Contenitore per le tabelle */
.container-large {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 1250px;
    margin: 20px auto;
    text-align: left;
}

/* --- Pulsante installa app --- */
#installButton {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background-color: #547196;
    color: white;
    border-radius: 5px;
    font-size: 14px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

#installButton:hover {
    background-color: #0056b3;
}

/* Altri pulsanti specifici */
.btn-edit {
    background-color: #3fb43f; /* Verde */
}

.btn-delete {
    background-color: #ff6b6b; /* Rosso */
}

.btn-edit:hover {
    background-color: #2a8c2a;
}

.btn-delete:hover {
    background-color: #ff4b4b;
}

/* Organizzazione dei pulsanti */
.button-group {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

/* --- Testi --- */
h1 {
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
}

h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
}

p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.error-msg {
    color: red;
    font-weight: bold;
    margin-top: 10px;
}

.success-msg {
    color: green;
    font-weight: bold;
    margin-top: 10px;
}

label {
    font-size: 14px;
    text-align: left;
    display: block;
    margin-bottom: -10px;
}

/* --- Campi input e selezioni --- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

/* --- Pulsanti --- */
button, .btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    text-align: center;
    border: none;
    text-decoration: none;
    background-color: #779cc4;
    color: #fff;
    transition: background-color 0.3s ease;
}

button:hover, .btn:hover {
    background-color: #5a7ba0;
}

/* --- Checkbox --- */
.checkbox-container {
    text-align: left;
    margin: 10px 0;
}

.checkbox-container input[type="checkbox"] {
    margin-right: 5px;
}

/* --- Link --- */
a {
    text-decoration: none;
    color: #779cc4;
    transition: color 0.3s ease;
}

a:hover {
    text-decoration: underline;
    color: #0056b3;
}

/* --- Header --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #779cc4;
    color: white;
    padding: 10px 20px;
}

.navbar .logo img {
    height: 50px;
}

.navbar .menu {
    display: flex;
    gap: 15px;
}

.navbar .menu a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    padding: 5px 10px;
    border-radius: 5px;
}

.navbar .menu a.active {
    background-color: white;
    color: #779cc4;
}

.navbar .menu a:hover {
    background-color: #5a7ba0;
    color: white;
}

.navbar .logout a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid white;
}

.navbar .logout a:hover {
    background-color: white;
    color: #779cc4;
}


/* --- Tabelle --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

table th, table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

table th {
    background-color: #779cc4;
    color: white;
    text-align: center;
}

table tr:nth-child(even) {
    background-color: #f4f4f4;
}


/* --- Responsive --- */
@media (max-width: 768px) {
    .navbar .menu {
        display: none;
        flex-direction: column;
        gap: 10px;
        background-color: #779cc4;
        padding: 10px;
        position: absolute;
        top: 60px;
        right: 0;
        width: 100%;
    }

    .navbar .menu.active {
        display: flex;
    }

    .navbar .menu a {
        padding: 10px;
        text-align: center;
    }

    .navbar .menu-toggle {
        display: block;
        cursor: pointer;
        background-color: #779cc4;
        color: white;
        border: none;
        font-size: 30px;
    }

    .navbar .logo img {
        height: 40px;
    }
}

/* Popup in invia segnalazione */
.popup {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    position: relative;
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    width: 90%; /* Larghezza massima relativa allo schermo */
    max-width: 400px; /* Dimensione massima per schermi grandi */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: translate(0, -50%);
    top: 0;
    left: 0;
}

.popup-content button {
    margin-top: 10px;
    padding: 10px 20px;
    border: none;
    background: #779cc4;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

.popup-content button:hover {
    background: #5a7ba0;
}



/* Elimina punto elenco nella lista allegati */

.document-list {
    list-style: none; /* Rimuove i punti dell'elenco */
    padding: 0; /* Rimuove l'indentazione */
}

.document-list li {
    margin: 5px 0; /* Spaziatura tra gli elementi */
}

.document-list a {
    color: #779cc4;
    text-decoration: none;
    font-weight: bold;
}

.document-list a:hover {
    text-decoration: underline;
}

/* Lista allegati */
.document-list {
    list-style: none;
    padding: 0;
}

.document-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

/* Aggiunta per il menu mobile */
.menu-toggle {
    display: none; /* Nasconde il toggle su desktop */
    background: none;
    border: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
}

.mobile-menu {
    display: none; /* Nasconde il menu mobile di default */
    flex-direction: column;
    background-color: #779cc4;
    padding: 10px;
    position: absolute;
    top: 60px;
    right: 0;
    width: 100%;
    z-index: 100;
}

.mobile-menu a {
    color: white;
    text-decoration: none;
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #5a7ba0;
}

.mobile-menu a:hover {
    background-color: #5a7ba0;
}

.mobile-menu.active {
    display: flex; /* Mostra il menu quando è attivo */
}


/* Menu da mobile - Stile per la voce attiva */
.mobile-menu a.active {
    background-color: white; /* Sfondo bianco */
    color: #779cc4; /* Testo blu */
    font-weight: bold;
    border-radius: 5px; /* Arrotonda i bordi */
}

/* Per un effetto hover coerente */
.mobile-menu a.active:hover {
    background-color: #5a7ba0;
    color: white;
}



/* Modifica per il comportamento responsive */
@media (max-width: 768px) {
    .navbar .menu {
        display: none; /* Nasconde il menu su mobile */
    }

    .menu-toggle {
        display: block; /* Mostra il toggle su mobile */
    }
}

/* TinyMCS Style */
.tinymce-content {
    padding: 20px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.tinymce-content ul {
    padding-left: 40px;
}

.tinymce-content ol {
    padding-left: 40px;
}


/* TABELLE MOBILE */
@media (max-width: 468px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        display: none;
    }

    tr {
        margin-bottom: 10px;
        border-bottom: 1px solid #ddd;
    }

    td {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        padding: 8px 0;
    }

    td::before {
        content: attr(data-label); /* Usa l'attributo data-label per mostrare l'intestazione */
        font-weight: bold;
        width: 50%;
        display: inline-block;
        color: #333;
    }
}



/* Pulisce e Allinea il foglio di stampa*/
@media print {
    /* Nascondere gli elementi non necessari */
    header, .navbar, .menu, .menu-toggle, .logout, form, .print-section button, h2, h1 {
        display: none; /* Nasconde header, menu, pulsanti, titoli */
    }

    /* Rimuovere ombreggiature e margini inutili */
    .container, .container-large, .welcome-container, .print-section {
        box-shadow: none; /* Elimina ombreggiatura */
        padding: 0; /* Rimuove padding interno */
        margin: 0; /* Rimuove margini */
        background: none; /* Rimuove eventuale sfondo */
    }

    /* Forzare lo stile della tabella per la stampa */
    table {
        margin: 0 auto; /* Centrare la tabella */
        width: 100%; /* Occupa tutto lo spazio disponibile */
        border-collapse: collapse; /* Elimina spazi tra i bordi */
        page-break-inside: avoid; /* Evita interruzioni della tabella tra pagine */
    }

    table th, table td {
        border: 1px solid black; /* Bordi visibili */
        padding: 5px;
        text-align: left; /* Allineamento testo standard */
    }

    table th {
        background-color: #ddd; /* Colore di sfondo leggero per intestazioni */
        color: black; /* Testo nero */
    }

    /* Impostazioni di stampa */
    body {
        margin: 0;
        padding: 0;
        font-size: 12px; /* Adatta il font per la stampa */
    }

    @page {
        size: A4 landscape; /* Orientamento orizzontale */
        margin: 0.5cm; /* Margini per la stampa */
    }
}

.result-header {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    text-align: left;
}

@media print {
    .result-header {
        display: block;
        font-size: 16px;
        margin-bottom: 10px;
        color: black; /* Colore per la stampa */
    }
}

