/*! BS Email Platform — Forms RTL overrides (v1.0.0)
   NOTE: هذه الملف يحتوي على تعديلات RTL فقط — يجب أن يُحمَّل بعد bs-em-forms.css
*/

/* تشغيل RTL داخل نموذج الإضافة فقط */
html[dir="rtl"] .bs-em-form,
body.rtl .bs-em-form {
  direction: rtl;
  unicode-bidi: isolate-override;
  text-align: right;
}

/* عناوين الحقول */
html[dir="rtl"] .bs-em-form .bs-em-field label,
body.rtl .bs-em-form .bs-em-field label {
  text-align: right;
  line-height: 40px;
}

/* الحواشي والملاحظات */
html[dir="rtl"] .bs-em-form .bs-em-help,
body.rtl .bs-em-form .bs-em-help {
  text-align: right;
}

/* الرسائل (خطأ/نجاح/تنبيه) */
html[dir="rtl"] .bs-em-form .bs-em-error,
body.rtl .bs-em-form .bs-em-error,
html[dir="rtl"] .bs-em-form .bs-em-success,
body.rtl .bs-em-form .bs-em-success,
html[dir="rtl"] .bs-em-form .bs-em-alert,
body.rtl .bs-em-form .bs-em-alert {
  text-align: right;
}

/* محاذاة الإجراءات (الأزرار) */
html[dir="rtl"] .bs-em-form .bs-em-actions,
body.rtl .bs-em-form .bs-em-actions {
  justify-content: flex-start; /* في RTL: الأساسي يظهر يسار */
}

/* مسافات داخل الحقول لما يكون في آيقونة */
html[dir="rtl"] .bs-em-form .bs-em-field.has-icon .bs-em-input,
html[dir="rtl"] .bs-em-form .bs-em-field.has-icon .bs-em-textarea,
html[dir="rtl"] .bs-em-form .bs-em-field.has-icon .bs-em-select,
body.rtl .bs-em-form .bs-em-field.has-icon .bs-em-input,
body.rtl .bs-em-form .bs-em-field.has-icon .bs-em-textarea,
body.rtl .bs-em-form .bs-em-field.has-icon .bs-em-select {
  padding-right: 2.5rem; /* مساحة للآيقونة يمين */
  padding-left: 1rem;
}

/* تموضع الآيقونة يمين */
html[dir="rtl"] .bs-em-form .bs-em-icon,
body.rtl .bs-em-form .bs-em-icon {
  right: 0.75rem;
  left: auto;
}

/* أسهم/سبينر داخل الزرار يمين */
html[dir="rtl"] .bs-em-form .bs-em-button .icon-end,
body.rtl .bs-em-form .bs-em-button .icon-end {
  margin-right: 0.5rem;
  margin-left: 0;
}

/* ترتيب الراوز (لو بتستخدم فليكس inline) */
html[dir="rtl"] .bs-em-form .bs-em-inline,
body.rtl .bs-em-form .bs-em-inline {
  flex-direction: row-reverse;
}

/* قلب الـ gaps الأفقية الشائعة */
html[dir="rtl"] .bs-em-form .gap-x-8 > * + *,
body.rtl .bs-em-form .gap-x-8 > * + * {
  margin-right: 0.5rem;
  margin-left: 0;
}

/* تشيكبوكس وسويتش: النص يمين الآيقونة */
html[dir="rtl"] .bs-em-form .bs-em-check,
body.rtl .bs-em-form .bs-em-check {
  flex-direction: row-reverse;
  text-align: right;
}

html[dir="rtl"] .bs-em-form .bs-em-check input[type="checkbox"],
body.rtl .bs-em-form .bs-em-check input[type="checkbox"],
html[dir="rtl"] .bs-em-form .bs-em-check input[type="radio"],
body.rtl .bs-em-form .bs-em-check input[type="radio"] {
  margin-left: 0.5rem;
  margin-right: 0;
}

/* لست/تاجز داخل الحقل (اختياري) */
html[dir="rtl"] .bs-em-form .bs-em-chips,
body.rtl .bs-em-form .bs-em-chips {
  direction: rtl;
}
html[dir="rtl"] .bs-em-form .bs-em-chip,
body.rtl .bs-em-form .bs-em-chip {
  margin-left: 0;
  margin-right: .375rem;
}

/* التحقق المضمن (Inline validation) */
html[dir="rtl"] .bs-em-form .bs-em-field .bs-em-inline-error,
body.rtl .bs-em-form .bs-em-field .bs-em-inline-error {
  right: 0; left: auto;
}

/* اتجاه النص داخل الحقول */
html[dir="rtl"] .bs-em-form input[type="text"],
html[dir="rtl"] .bs-em-form input[type="email"],
html[dir="rtl"] .bs-em-form input[type="tel"],
html[dir="rtl"] .bs-em-form input[type="url"],
html[dir="rtl"] .bs-em-form input[type="number"],
html[dir="rtl"] .bs-em-form textarea,
html[dir="rtl"] .bs-em-form select,
body.rtl .bs-em-form input[type="text"],
body.rtl .bs-em-form input[type="email"],
body.rtl .bs-em-form input[type="tel"],
body.rtl .bs-em-form input[type="url"],
body.rtl .bs-em-form input[type="number"],
body.rtl .bs-em-form textarea,
body.rtl .bs-em-form select {
  text-align: right;
}

/* سهم الـ select (لو مرسوم بخلفية/آيقونة يسار في الـ LTR) */
html[dir="rtl"] .bs-em-form .bs-em-select,
body.rtl .bs-em-form .bs-em-select {
  background-position: 0.75rem 50%; /* يمين في RTL */
}

/* تنسيقات الـ toast/الاشعار العائم (إن وجدت) */
html[dir="rtl"] .bs-em-toast,
body.rtl .bs-em-toast {
  right: 1rem; left: auto;
  text-align: right;
}

/* تفصيلة بسيطة للـ breadcrumb/النافيجشن داخل الفورم (إن وجدت) */
html[dir="rtl"] .bs-em-form .bs-em-breadcrumb,
body.rtl .bs-em-form .bs-em-breadcrumb {
  direction: rtl;
}
html[dir="rtl"] .bs-em-form .bs-em-breadcrumb li + li::before,
body.rtl .bs-em-form .bs-em-breadcrumb li + li::before {
  content: "‹"; /* عكس السهم */
  margin: 0 .25rem;
}

/* أيقونات SVG يمكن تعكس تلقائيًا (اختياري) */
html[dir="rtl"] .bs-em-form .flip-rtl,
body.rtl .bs-em-form .flip-rtl {
  transform: scaleX(-1);
}

/* مسافات افتراضية لليمين بدل اليسار */
html[dir="rtl"] .bs-em-form .ml-auto,
body.rtl .bs-em-form .ml-auto {
  margin-left: 0 !important;
  margin-right: auto !important;
}
html[dir="rtl"] .bs-em-form .mr-2,
body.rtl .bs-em-form .mr-2 {
  margin-right: 0 !important;
  margin-left: .5rem !important;
}