/*
 * Action Text / Trix Editor Styles
 *
 * Styles pour l'éditeur WYSIWYG Trix et l'affichage du contenu enrichi
 */

/* =================================================
   Éditeur Trix - Toolbar
   ================================================= */

trix-toolbar {
  background-color: #F8FAFC; /* lawbee-bg */
  border-bottom: 1px solid #E2E8F0; /* lawbee-border */
  padding: 0.5rem;
  border-radius: 0.5rem 0.5rem 0 0;
}

trix-toolbar .trix-button-group {
  border: 1px solid #E2E8F0;
  border-radius: 0.375rem;
  margin-right: 0.5rem;
}

trix-toolbar .trix-button {
  background-color: white;
  border: none;
  padding: 0.375rem 0.5rem;
}

trix-toolbar .trix-button:hover {
  background-color: #F8FAFC;
}

trix-toolbar .trix-button.trix-active {
  background-color: #A78BFA; /* lawbee-violet */
  color: white;
}

trix-toolbar .trix-button--icon::before {
  opacity: 0.7;
}

trix-toolbar .trix-button.trix-active .trix-button--icon::before {
  opacity: 1;
}

/* =================================================
   Éditeur Trix - Zone de texte
   ================================================= */

trix-editor {
  background-color: white;
  border: 1px solid #E2E8F0;
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
  padding: 1rem;
  min-height: 300px;
  font-size: 1rem;
  line-height: 1.75;
  color: #2D2A4A; /* lawbee-ink */
}

trix-editor:focus {
  outline: none;
  box-shadow: 0 0 0 2px #A78BFA; /* lawbee-violet */
}

trix-editor h1 {
  font-size: 1.875rem;
  font-weight: bold;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

trix-editor h2 {
  font-size: 1.5rem;
  font-weight: bold;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

trix-editor p {
  margin-bottom: 1rem;
}

trix-editor ul,
trix-editor ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

trix-editor li {
  margin-bottom: 0.25rem;
}

trix-editor blockquote {
  border-left: 4px solid #A78BFA;
  padding-left: 1rem;
  margin-left: 0;
  margin-right: 0;
  color: #475569; /* lawbee-muted */
  font-style: italic;
}

trix-editor pre {
  background-color: #1E293B;
  color: #E2E8F0;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
}

trix-editor a {
  color: #A78BFA;
  text-decoration: underline;
}

trix-editor a:hover {
  color: #4B457A;
}

/* Images dans l'éditeur */
trix-editor figure {
  margin: 1rem 0;
}

trix-editor figure img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

trix-editor figure figcaption {
  text-align: center;
  color: #475569;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* =================================================
   Affichage du contenu Action Text
   ================================================= */

.trix-content {
  line-height: 1.75;
}

.trix-content h1 {
  font-size: 2rem;
  font-weight: bold;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #2D2A4A;
}

.trix-content h2 {
  font-size: 1.5rem;
  font-weight: bold;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #2D2A4A;
}

.trix-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: #2D2A4A;
}

.trix-content p {
  margin-bottom: 1rem;
}

.trix-content ul,
.trix-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.trix-content ul {
  list-style-type: disc;
}

.trix-content ol {
  list-style-type: decimal;
}

.trix-content li {
  margin-bottom: 0.5rem;
}

.trix-content blockquote {
  border-left: 4px solid #A78BFA;
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  color: #475569;
  font-style: italic;
}

.trix-content pre {
  background-color: #1E293B;
  color: #E2E8F0;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
  margin: 1rem 0;
}

.trix-content code {
  background-color: #F1F5F9;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-family: ui-monospace, monospace;
  font-size: 0.875em;
}

.trix-content pre code {
  background-color: transparent;
  padding: 0;
}

.trix-content a {
  color: #A78BFA;
  text-decoration: underline;
}

.trix-content a:hover {
  color: #4B457A;
}

.trix-content strong {
  font-weight: 600;
}

.trix-content em {
  font-style: italic;
}

.trix-content figure {
  margin: 1.5rem 0;
}

.trix-content figure img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.trix-content figure figcaption {
  text-align: center;
  color: #475569;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* Attachments Action Text */
.trix-content .attachment {
  display: inline-block;
  max-width: 100%;
}

.trix-content .attachment--preview {
  text-align: center;
}

.trix-content .attachment__caption {
  color: #475569;
  font-size: 0.875rem;
  text-align: center;
  margin-top: 0.5rem;
}

/* =================================================
   Prose Typography (pour Tailwind)
   ================================================= */

.prose-lawbee {
  --tw-prose-body: #2D2A4A;
  --tw-prose-headings: #2D2A4A;
  --tw-prose-links: #A78BFA;
  --tw-prose-bold: #2D2A4A;
  --tw-prose-quotes: #475569;
  --tw-prose-quote-borders: #A78BFA;
  --tw-prose-code: #2D2A4A;
  --tw-prose-pre-bg: #1E293B;
  --tw-prose-pre-code: #E2E8F0;
}
/* ========================================
   ANIMATIONS PERSONNALISÉES POUR LAW BEE
   ======================================== */

/* ========================================
   ANIMATIONS DE BASE
   ======================================== */

/* Animation de pulse unique */
@keyframes pulse-once {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.animate-pulse-once {
  animation: pulse-once 0.6s ease-in-out;
}

/* Animation de bounce unique */
@keyframes bounce-once {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.animate-bounce-once {
  animation: bounce-once 0.5s ease-in-out;
}

/* Animation de shake pour les erreurs */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

/* Animation de slide-up pour les apparitions */
@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  animation: slide-up 0.3s ease-out;
}

/* Animation de fade-in */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.animate-fade-in {
  animation: fade-in 0.3s ease-out;
}

/* Animation de fade-out */
@keyframes fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.animate-fade-out {
  animation: fade-out 0.3s ease-out forwards;
}

/* Animation de scale-in pour les modals */
@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-scale-in {
  animation: scale-in 0.2s ease-out;
}

/* ========================================
   EFFETS INTERACTIFS
   ======================================== */

/* Effet de glow au survol pour les boutons importants */
.hover-glow {
  transition: all 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.5);
  transform: translateY(-2px);
}

/* Effet de ripple au clic (CSS statique) */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
}

/* Animation ripple dynamique (pour le contrôleur JS) */
@keyframes ripple-expand {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* Transition douce pour tous les éléments interactifs */
button, a, input, select, textarea {
  transition: all 0.2s ease;
}

/* ========================================
   ANIMATIONS DE CHARGEMENT
   ======================================== */

/* Animation de chargement élégante */
@keyframes loading-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading-pulse {
  animation: loading-pulse 1.5s ease-in-out infinite;
}

/* Spinner rotatif */
@keyframes spin-smooth {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin-smooth {
  animation: spin-smooth 1s linear infinite;
}

/* ========================================
   ANIMATIONS DE SUCCÈS
   ======================================== */

/* Animation de success check */
@keyframes check-draw {
  0% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.check-draw,
.animate-check-draw {
  stroke-dasharray: 100;
  animation: check-draw 0.6s ease-out forwards;
}

/* Cercle de succès animé */
@keyframes success-circle-draw {
  0% {
    stroke-dashoffset: 63;
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

.success-circle-anim {
  stroke-dasharray: 63;
  animation: success-circle-draw 0.6s ease-out forwards;
}

/* Check de succès animé */
@keyframes success-check-draw {
  0% {
    stroke-dashoffset: 20;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.success-check-anim {
  stroke-dasharray: 20;
  animation: success-check-draw 0.4s ease-out 0.3s forwards;
  stroke-dashoffset: 20;
}

/* Container de succès */
.success-animation {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease-out;
}

.success-animation.success-show {
  opacity: 1;
  transform: scale(1);
}

.success-animation.success-hide {
  opacity: 0;
  transform: scale(0.8);
}

.success-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #34D399 0%, #10B981 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
  animation: success-pop 0.5s ease-out;
}

@keyframes success-pop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.success-message {
  margin-top: 16px;
  font-size: 18px;
  font-weight: 600;
  color: #10B981;
  animation: fade-in 0.3s ease-out 0.3s forwards;
  opacity: 0;
}

/* ========================================
   ANIMATIONS DE CÉLÉBRATION - CONFETTI
   ======================================== */

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.confetti-particle {
  will-change: transform, opacity;
}

/* ========================================
   ANIMATIONS DE CÉLÉBRATION - FIREWORKS
   ======================================== */

@keyframes firework-burst {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform:
      translate(
        calc(cos(var(--angle)) * var(--distance)),
        calc(sin(var(--angle)) * var(--distance))
      )
      scale(0);
    opacity: 0;
  }
}

.firework-particle {
  will-change: transform, opacity;
}

/* ========================================
   ANIMATIONS DE CÉLÉBRATION - STARS
   ======================================== */

@keyframes star-fall {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
    opacity: 1;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg) scale(0.5);
    opacity: 0;
  }
}

.celebration-star {
  will-change: transform, opacity;
}

/* ========================================
   ANIMATIONS DE CÉLÉBRATION - SPARKLE
   ======================================== */

@keyframes sparkle-burst {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(0deg);
    opacity: 1;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform:
      translate(
        calc(-50% + cos(var(--angle)) * var(--distance)),
        calc(-50% + sin(var(--angle)) * var(--distance))
      )
      scale(1)
      rotate(180deg);
    opacity: 0;
  }
}

.sparkle-particle {
  will-change: transform, opacity;
}

/* ========================================
   ANIMATIONS DE TOAST
   ======================================== */

@keyframes toast-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toast-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.animate-toast-in {
  animation: toast-in 0.3s ease-out forwards;
}

.animate-toast-out {
  animation: toast-out 0.3s ease-out forwards;
}

/* ========================================
   ANIMATIONS DE PAGE TRANSITION
   ======================================== */

@keyframes page-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-page-in {
  animation: page-fade-in 0.3s ease-out;
}

/* ========================================
   ANIMATIONS DE SKELETON LOADER
   ======================================== */

@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-shimmer {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.06) 25%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(0, 0, 0, 0.06) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

/* ========================================
   ANIMATIONS DE TABLE
   ======================================== */

@keyframes table-row-enter {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.table-row-enter {
  animation: table-row-enter 0.2s ease-out;
}

@keyframes table-row-highlight {
  0%, 100% {
    background-color: transparent;
  }
  50% {
    background-color: rgba(167, 139, 250, 0.1);
  }
}

.table-row-highlight {
  animation: table-row-highlight 1s ease-in-out;
}

/* ========================================
   ANIMATIONS DE FOCUS
   ======================================== */

@keyframes focus-ring-pulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.2);
  }
}

.focus-ring-animated:focus {
  animation: focus-ring-pulse 1.5s ease-in-out infinite;
  outline: none;
}

/* ========================================
   ANIMATIONS DE COMPTEUR
   ======================================== */

@keyframes counter-pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.counter-pop {
  animation: counter-pop 0.3s ease-out;
}

/* ========================================
   ANIMATIONS DE BADGE/NOTIFICATION
   ======================================== */

@keyframes badge-bounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.badge-animated {
  animation: badge-bounce 0.5s ease-out;
}

@keyframes notification-dot-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }
}

.notification-dot-pulse {
  animation: notification-dot-pulse 2s ease-in-out infinite;
}

/* ========================================
   ANIMATIONS DE PROGRESS BAR
   ======================================== */

@keyframes progress-stripes {
  from {
    background-position: 1rem 0;
  }
  to {
    background-position: 0 0;
  }
}

.progress-striped {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
  animation: progress-stripes 1s linear infinite;
}

@keyframes progress-glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(167, 139, 250, 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(167, 139, 250, 0.5);
  }
}

.progress-glow {
  animation: progress-glow 2s ease-in-out infinite;
}

/* ========================================
   ANIMATIONS DE HOVER AVANCÉES
   ======================================== */

/* Effet de lift au survol */
.hover-lift {
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Effet de scale au survol */
.hover-scale {
  transition: transform 0.2s ease-out;
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* Effet de rotate au survol */
.hover-rotate {
  transition: transform 0.3s ease-out;
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

/* ========================================
   PREFERENCES UTILISATEUR
   ======================================== */

/* Respecter les préférences de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* ========================================
   DRAG & DROP STYLES POUR LAW BEE
   ======================================== */

/* ========================================
   ÉTATS GLOBAUX
   ======================================== */

/* Curseur pendant le drag */
body.is-dragging,
body.is-dragging * {
  cursor: grabbing !important;
}

body.is-dragging-widget {
  cursor: move !important;
}

/* Désactiver la sélection de texte pendant le drag */
body.is-dragging,
body.is-dragging-widget {
  user-select: none;
}

/* ========================================
   SORTABLE LIST
   ======================================== */

/* Ghost (placeholder) */
.sortable-ghost {
  opacity: 0.4;
  background: rgba(167, 139, 250, 0.1) !important;
  border: 2px dashed rgba(167, 139, 250, 0.5) !important;
  border-radius: 8px;
}

/* Item choisi (en cours de drag) */
.sortable-chosen {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  transform: rotate(2deg);
  z-index: 1000;
}

/* Item en cours de drag */
.sortable-drag {
  opacity: 1 !important;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

/* Conteneur actif */
.sortable-container-active {
  background: rgba(167, 139, 250, 0.03);
  border-color: rgba(167, 139, 250, 0.3) !important;
}

/* État de sauvegarde */
.sortable-saving {
  opacity: 0.7;
  pointer-events: none;
}

.sortable-saving::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* État sauvegardé */
.sortable-saved {
  animation: sortable-saved-flash 0.5s ease-out;
}

@keyframes sortable-saved-flash {
  0%, 100% {
    background-color: inherit;
  }
  50% {
    background-color: rgba(52, 211, 153, 0.1);
  }
}

/* ========================================
   KANBAN STYLES
   ======================================== */

.kanban-ghost {
  opacity: 0.4;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.1) 0%, rgba(167, 139, 250, 0.05) 100%) !important;
  border: 2px dashed rgba(167, 139, 250, 0.4) !important;
  border-radius: 12px;
}

.kanban-chosen {
  transform: rotate(3deg) scale(1.02);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  z-index: 1000;
}

.kanban-drag {
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
}

body.kanban-dragging .kanban-column-active {
  background: rgba(167, 139, 250, 0.05);
  border-color: rgba(167, 139, 250, 0.3);
  transition: all 0.2s ease;
}

/* Drop indicator */
.kanban-column-active::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 2px dashed rgba(167, 139, 250, 0.3);
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  animation: pulse-border 1s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}

/* ========================================
   GRID (WIDGETS DASHBOARD)
   ======================================== */

.grid-ghost {
  opacity: 0.3;
  background: rgba(167, 139, 250, 0.1) !important;
  border: 2px dashed rgba(167, 139, 250, 0.5) !important;
  border-radius: 16px;
}

.grid-chosen {
  transform: scale(1.02);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  z-index: 1000;
}

.grid-drag {
  opacity: 1 !important;
}

.grid-dragging {
  background: rgba(167, 139, 250, 0.02);
}

.grid-potential-drop {
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.8;
  transform: scale(0.98);
}

.grid-dropped {
  animation: grid-drop-confirm 0.5s ease-out;
}

@keyframes grid-drop-confirm {
  0% {
    transform: scale(1.05);
    box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.3);
  }
  100% {
    transform: scale(1);
    box-shadow: none;
  }
}

/* Handle de widget */
.widget-handle {
  cursor: grab;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.widget-handle:hover {
  opacity: 1;
}

.widget-handle:active {
  cursor: grabbing;
}

/* ========================================
   DRAG SELECT (RECTANGLE SELECTION)
   ======================================== */

.drag-select-box {
  position: fixed;
  border: 2px solid rgba(167, 139, 250, 0.8);
  background: rgba(167, 139, 250, 0.1);
  border-radius: 4px;
  pointer-events: none;
  z-index: 9999;
}

.drag-selecting {
  cursor: crosshair;
}

/* Item sélectionné */
.drag-selected {
  outline: 2px solid rgba(167, 139, 250, 0.8);
  outline-offset: 2px;
  background: rgba(167, 139, 250, 0.05);
}

/* Animation de sélection */
.drag-selected {
  animation: selection-appear 0.15s ease-out;
}

@keyframes selection-appear {
  from {
    outline-offset: 8px;
    outline-color: transparent;
  }
  to {
    outline-offset: 2px;
    outline-color: rgba(167, 139, 250, 0.8);
  }
}

/* ========================================
   UPLOAD DROPZONE
   ======================================== */

.dropzone {
  transition: all 0.3s ease;
}

.dropzone-active,
.dropzone.dragover {
  border-color: rgba(167, 139, 250, 0.8) !important;
  background: rgba(167, 139, 250, 0.05) !important;
  transform: scale(1.01);
}

.dropzone-active::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at center, rgba(167, 139, 250, 0.1) 0%, transparent 70%);
  animation: dropzone-pulse 1.5s ease-in-out infinite;
}

@keyframes dropzone-pulse {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* ========================================
   TABLE ROW DRAG
   ======================================== */

tr.sortable-ghost {
  background: rgba(167, 139, 250, 0.1) !important;
}

tr.sortable-chosen {
  background: white !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

tr.sortable-chosen td {
  background: inherit;
}

/* ========================================
   DRAG HANDLE ICON
   ======================================== */

.drag-handle {
  cursor: grab;
  color: var(--color-muted, #94a3b8);
  opacity: 0.5;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.drag-handle:hover {
  opacity: 1;
  color: var(--color-violet, #a78bfa);
}

.drag-handle:active {
  cursor: grabbing;
}

/* Icône standard de drag (6 points) */
.drag-handle-icon {
  width: 16px;
  height: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
}

.drag-handle-icon::before,
.drag-handle-icon::after {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow:
    6px 0 0 currentColor,
    0 6px 0 currentColor,
    6px 6px 0 currentColor,
    0 12px 0 currentColor,
    6px 12px 0 currentColor;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  /* Sur mobile, les handles doivent être plus grands */
  .drag-handle,
  .widget-handle {
    padding: 12px;
    touch-action: none;
  }

  /* Désactiver la sélection par rectangle sur mobile */
  .drag-select-box {
    display: none !important;
  }
}

/* ========================================
   PREFERENCES
   ======================================== */

/* Respecter les préférences de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  .sortable-ghost,
  .sortable-chosen,
  .kanban-ghost,
  .kanban-chosen,
  .grid-ghost,
  .grid-chosen,
  .drag-selected {
    animation: none;
    transition: none;
  }
}
/*
 * Styles pour les tableaux avancés
 * - Vues compacte/normale/étendue
 * - En-têtes triables animés
 * - Toolbar fixe pour actions groupées
 * - Animations de tri et filtrage
 */

/* ==================== VUES DE TABLEAU ==================== */

/* Vue compacte - Densité maximale */
.table-compact tbody tr {
  @apply text-xs;
}

.table-compact tbody td {
  @apply py-1 px-2;
}

.table-compact thead th {
  @apply py-2 px-2 text-[10px];
}

/* Vue normale - Par défaut */
.table-normal tbody tr {
  @apply text-sm;
}

.table-normal tbody td {
  @apply py-3 px-4;
}

.table-normal thead th {
  @apply py-3 px-4 text-xs;
}

/* Vue étendue - Plus d'espace */
.table-expanded tbody tr {
  @apply text-base;
}

.table-expanded tbody td {
  @apply py-4 px-5;
}

.table-expanded thead th {
  @apply py-4 px-5 text-sm;
}

/* ==================== EN-TÊTES TRIABLES ==================== */

.sortable-header {
  @apply cursor-pointer select-none transition-colors duration-150;
  @apply hover:bg-lawbee-violet/5;
}

.sortable-header:hover .sort-icon {
  @apply opacity-50;
}

.sortable-header.active .sort-icon {
  @apply opacity-100 text-lawbee-violet;
}

.sort-icon {
  @apply inline-flex items-center ml-1 opacity-0 transition-all duration-200;
}

.sort-icon svg {
  @apply w-3 h-3;
}

/* Animation de rotation pour l'icône de tri */
.sort-icon.asc svg {
  animation: sortBounce 0.3s ease-out;
}

.sort-icon.desc svg {
  animation: sortBounce 0.3s ease-out;
  transform: rotate(180deg);
}

@keyframes sortBounce {
  0% { transform: scale(0.8) translateY(4px); opacity: 0; }
  50% { transform: scale(1.1) translateY(-2px); }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* ==================== TOOLBAR FIXE ==================== */

.bulk-toolbar-fixed {
  @apply fixed bottom-0 left-0 right-0 z-40;
  @apply bg-lawbee-surface border-t border-lawbee-border shadow-lg;
  @apply transform transition-transform duration-300 ease-out;
  @apply translate-y-full;
}

.bulk-toolbar-fixed.visible {
  @apply translate-y-0;
}

/* Compensation pour sidebar admin */
@media (min-width: 1024px) {
  .bulk-toolbar-fixed {
    left: 16rem; /* w-64 = 256px = 16rem */
  }
}

.bulk-toolbar-content {
  @apply max-w-7xl mx-auto px-4 py-3;
  @apply flex items-center justify-between gap-4;
}

.bulk-toolbar-count {
  @apply flex items-center gap-2 text-sm font-medium;
}

.bulk-toolbar-count .count-badge {
  @apply inline-flex items-center justify-center min-w-[24px] h-6 px-2;
  @apply rounded-full bg-lawbee-violet text-white text-xs font-bold;
}

.bulk-toolbar-actions {
  @apply flex items-center gap-2;
}

.bulk-toolbar-actions button {
  @apply inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-lg;
  @apply transition-colors duration-150;
}

.bulk-toolbar-actions .btn-action {
  @apply bg-lawbee-bg text-lawbee-ink hover:bg-lawbee-violet/10 hover:text-lawbee-violet;
}

.bulk-toolbar-actions .btn-danger {
  @apply bg-red-50 text-red-600 hover:bg-red-100;
}

/* Dark mode */
.dark .bulk-toolbar-fixed {
  @apply bg-slate-800 border-slate-700;
}

.dark .bulk-toolbar-actions .btn-action {
  @apply bg-slate-700 text-slate-200 hover:bg-lawbee-violet/20;
}

.dark .bulk-toolbar-actions .btn-danger {
  @apply bg-red-900/30 text-red-400 hover:bg-red-900/50;
}

/* ==================== ANIMATIONS DE LIGNES ==================== */

/* Animation d'entrée pour nouvelles lignes */
.table-row-enter {
  animation: rowEnter 0.3s ease-out;
}

@keyframes rowEnter {
  0% {
    opacity: 0;
    transform: translateX(-10px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Animation de suppression */
.table-row-exit {
  animation: rowExit 0.2s ease-in forwards;
}

@keyframes rowExit {
  0% {
    opacity: 1;
    transform: translateX(0);
    max-height: 100px;
  }
  100% {
    opacity: 0;
    transform: translateX(20px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* Animation de tri */
.table-row-sorting {
  animation: rowSort 0.2s ease-out;
}

@keyframes rowSort {
  0% {
    opacity: 0.5;
    transform: translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== TOGGLE DE VUE ==================== */

.view-toggle {
  @apply inline-flex items-center p-0.5 rounded-lg bg-lawbee-bg;
  @apply border border-lawbee-border;
}

.view-toggle button {
  @apply px-2 py-1 text-xs font-medium rounded-md;
  @apply transition-all duration-150;
}

.view-toggle button[data-active="true"] {
  @apply bg-lawbee-violet text-white shadow-sm;
}

.view-toggle button[data-active="false"] {
  @apply text-lawbee-muted hover:text-lawbee-ink;
}

/* Icônes du toggle */
.view-toggle svg {
  @apply w-4 h-4;
}

/* ==================== FILTRES ACTIFS ==================== */

.active-filters {
  @apply flex flex-wrap items-center gap-2 mt-3;
}

.active-filter-tag {
  @apply inline-flex items-center gap-1 px-2 py-0.5;
  @apply text-xs font-medium rounded-full;
  @apply bg-lawbee-violet/10 text-lawbee-violet;
  @apply border border-lawbee-violet/20;
}

.active-filter-tag button {
  @apply ml-1 hover:text-red-500 transition-colors;
}

/* ==================== RECHERCHES RÉCENTES ==================== */

.recent-searches-dropdown {
  @apply absolute top-full left-0 right-0 mt-1 z-20;
  @apply bg-lawbee-surface rounded-lg shadow-lg border border-lawbee-border;
  @apply p-3;
}

.dark .recent-searches-dropdown {
  @apply bg-slate-800 border-slate-700;
}

/* ==================== SÉLECTION DE LIGNES ==================== */

tbody tr.selected {
  @apply bg-lawbee-violet/5;
}

tbody tr.selected td:first-child {
  @apply relative;
}

tbody tr.selected td:first-child::before {
  content: "";
  @apply absolute left-0 top-0 bottom-0 w-0.5 bg-lawbee-violet;
}

/* Checkbox avec animation */
.row-checkbox {
  @apply w-4 h-4 rounded border-lawbee-border;
  @apply text-lawbee-violet focus:ring-lawbee-violet focus:ring-offset-0;
  @apply transition-all duration-150;
}

.row-checkbox:checked {
  animation: checkBounce 0.2s ease-out;
}

@keyframes checkBounce {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ==================== ÉTATS VIDES ==================== */

.table-empty-state {
  @apply py-12 text-center;
}

.table-empty-state svg {
  @apply w-12 h-12 mx-auto text-lawbee-muted/50 mb-4;
}

.table-empty-state h3 {
  @apply text-lg font-medium text-lawbee-ink mb-1;
}

.table-empty-state p {
  @apply text-sm text-lawbee-muted;
}

/* ==================== RESPONSIVE ==================== */

/* Sur mobile, masquer certaines colonnes */
@media (max-width: 640px) {
  .table-hide-mobile {
    @apply hidden;
  }
}

@media (max-width: 768px) {
  .table-hide-tablet {
    @apply hidden;
  }
}

/* Scroll horizontal pour les tableaux larges */
.table-wrapper {
  @apply overflow-x-auto -mx-4 px-4;
  scrollbar-width: thin;
  scrollbar-color: theme('colors.lawbee.border') transparent;
}

.table-wrapper::-webkit-scrollbar {
  height: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.table-wrapper::-webkit-scrollbar-thumb {
  @apply bg-lawbee-border rounded-full;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
  @apply bg-lawbee-muted/50;
}

/* ==================== COLONNES REDIMENSIONNABLES ==================== */

/* État de redimensionnement */
table.resizing {
  cursor: col-resize !important;
  user-select: none;
}

table.resizing * {
  cursor: col-resize !important;
}

/* En-tête redimensionnable */
th[data-resizable="true"] {
  position: relative;
}

th[data-resizable="true"]:hover {
  @apply bg-lawbee-violet/5;
}

th.resizing {
  @apply bg-lawbee-violet/10;
}

/* Poignée de redimensionnement */
.column-resizer {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  z-index: 10;
}

.column-resizer:hover .column-resizer-handle,
th.resizing .column-resizer-handle {
  background-color: var(--lawbee-violet, #A78BFA) !important;
}

/* ==================== GROUPEMENT DE LIGNES ==================== */

/* En-tête de groupe */
.group-header-row {
  @apply bg-lawbee-bg/80 dark:bg-slate-900/80;
  @apply sticky top-0 z-10;
}

.group-header-row:hover {
  @apply bg-lawbee-violet/5;
}

/* Animation du chevron */
.group-header-row svg {
  transition: transform 0.2s ease-out;
}

/* Lignes du groupe - animation d'apparition */
tr[data-group] {
  animation: groupRowEnter 0.2s ease-out;
}

@keyframes groupRowEnter {
  0% {
    opacity: 0;
    transform: translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Indentation visuelle pour les lignes groupées */
tr[data-group] td:first-child {
  @apply pl-8;
}

/* Badge de comptage */
.group-header-row .count-badge {
  @apply inline-flex items-center justify-center min-w-[20px] h-5 px-1.5;
  @apply rounded-full bg-lawbee-violet/10 text-lawbee-violet text-xs font-medium;
}

/* ==================== EXPORT MODAL ==================== */

/* Animation d'entrée de la modal */
[data-table-export-target="modal"] {
  animation: modalEnter 0.2s ease-out;
}

@keyframes modalEnter {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

[data-table-export-target="modal"] > div:last-child {
  animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Sélection de format */
[data-table-export-target="modal"] label:has(input:checked) {
  @apply border-lawbee-violet bg-lawbee-violet/5;
}

/* ==================== RACCOURCIS CLAVIER HIGHLIGHT ==================== */

/* Ligne active via navigation clavier */
tr.keyboard-active {
  @apply ring-2 ring-lawbee-violet ring-inset;
}

/* Aide raccourcis */
#table-shortcuts-help kbd {
  @apply px-1.5 py-0.5 rounded bg-lawbee-bg border border-lawbee-border;
  @apply text-[10px] font-mono text-lawbee-muted;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
