#textLayer {
  opacity: 0.2;
  line-height: 1.0;
}

div.accordion-content  {
  border-color: #e5e7eb !important;
  border-width: 1px 0px 0px 0px;
}

div.accordion-item {
  border-color: #e5e7eb !important;
  border-width: 1px 1px 0px 1px;
}

/* Styles pour l'aperçu Markdown */
.markdown-content {
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: #333;
}

.markdown-content h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 1.5rem 0 1rem;
  color: #4338ca;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

.markdown-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 1.25rem 0 0.75rem;
  color: #4338ca;
}

.markdown-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
  color: #4f46e5;
}

.markdown-content p {
  margin-bottom: 1rem;
}

.markdown-content ul {
  list-style-type: disc;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.markdown-content li {
  margin-bottom: 0.25rem;
}

.markdown-content a {
  color: #3b82f6;
  text-decoration: underline;
}

.markdown-content a:hover {
  color: #2563eb;
}

.markdown-content code {
  font-family: monospace;
  background-color: #f3f4f6;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

.markdown-content pre {
  background-color: #f3f4f6;
  padding: 1rem;
  border-radius: 0.375rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.markdown-content blockquote {
  border-left: 4px solid #e5e7eb;
  padding-left: 1rem;
  color: #6b7280;
  font-style: italic;
  margin: 1rem 0;
}

.markdown-image {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border-radius: 0.375rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Styles pour le modal */
#markdownModal,
#editPersonModal,
#previewModal {
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: scale(0.95);
}

#markdownModal.show,
#editPersonModal.show,
#previewModal.active {
  opacity: 1;
  transform: scale(1);
}

#textLayer ::selection {
  background: rgba(var(--highlight-color), 1);
}

#textLayer .highlight {
  background: rgba(var(--highlight-color), 1);
}

#textLayer > span {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
}

/* Réduire la taille du texte pour les noms détectés */
#personsList span,
#highlightsList span {
  font-size: 0.85rem;
}

.highlight-layer {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1000;
}

.highlight-rect {
  position: absolute;
  background-color: rgba(255, 255, 0, 0.25);
  border: 1px solid rgba(255, 255, 0, 0.5);
  pointer-events: all;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.2s, border-color 0.2s, box-shadow 0.3s;
}

.pdf-error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 2rem;
  background-color: #f9fafb;
  border-radius: 0.5rem;
  border: 1px dashed #d1d5db;
}

.pdf-error-message svg {
  width: 64px;
  height: 64px;
  color: #ef4444;
  margin-bottom: 1.5rem;
}

.pdf-error-message h3 {
  font-size: 1.5rem;
  color: #1f2937;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.pdf-error-message p {
  color: #6b7280;
  max-width: 24rem;
  line-height: 1.5;
}

/* Style pour une zone sélectionnée */
.highlight-rect.selected {
  border: 2px solid rgba(79, 70, 229, 0.8);
  background-color: rgba(79, 70, 229, 0.2);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.3);
  animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
  from {
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.3);
  }
  to {
    box-shadow: 0 0 0 8px rgba(79, 70, 229, 0.1);
  }
}

.resize-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: white;
  border: 1px solid rgba(255, 255, 0, 0.8);
  pointer-events: all;
}

.resize-handle.nw { top: -4px; left: -4px; cursor: nw-resize; }
.resize-handle.ne { top: -4px; right: -4px; cursor: ne-resize; }
.resize-handle.sw { bottom: -4px; left: -4px; cursor: sw-resize; }
.resize-handle.se { bottom: -4px; right: -4px; cursor: se-resize; }
.resize-handle.n { top: -4px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.resize-handle.s { bottom: -4px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.resize-handle.w { left: -4px; top: 50%; transform: translateY(-50%); cursor: w-resize; }
.resize-handle.e { right: -4px; top: 50%; transform: translateY(-50%); cursor: e-resize; }

.highlight-rect:hover {
  border-color: rgba(255, 255, 0, 0.8);
}

.resize-handle.e { right: -4px; top: 50%; transform: translateY(-50%); cursor: e-resize; }


/* Bouton suppression zone */
.delete-zone-button {
  position: absolute;
  top: -25px;
  right: 0;
  background-color: #ef4444;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.highlight-rect:hover .delete-zone-button {
  opacity: 1;
}

#pageContainer {
  margin: 0 auto;
}

.highlight-preview {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: white;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  width: 90%;
  max-width: 400px;
}

.drawing-preview {
  position: absolute;
  background-color: rgba(255, 255, 0, 0.25);
  border: 2px solid rgba(79, 70, 229, 0.5);
  pointer-events: none;
  z-index: 1000;
}

/* Styles pour la modale d'aperçu */
#previewModal {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s ease-in-out;
  z-index: 1100;
}

#previewModal > div {
  height: 90vh !important; /* Hauteur fixe à 90% sur mobile, 80% sur desktop */
  max-height: 90vh !important;
  overflow: hidden; /* Masquer tout débordement de la modale elle-même */
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  #previewModal > div {
    height: 80vh !important;
    max-height: 80vh !important;
  }
}

/* Zone de contenu avec défilement */
#previewModal .flex-1.relative {
  flex: 1;
  min-height: 0; /* Important pour que flex: 1 fonctionne correctement */
  overflow: hidden; /* Masquer le débordement au niveau du conteneur parent */
}

/* En-tête fixe de la modale */
#previewModal .flex.justify-between.items-center.mb-4 {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex-shrink: 0; /* Empêcher l'en-tête de rétrécir */
}

#previewModal.active > div {
  transform: scale(1);
  opacity: 1;
}

#previewContainer {
  background: repeating-linear-gradient(
    45deg,
    #f1f5f9,
    #f1f5f9 10px,
    #f8fafc 10px,
    #f8fafc 20px
  );
}

#previewFrame {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
              0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease-in-out;
}

.preview-controls {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(229, 231, 235, 0.5);
  border-radius: 9999px;
  padding: 0.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.preview-button {
  @apply rounded-full p-2 hover:bg-gray-100 transition-colors duration-200;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#previewLoader {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Système de notification */
.notification {
  position: fixed;
  top: 1rem;
  right: 15%;
  margin-right: 2%;
  max-width: 95%;
  width: auto;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  color: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  transform: translateX(-50%) translateY(-1rem);
  font-size: 0.875rem;
}

@media (min-width: 768px) {
  .notification {
    max-width: 90%;
    padding: 0.75rem 1.25rem;
    gap: 0.75rem;
  }
}

.notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.notification.success {
  background-color: #10b981;
}

.notification.error {
  background-color: #ef4444;
}

.notification.info {
  background-color: #3b82f6;
}

.notification.warning {
  background-color: #f59e0b;
}

.notification-icon {
  flex-shrink: 0;
}

.notification-message {
  flex-grow: 1;
  font-size: 0.75rem;
  line-height: 1.2rem;
}

@media (min-width: 768px) {
  .notification-message {
    font-size: 0.875rem;
    line-height: 1.25rem;
  }
}

.notification-close {
  flex-shrink: 0;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.notification-close:hover {
  opacity: 1;
}

/* Styles pour les éléments de la liste des zones d'anonymisation */
.highlight-item:hover {
  border-color: rgba(79, 70, 229, 0.3);
  background-color: rgba(79, 70, 229, 0.05);
}

.highlight-item .highlight-checkbox {
  cursor: pointer;
  accent-color: #4f46e5;
}

.highlight-checkbox:checked + span {
  color: #4f46e5;
  font-weight: 500;
}

/* Ajouter un marqueur visuel pour les zones sélectionnées */
.highlight-checkbox:checked {
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* Header styles */
.gradient-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.gradient-bg h1 {
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gradient-bg a {
  transition: all 0.2s ease-in-out;
}

.gradient-bg a:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* Styles pour les barres de défilement dans la prévisualisation */
#previewContainer {
  width: 100%;
  height: 100%;
  overflow: auto !important; /* Toujours autoriser le défilement */
  display: flex;
  align-items: flex-start; /* Aligner au début plutôt qu'au centre */
  justify-content: center;
}

#highlightColor {
  border: 1px solid #939393;
}

#previewContainer::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#previewContainer::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 4px;
}

#previewContainer::-webkit-scrollbar-thumb {
  background-color: rgba(107, 114, 128, 0.5);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

#previewContainer::-webkit-scrollbar-thumb:hover {
  background-color: rgba(107, 114, 128, 0.7);
}

/* S'assurer que le frame est correctement positionné */
#previewFrame {
  display: block;
  transition: width 0.2s, height 0.2s;
}

/* Ajouter une ombre subtile pour indiquer la possibilité de défilement */
#previewContainer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transition: opacity 0.3s;
}

#previewContainer:hover::after {
  opacity: 1;
}

.z-1000 {
  z-index: 1000;
}

.confirm-delete {
  z-index: 1000;
}

.bloc-information{
background: #fbfbfb;
    border: 1px solid #ededed;
}

.serperation-left-bloc {
  border-left: 1px solid #f0eeee;
  padding-left: 20px;
  padding-top: 20px;
}




/* Styles responsives pour mobile */
@media (max-width: 768px) {
  /* Ajustements pour les contrôles de navigation */
  .prevPage, .nextPage, .pageInfo {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem !important;
  }
  
  /* Ajustements pour les modales */
  #previewModal .flex-1.relative,
  #markdownModal .flex-1.relative {
    min-height: 60vh;
  }
  
  /* Ajustements pour les onglets */
  .tab-button {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
  
  /* Ajustements pour les listes */
  .highlight-item, .keyword-item {
    padding: 0.5rem;
  }
  
  /* Ajustements pour le tableau de bord des statuts */
  #status-text-extracted, #status-summary, #status-keywords,
  #status-persons, #status-zones, #status-search-engine, #status-pdf-generated {
    width: 0.5rem;
    height: 0.5rem;
  }
  
  /* Ajustements pour les boutons */
  button.px-3.py-2 {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
  }
  
  /* Ajustements pour les formulaires */
  input[type="text"] {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
  
  /* Ajustements pour le conteneur PDF */
  #pageContainer {
    width: 100% !important;
  }
  
  /* Ajustements pour les contrôles de zoom */
  #zoomOut, #zoomIn, #zoomLevel {
    transform: scale(0.8);
  }
  
  /* Ajustements pour la prévisualisation */
  #previewFrame {
    width: 100% !important;
  }
  
  /* Ajustements pour les notifications */
  .notification {
    bottom: 1rem;
    top: auto;
    width: 90%;
    max-width: 90%;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem;
  }
  
  .notification-message {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
    width: 100%;
  }
  
  .notification-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
  }
  
  /* Ajustements pour les contrôles de prévisualisation */
  .preview-controls {
    padding: 0.25rem;
  }
  
  /* Ajustements pour les boutons de prévisualisation */
  .preview-button {
    padding: 0.25rem !important;
  }
}

    