/* 
 * CrudManager v1.03 - Styles pour le type 'combo'
 * Dropdown custom avec recherche filtrante
 */

.form-control-color-option {
    display: block;
    /* width: 100%; */
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--bs-body-color);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: var(--bs-body-bg);
    background-clip: padding-box;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.switch-toggle-active .form-check-input {
    width: 3em;
    height: 1.5em;
    cursor: pointer;
    transition: all .25s ease;
}

/* texte OFF par défaut */
.switch-toggle-active .form-check-label::after {
    content: attr(data-label-off);
    margin-left: 10px;
    font-weight: 500;
    transition: color .25s ease;
}

/* texte ON quand coché */
.switch-toggle-active .form-check-input:checked + .form-check-label::after {
    content: attr(data-label-on);
    color: var(--bs-primary);
}

/* Wrapper du champ file */
.file-upload-wrapper {
  position: relative;
}

/* Input file caché */
.file-upload-wrapper .file-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Zone de drop */
.file-drop-zone {
  border: 2px dashed var(--bs-primary);
  border-radius: 4px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
}

.file-drop-zone:hover {
  border-color: var(--bs-primary);
  background-color: #f8f9fa;
}

.file-drop-zone.drag-over {
  border-color: var(--bs-primary);
  background-color: #e7f1ff;
}

.file-drop-zone i {
  font-size: 1rem;
  /* font-size: 2rem;
  color: #6c757d;
  display: block;
  margin-bottom: 0.5rem; */
}

/* Info fichier sélectionné */
.file-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background-color: #e0e0e0;
  border-radius: 4px;
  margin-top: 0.5rem;
}

.file-info .file-name {
  flex: 1;
  font-weight: 600;
}

/* Agrandir l'icône de téléchargement dans les champs file */
.file-info .file-name a i.bi-download {
  font-size: 1.5rem!Important; 
}

/* Optionnel : ajouter un peu d'espace et une couleur au survol */
.file-info .file-name a {
  display: inline-flex;
  align-items: center;
  margin-left: 0.5rem;
  color: var(--bs-link-color);
  text-decoration: none;
}

.file-info .file-name a:hover {
  color: var(--bs-link-hover-color);
}

/* Info fichier actuel (en édition) */
.current-file-info {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background-color: #e7f1ff;
  border-radius: 4px;
  font-size: 0.875rem;
}

.current-file-name {
  font-weight: 500;
}

 .editBtn:disabled {
    background-color : var(--bs-secondary-bg) ;
 }
 
 .btn-cdy-primary {
    border: 1px solid black ;
    border-radius: 10%;
    padding: 2px ;
    background-color: var(--bs-primary)!Important ;
 }
 
 .btn-cdy-danger {
    border: 1px solid black ;
    border-radius: 10%;
    padding: 2px ;
    background-color: var(--bs-danger)!Important ;
 }
 
 .btn-cdy {
    min-width: 0px ;
    border: 1px solid black ;
    border-radius: 10% ;
    padding: 2px ;
}

 .pr-3 {
    padding-right:1rem!Important ;
 }
 
 .pr-4 {
    padding-right:1.5rem!Important ;
 }
 
/* Centrage vertical pour les tables avec classe CRUD table */
.crud-table-ready tbody td {
    vertical-align: middle;
}

/* Centrage vertical pour les boutons des tables avec classe CRUD table */
.crud-table-ready tbody td button.btn {
    vertical-align: middle;
    margin:0 ;
}


/* Wrapper du combo */
.combo-wrapper {
  position: relative;
}

/* Dropdown des options */
.combo-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  max-height: 300px;
  overflow-y: auto;
  background-color: #ffffff;
  border: 1px solid #ced4da;
  border-top: none;
  border-radius: 0 0 0.25rem 0.25rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  margin-top: -1px;
}

/* Item du dropdown */
.combo-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  border-bottom: 1px solid #f0f0f0;
  background-color: #ffffff;
}

.combo-item:last-child {
  border-bottom: none;
}

/* Item survolé ou sélectionné au clavier */
.combo-item:hover,
.combo-item.combo-selected {
  /* background-color: #0d6efd; */
  /* background-color: #f5c6d8; */
  background-color: #e1e1e1;
  color: #ffffff;
  color: #000;
  font-weight: 500;
}

/* Item actif (clic) */
.combo-item:active {
  /* background-color: #0a58ca; */
  background-color: #9c2b5e;
  color: #ffffff;
}

/* Message "Aucun résultat" */
.combo-item.combo-no-result {
  color: #6c757d;
  font-style: italic;
  cursor: default;
  text-align: center;
}

.combo-item.combo-no-result:hover {
  background-color: transparent;
}

/* Scrollbar personnalisée (webkit) */
.combo-dropdown::-webkit-scrollbar {
  width: 8px;
}

.combo-dropdown::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.combo-dropdown::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.combo-dropdown::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Animation d'apparition */
.combo-dropdown {
  animation: comboFadeIn 0.15s ease-in;
}

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

/* Focus sur l'input */
.combo-wrapper input:focus {
  /* border-color: #86b7fe; */
  border-color: #d63384;
  outline: 0;
  /* box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25); */
  box-shadow: 0 0 0 0.25rem rgba(214, 51, 132, 0.25);
}

/* État disabled */
.combo-wrapper input:disabled {
  background-color: #e9ecef;
  cursor: not-allowed;
}

/* Responsive - réduire la hauteur max sur mobile */
@media (max-width: 768px) {
  .combo-dropdown {
    max-height: 200px;
  }
}

/* ============================================
 * Anti-flash : Masquer le tableau pendant l'initialisation
 * ============================================ */

/* Masquer le tableau pendant que CrudManager configure les colonnes */
.crud-table-loading {
  visibility: hidden;
}

/* Afficher le tableau une fois configuré */
.crud-table-ready {
  visibility: visible;
}

/* ============================================
 * Ascenseur horizontal pour les tables DataTables (intégration Bootstrap 5)
 * ============================================ */
.dt-container .dt-layout-table > .dt-layout-full {
    display: block !important;          /* neutralise le d-md-flex de DataTables BS5 */
    overflow-x: auto;
    min-width: 0;                       /* la colonne flex accepte d'être plus étroite que la table */
    -webkit-overflow-scrolling: touch;
}
