/**
 * Styles personnalisés pour DataTables
 * Amélioration de l'apparence et de l'ergonomie
 */

/* MASQUAGE DÉFINITIF DES ÉLÉMENTS DE PAGINATION ET RECHERCHE POUR LES EMPLOYÉS */
#employeesTable_wrapper .dataTables_paginate,
#employeesTable_wrapper .dataTables_info,
#employeesTable_wrapper .dataTables_length,
#employeesTable_wrapper .dataTables_filter,
.dataTables_paginate,
.dataTables_info,
.dataTables_length,
.dataTables_filter {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Masquer également les éléments génériques de DataTables pour les employés */
.dataTables_wrapper:has(#employeesTable) .dataTables_paginate,
.dataTables_wrapper:has(#employeesTable) .dataTables_info,
.dataTables_wrapper:has(#employeesTable) .dataTables_length,
.dataTables_wrapper:has(#employeesTable) .dataTables_filter {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Masquer tous les éléments qui contiennent du texte de pagination ou de recherche */
div:contains("Affichage"),
div:contains("entrées"),
div:contains("Rechercher"),
div:contains("Showing"),
div:contains("entries"),
div:contains("Search") {
    display: none !important;
}

/* Personnalisation des contrôles DataTables */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_length select {
    min-width: 80px;
}

.dataTables_wrapper .dataTables_filter input {
    min-width: 200px;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
}

/* Personnalisation de la pagination */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin: 0 2px;
    padding: 0.375rem 0.75rem;
    background: #fff;
    color: #6c757d !important;
    transition: all 0.2s ease-in-out;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d !important;
    cursor: not-allowed;
}

/* Personnalisation des en-têtes de colonnes */
.dataTables_wrapper .dataTable thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    padding: 0.75rem;
    position: relative;
}

.dataTables_wrapper .dataTable thead th.sorting,
.dataTables_wrapper .dataTable thead th.sorting_asc,
.dataTables_wrapper .dataTable thead th.sorting_desc {
    cursor: pointer;
    padding-right: 2rem;
}

.dataTables_wrapper .dataTable thead th.sorting:after,
.dataTables_wrapper .dataTable thead th.sorting_asc:after,
.dataTables_wrapper .dataTable thead th.sorting_desc:after {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: "bootstrap-icons";
    font-size: 0.875rem;
    opacity: 0.5;
}

.dataTables_wrapper .dataTable thead th.sorting:after {
    content: "\F229";
}

.dataTables_wrapper .dataTable thead th.sorting_asc:after {
    content: "\F229";
    opacity: 1;
    color: #0d6efd;
}

.dataTables_wrapper .dataTable thead th.sorting_desc:after {
    content: "\F22A";
    opacity: 1;
    color: #0d6efd;
}

/* Personnalisation des lignes */
.dataTables_wrapper .dataTable tbody tr {
    transition: background-color 0.15s ease-in-out;
}

.dataTables_wrapper .dataTable tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05) !important;
}

/* Personnalisation des cellules */
.dataTables_wrapper .dataTable tbody td {
    padding: 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #dee2e6;
}

/* Personnalisation des informations */
.dataTables_wrapper .dataTables_info {
    color: #6c757d;
    font-size: 0.875rem;
    padding-top: 0.5rem;
}

/* Personnalisation des boutons d'export */
.btn-group .btn {
    border-radius: 0.375rem;
    margin: 0 1px;
    transition: all 0.2s ease-in-out;
}

.btn-group .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Responsive design */
@media (max-width: 768px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        text-align: left;
        margin-bottom: 0.5rem;
    }
    
    .dataTables_wrapper .dataTables_filter input {
        min-width: 150px;
    }
    
    .dataTables_wrapper .dataTables_paginate {
        text-align: center;
        margin-top: 1rem;
    }
    
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .btn-group {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .btn-group .btn {
        font-size: 0.875rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Personnalisation des badges et statuts */
.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

/* Personnalisation des images dans les tableaux */
.img-thumbnail {
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.no-photo-placeholder {
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Animation de chargement */
.dataTables_processing {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 1rem 2rem;
    font-weight: 500;
    color: #495057;
}

/* Personnalisation des tooltips */
.tooltip {
    font-size: 0.875rem;
}

/* Personnalisation des modals pour les exports */
.modal-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* Personnalisation des alertes */
.alert {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Personnalisation des cartes */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #dee2e6;
}

.card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

/* Personnalisation des formulaires */
.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Personnalisation des boutons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Personnalisation des progress bars */
.progress {
    border-radius: 0.5rem;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 0.5rem;
}

/* Personnalisation des icônes */
.bi {
    vertical-align: middle;
}

/* Personnalisation des tableaux responsifs */
.table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
}

/* Personnalisation des filtres personnalisés */
.custom-filter {
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    padding: 0.375rem 0.75rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.custom-filter:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Animation pour les changements de données */
.dataTables_wrapper .dataTable tbody tr {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Personnalisation des états vides */
.dataTables_empty {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
}

/* Personnalisation des sélecteurs de page */
.dataTables_wrapper .dataTables_length select {
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    padding: 0.375rem 0.75rem;
    background-color: #fff;
}

/* Personnalisation des champs de recherche */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    padding: 0.375rem 0.75rem;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    outline: none;
} 