/* assets/css/rtl-override.css */

/* 1. Typographie et alignement global */
html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Kufi Arabic", "Helvetica Neue", Arial, sans-serif;
}

/* 2. Inversement des utilitaires Bootstrap LTR */
html[dir="rtl"] .text-left {
    text-align: right !important;
}

html[dir="rtl"] .text-right {
    text-align: left !important;
}

html[dir="rtl"] .float-left {
    float: right !important;
}

html[dir="rtl"] .float-right {
    float: left !important;
}

html[dir="rtl"] .mr-1, html[dir="rtl"] .mr-2, html[dir="rtl"] .mr-3 {
    margin-right: 0 !important;
}
html[dir="rtl"] .mr-1 { margin-left: 0.25rem !important; }
html[dir="rtl"] .mr-2 { margin-left: 0.5rem !important; }
html[dir="rtl"] .mr-3 { margin-left: 1rem !important; }

html[dir="rtl"] .ml-1, html[dir="rtl"] .ml-2, html[dir="rtl"] .ml-3 {
    margin-left: 0 !important;
}
html[dir="rtl"] .ml-1 { margin-right: 0.25rem !important; }
html[dir="rtl"] .ml-2 { margin-right: 0.5rem !important; }
html[dir="rtl"] .ml-3 { margin-right: 1rem !important; }

/* 3. Modales et éléments d'interaction */
html[dir="rtl"] .modal-header .close {
    margin: -1rem auto -1rem -1rem;
    float: left;
}

html[dir="rtl"] .dropdown-menu {
    text-align: right;
}

/* 4. Isolation Bidirectionnelle Stricte (BiDi Isolation) */
/* Protège les codes de licence, tokens, QR payload et ICCID contre l'inversion de caractères */
.bidi-isolate,
.activation-code,
.license-key,
.token-string,
.apn-setting-value {
    direction: ltr !important;
    unicode-bidi: isolate !important;
    text-align: left !important;
    display: inline-block;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
