/* Styles appliqués directement à tous les éléments avec bulle */
[bulle] {
  position: relative; /* Nécessaire pour positionner le tooltip */
  cursor: pointer;
  color: #007bff; /* Couleur du texte du lien ou élément */
  text-decoration: none;
}

/* Style du tooltip (pseudo-élément ::after) */
[bulle]::after {
  content: attr(bulle); /* Récupère le texte depuis l'attribut bulle */
  visibility: hidden; /* Caché par défaut */
  opacity: 0; /* Complètement transparent */
  position: absolute;
  background-color: #333; /* Couleur de fond du tooltip */
  color: #fff; /* Couleur du texte du tooltip */
  text-align: center;
  padding: .3rem .45rem;
  border-radius: 4px;
  font-size: .7rem;
  line-height: 1.2;
  width: max-content;
  max-width: 180px;
  bottom: 125%; /* Position au-dessus de l'élément */
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
  pointer-events: none;
}

/* Petite flèche sous le tooltip */
[bulle]::before {
  content: '';
  position: absolute;
  top: 100%; /* Place en bas du tooltip */
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Afficher le tooltip au survol */
[bulle]:hover::after,
[bulle]:hover::before,
[bulle]:focus-visible::after,
[bulle]:focus-visible::before {
  visibility: visible;
  opacity: 1;
}

/* Les actions placees dans la premiere colonne ouvrent leur bulle vers la
 * droite afin qu'elle ne passe pas sous la barre laterale. */
[bulle].bulle-right::after {
  left: 0;
  transform: none;
  text-align: left;
}

/*
 * Un document absent reste non cliquable, mais reçoit le pointeur pour que
 * l'utilisateur puisse encore lire sa bulle explicative au survol ou au clavier.
 */
.ar-action-unavailable {
  cursor: help !important;
  opacity: .7;
}

/* Configuration de l'ordre des etats du pas a pas AR. */
.ar-state-config {
  max-width: 850px;
}

.ar-state-sortable {
  display: grid;
  gap: .5rem;
}

.ar-state-sortable-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 3.25rem;
  padding: .65rem .8rem;
  border: 1px solid #d8e2ef;
  border-radius: .5rem;
  background: #fff;
  box-shadow: 0 2px 5px rgba(17, 43, 74, .05);
  cursor: grab;
  transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.ar-state-sortable-item:hover {
  border-color: #9ec5fe;
  box-shadow: 0 4px 10px rgba(17, 43, 74, .1);
}

.ar-state-sortable-item.is-dragging {
  opacity: .45;
  cursor: grabbing;
}

.ar-state-sortable.is-saving {
  pointer-events: none;
  opacity: .75;
}

.ar-state-drag-handle {
  color: #748194;
  font-size: 1.1rem;
}

.ar-state-number {
  min-width: 2rem;
}
