/*
 * Surcharges RTL pour la version arabe du site.
 * Chargé uniquement quand <html dir="rtl">. Le CDN Tailwind injecte ses
 * propres règles dynamiquement (spécificité (0,3,0) pour les utilitaires
 * "space-x-*"), donc les overrides ci-dessous utilisent !important pour
 * garantir qu'ils l'emportent quel que soit l'ordre d'insertion.
 */

[dir="rtl"] {
    text-align: right;
}

/* Tailwind space-x-* utilise --tw-space-x-reverse : on l'inverse en RTL */
[dir="rtl"] [class*="space-x-"] > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 1 !important;
}

/* Icônes/texte avec marge avant (mr-*) doivent passer après le texte en RTL */
[dir="rtl"] .mr-1 { margin-right: 0 !important; margin-left: 0.25rem !important; }
[dir="rtl"] .mr-2 { margin-right: 0 !important; margin-left: 0.5rem !important; }
[dir="rtl"] .mr-3 { margin-right: 0 !important; margin-left: 0.75rem !important; }
[dir="rtl"] .ml-1 { margin-left: 0 !important; margin-right: 0.25rem !important; }
[dir="rtl"] .ml-2 { margin-left: 0 !important; margin-right: 0.5rem !important; }
[dir="rtl"] .ml-3 { margin-left: 0 !important; margin-right: 0.75rem !important; }

/* Alignements de texte explicites */
[dir="rtl"] .text-left { text-align: right !important; }
[dir="rtl"] .text-right { text-align: left !important; }

/* Icônes positionnées en absolu dans les champs de formulaire (login, inscription...) */
[dir="rtl"] .pl-10 { padding-left: 1rem !important; padding-right: 2.5rem !important; }
[dir="rtl"] .absolute.left-0 { left: auto !important; right: 0 !important; }
[dir="rtl"] .absolute.right-0 { right: auto !important; left: 0 !important; }

/* Listes à puces */
[dir="rtl"] ol,
[dir="rtl"] ul.list-disc,
[dir="rtl"] ol.list-decimal {
    padding-right: 1.25rem;
    padding-left: 0;
}

/* Bordures directionnelles des encarts d'alerte (border-l-4) */
[dir="rtl"] .border-l-4 { border-left-width: 0 !important; border-right-width: 4px !important; }

/* Icônes directionnelles (flèches, chevrons) : miroir visuel en RTL */
[dir="rtl"] [data-lucide="arrow-right"],
[dir="rtl"] [data-lucide="arrow-left"],
[dir="rtl"] [data-lucide="chevron-right"],
[dir="rtl"] [data-lucide="chevron-left"] {
    transform: scaleX(-1);
}
