/* Général */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap'); /* Import police Poppins */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #e0e0e0;
    margin: 0;
    padding: 20px;
    color: #333;
    line-height: 1.6;
    background-image: linear-gradient(to bottom, #f5f5f5, #dcdcdc); /* Dégradé gris clair */
    animation: fadeIn 1s ease-in-out;
}



@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

h2, h3 {
    text-align: center;
    color: #222;
    margin-bottom: 20px;
    animation: slideIn 0.5s ease-in-out;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    font-size: 1.5rem; /* Taille de police plus petite */
    margin-top:10px;
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Conteneur principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    /*padding: 20px; */
    background-color: rgba(245, 245, 245, 0.95);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    transition: all 0.3s ease-in-out;
    animation: fadeIn 1s ease-in-out;
}

.container:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Formulaire */
.form-group {
    margin-bottom: 15px;
}

label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

select, input[type="number"] {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
    border: 1px solid #aaa;
    border-radius: 6px;
    box-sizing: border-box;
    transition: 0.3s;
    background-color: white;
}

select:focus, input[type="number"]:focus {
    border-color: #388e3c;
    outline: none;
    box-shadow: 0 0 5px rgba(56, 142, 60, 0.4);
}

button {
    margin-top:10px;
    background-color: #4CAF50;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: 0.3s;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

button:hover:not(:disabled) {
    background-color: #45a049;
    transform: scale(1.1);
}

/* Effet de liseret animé en rotation au survol */
@keyframes border-rotate {
    0% { clip-path: inset(0 0 90% 0); }
    25% { clip-path: inset(0 90% 0 0); }
    50% { clip-path: inset(90% 0 0 0); }
    75% { clip-path: inset(0 0 0 90%); }
    100% { clip-path: inset(0 0 90% 0); }
}

button:hover::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid orange;
    border-radius: 6px;
    animation: border-rotate 1.5s linear infinite;
}

/* Styles spécifiques pour les boutons orange */
td button {
    padding: 6px 12px;
    background-color: #f0ad4e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

td button:hover {
    background-color: #ec971f;
    transform: scale(1.1);
}

td button:hover::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid #4CAF50;
    border-radius: 4px;
    animation: border-rotate 1.5s linear infinite;
}

/* Tableaux */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fafafa;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    transition: 0.3s;
}

table:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

th, td {
    padding: 12px 15px;
    text-align: center;
    border: 1px solid #ddd;
    transition: 0.3s;
}

th {
    background-color: #4CAF50;
    color: white;
}

/* Total général */
#total-general {
    font-size: 20px;
    font-weight: bold;
    color: #222;
    text-align: center;
    margin-top: 20px;
    animation: slideIn 0.5s ease-in-out;
}


/*affichage mobile du Tableaux
/* Tableau classique pour les écrans plus larges */
#table-travaux {
    display: table;
    width: 100%;
}

/* Vue mobile */
@media (max-width: 768px) {
    /* Cacher le tableau classique */
    #table-travaux {
        display: none;
    }

    /* Afficher la vue mobile */
    #travaux-mobile {
        display: block;
    }

    /* Mise en forme des cartes pour chaque ligne */
    .travail-mobile-item {
        display: block;
        margin-bottom: 15px;
        padding: 15px;
        border: 1px solid #ddd;
        border-radius: 5px;
        background-color: #f9f9f9;
    }

    /* Style pour les titres des éléments (les en-têtes du tableau) */
    .travail-mobile-item div {
        margin-bottom: 10px;
    }

    .travail-mobile-item div span {
        font-weight: bold;
        margin-right: 10px;
    }

    /* Définir les éléments de carte pour qu'ils apparaissent sous forme de liste */
    .travail-mobile-item div {
        display: flex;
        flex-direction: column;
    }
}



#table-travaux {
    width: 100%;
    border-collapse: collapse;
}

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

@media (max-width: 101px) {
    /* Sur mobile, transformer les lignes du tableau en affichage vertical */
    #table-travaux {
        display: block;
        width: 100%;
    }

    #table-travaux thead {
        display: none;  /* Masquer les en-têtes */
    }

    #table-travaux tbody tr {
        display: block;
        margin-bottom: 15px;
        padding: 10px;
        background-color: #f9f9f9;
        border-radius: 5px;
    }

    #table-travaux tbody tr td {
        display: block;
        text-align: left;
        width: 100%;
        padding: 6px 10px;
    }

    #table-travaux tbody tr td::before {
        /* Ajouter le nom de la colonne avant chaque cellule (affichage vertical) */
        content: attr(data-title);
        font-weight: bold;
        display: inline-block;
        margin-bottom: 5px;
    }

    /* Amélioration visuelle, on rend chaque ligne plus "carte" */
    #table-travaux tbody tr {
        border: 1px solid #ddd;
        border-radius: 10px;
    }
}

.selectable-card {
    cursor: pointer;
    transition: 0.3s;
}
.selectable-card:hover {
    background-color: #f8f9fa;
}
.selected {
    background-color: #007bff !important;
    color: white;
    border-color: #0056b3;
}
.sidebar {
    position: fixed;
    top: 50px;
    right: 20px;
    width: 250px;
    padding: 15px;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease-in-out;
}

.sidebar p {
    margin: 5px 0;
}


.cacher {
    visibility: hidden;
}