/* Styles pour la barre d'outils de texte */
.text-toolbar {
  display: flex;
  align-items: center;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
}

.text-toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 16px;
}

.text-toolbar-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #6b7280;
  margin-right: 4px;
}

.text-toolbar-value {
  display: flex;
  align-items: center;
  height: 32px;
  background-color: white;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  color: #111827;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.text-toolbar-value:hover {
  border-color: #9ca3af;
  background-color: #f3f4f6;
}

.text-toolbar-value::after {
  content: '▼';
  font-size: 10px;
  margin-left: 8px;
  color: #9ca3af;
}

.text-toolbar-status {
  display: flex;
  align-items: center;
  position: relative;
}

.text-toolbar-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-nouveau .text-toolbar-status-indicator { background-color: #3b82f6; }
.status-lecture .text-toolbar-status-indicator { background-color: #f59e0b; }
.status-accepte .text-toolbar-status-indicator { background-color: #10b981; }
.status-refuse .text-toolbar-status-indicator { background-color: #ef4444; }

/* Styles pour les modales associées */
.text-toolbar-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
  min-width: 160px;
  z-index: 100;
  display: none;
  overflow: hidden;
}

.text-toolbar-dropdown.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

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

.text-toolbar-dropdown-item {
  padding: 8px 12px;
  font-size: 0.9rem;
  color: #374151;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
}

.text-toolbar-dropdown-item:hover {
  background-color: #f3f4f6;
}

.text-toolbar-dropdown-item.active {
  background-color: #eff6ff;
  color: #2563eb;
  font-weight: 500;
}

.text-toolbar-dropdown-item-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 8px;
}

.dropdown-status-nouveau .text-toolbar-dropdown-item-indicator { background-color: #3b82f6; }
.dropdown-status-lecture .text-toolbar-dropdown-item-indicator { background-color: #f59e0b; }
.dropdown-status-accepte .text-toolbar-dropdown-item-indicator { background-color: #10b981; }
.dropdown-status-refuse .text-toolbar-dropdown-item-indicator { background-color: #ef4444; }

/* Dialog d'assignation */
.text-assign-dialog,
.text-confirm-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.text-assign-dialog.active,
.text-confirm-dialog.active {
  opacity: 1;
  visibility: visible;
}

.text-assign-dialog-content,
.text-confirm-dialog-content {
  background-color: white;
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(20px);
  transition: transform 0.3s;
}

.text-assign-dialog.active .text-assign-dialog-content,
.text-confirm-dialog.active .text-confirm-dialog-content {
  transform: translateY(0);
}

.text-assign-dialog-header,
.text-confirm-dialog-header {
  margin-bottom: 16px;
}

.text-assign-dialog-title,
.text-confirm-dialog-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 8px 0;
}

.text-assign-dialog-subtitle,
.text-confirm-dialog-subtitle {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0;
}

.text-assign-dialog-body,
.text-confirm-dialog-body {
  margin-bottom: 24px;
}

.text-confirm-dialog-warning {
  color: #b91c1c;
  font-size: 0.9rem;
  padding: 8px 12px;
  background-color: #fee2e2;
  border-radius: 6px;
  margin-top: 12px;
}

.text-assign-form-group,
.text-confirm-form-group {
  margin-bottom: 16px;
}

.text-assign-form-label,
.text-confirm-form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
}

.text-assign-form-select,
.text-confirm-form-textarea {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  background-color: white;
  color: #111827;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.text-assign-form-select:focus,
.text-confirm-form-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.text-confirm-form-help {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 4px;
  font-style: italic;
}

.text-assign-dialog-footer,
.text-confirm-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.text-assign-btn,
.text-confirm-btn {
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.text-assign-btn-cancel,
.text-confirm-btn-cancel {
  background-color: white;
  border: 1px solid #d1d5db;
  color: #6b7280;
}

.text-assign-btn-cancel:hover,
.text-confirm-btn-cancel:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

.text-assign-btn-save {
  background-color: #2563eb;
  border: 1px solid #2563eb;
  color: white;
}

.text-assign-btn-save:hover {
  background-color: #1d4ed8;
}

.text-confirm-btn-confirm {
  background-color: #ef4444;
  border: 1px solid #ef4444;
  color: white;
}

.text-confirm-btn-confirm:hover {
  background-color: #dc2626;
}

/* Toast de notification */
.text-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 16px;
  border-radius: 6px;
  background-color: #10b981;
  color: white;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1050;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
}

.text-notification.active {
  opacity: 1;
  transform: translateY(0);
}

.text-notification.error {
  background-color: #ef4444;
}

.text-notification.warning {
  background-color: #f59e0b;
}

.text-notification.info {
  background-color: #3b82f6;
}

/* Animation de sauvegarde */
.saving-indicator {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(59, 130, 246, 0.25);
  border-top-color: #3b82f6;
  border-radius: 50%;
  margin-left: 8px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Adaptation responsive */
@media (max-width: 768px) {
  .text-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .text-toolbar-group {
    width: 100%;
    margin-right: 0;
    justify-content: space-between;
  }
  
  .text-toolbar-value {
    flex-grow: 1;
    justify-content: space-between;
  }
}

.text-toolbar-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #6b7280;
  margin-right: 4px;
}

.text-toolbar-value {
  display: flex;
  align-items: center;
  height: 32px;
  background-color: white;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  color: #111827;
  cursor: pointer;
  transition: all 0.2s;
}

.text-toolbar-value:hover {
  border-color: #9ca3af;
  background-color: #f3f4f6;
}

.text-toolbar-status {
  display: flex;
  align-items: center;
  position: relative;
}

.text-toolbar-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-nouveau .text-toolbar-status-indicator { background-color: #3b82f6; }
.status-lecture .text-toolbar-status-indicator { background-color: #f59e0b; }
.status-accepte .text-toolbar-status-indicator { background-color: #10b981; }
.status-refuse .text-toolbar-status-indicator { background-color: #ef4444; }

.text-toolbar-action {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  background-color: #2563eb;
  color: white;
  padding: 0 12px;
  border-radius: 6px;
  border: none;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.text-toolbar-action:hover {
  background-color: #1d4ed8;
}

.text-toolbar-action.reject {
  background-color: #ef4444;
}

.text-toolbar-action.reject:hover {
  background-color: #dc2626;
}

.text-toolbar-action.assign {
  background-color: #f59e0b;
}

.text-toolbar-action.assign:hover {
  background-color: #d97706;
}

.text-toolbar-action.save {
  background-color: #10b981;
}

.text-toolbar-action.save:hover {
  background-color: #059669;
}

/* Styles pour les modales associées */
.text-toolbar-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
  min-width: 160px;
  z-index: 100;
  display: none;
}

.text-toolbar-dropdown.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

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

.text-toolbar-dropdown-item {
  padding: 8px 12px;
  font-size: 0.9rem;
  color: #374151;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
}

.text-toolbar-dropdown-item:hover {
  background-color: #f3f4f6;
}

.text-toolbar-dropdown-item.active {
  background-color: #eff6ff;
  color: #2563eb;
  font-weight: 500;
}

.text-toolbar-dropdown-item:first-child {
  border-radius: 8px 8px 0 0;
}

.text-toolbar-dropdown-item:last-child {
  border-radius: 0 0 8px 8px;
}

.text-toolbar-dropdown-item-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 8px;
}

.dropdown-status-nouveau .text-toolbar-dropdown-item-indicator { background-color: #3b82f6; }
.dropdown-status-lecture .text-toolbar-dropdown-item-indicator { background-color: #f59e0b; }
.dropdown-status-accepte .text-toolbar-dropdown-item-indicator { background-color: #10b981; }
.dropdown-status-refuse .text-toolbar-dropdown-item-indicator { background-color: #ef4444; }

/* Dialog d'assignation */
.text-assign-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.text-assign-dialog.active {
  opacity: 1;
  visibility: visible;
}

.text-assign-dialog-content {
  background-color: white;
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.text-assign-dialog-header {
  margin-bottom: 16px;
}

.text-assign-dialog-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 8px 0;
}

.text-assign-dialog-subtitle {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0;
}

.text-assign-dialog-body {
  margin-bottom: 24px;
}

.text-assign-form-group {
  margin-bottom: 16px;
}

.text-assign-form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
}

.text-assign-form-select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  background-color: white;
  color: #111827;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.text-assign-form-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.text-assign-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.text-assign-btn {
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.text-assign-btn-cancel {
  background-color: white;
  border: 1px solid #d1d5db;
  color: #6b7280;
}

.text-assign-btn-cancel:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

.text-assign-btn-save {
  background-color: #2563eb;
  border: 1px solid #2563eb;
  color: white;
}

.text-assign-btn-save:hover {
  background-color: #1d4ed8;
}

/* Toast de notification */
.text-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 16px;
  border-radius: 6px;
  background-color: #10b981;
  color: white;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1050;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
}

.text-notification.active {
  opacity: 1;
  transform: translateY(0);
}

.text-notification.error {
  background-color: #ef4444;
}

.text-notification.warning {
  background-color: #f59e0b;
}

.text-notification.info {
  background-color: #3b82f6;
}

/* Adaptation responsive */
@media (max-width: 768px) {
  .text-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .text-toolbar-group {
    width: 100%;
    margin-right: 0;
    justify-content: space-between;
  }
  
  .text-toolbar-value {
    flex-grow: 1;
    justify-content: space-between;
  }
  
  .text-toolbar-value::after {
    content: '\25BC';
    font-size: 0.7rem;
    color: #9ca3af;
  }
}

/* Styles pour l'option d'ajout de libellé */

/* Styles pour le bouton d'ajout de nouveau libellé */
.text-toolbar-add-new-label {
  border-top: 1px dashed #e5e7eb;
  margin-top: 4px;
  padding: 8px 12px;
  color: #2563eb;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.text-toolbar-add-new-label:hover {
  background-color: #eff6ff;
}

.text-toolbar-dropdown-add-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  text-align: center;
  line-height: 14px;
  border-radius: 50%;
  background-color: #2563eb;
  color: white;
  font-size: 14px;
  margin-right: 6px;
}

/* Styles pour le champ de texte dans la boîte de dialogue d'ajout */
.text-confirm-form-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  background-color: white;
  color: #111827;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.text-confirm-form-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Bouton pour enregistrer le nouveau libellé */
.text-confirm-btn-save {
  background-color: #2563eb;
  border: 1px solid #2563eb;
  color: white;
}

.text-confirm-btn-save:hover {
  background-color: #1d4ed8;
}

