/* ============================================================================
   [ADDED - RTL] دعم العربية في المحتوى النصي للدردشة
   ----------------------------------------------------------------------------
   الهدف: تصحيح اتجاه النصوص (رسائل الغرفة/الخاص/التعليقات/القوائم) وقلب صف
   الرسالة نفسه (الأفاتار يميناً) دون المساس بالأشرطة والأزرار الهيكلية
   حتى لا تنعكس الواجهة كلها أو تتعطل التصاميم الحالية (Nopta / Uireta / الافتراضي).

   القواعد:
   - نصوص المحتوى: direction: rtl + text-align: right + unicode-bidi: plaintext
   - الأرقام/التواريخ تبقى LTR.
   - قلب صف الرسالة محصور في .d2 (الغرفة والخاص) فقط.
   - لا نلمس الحائط/الريشة عند تفعيل تصميم Nopta (body.wl) لأنه يضبط محاذاته.
   - لا نغيّر direction على الحاويات الهيكلية (#d0، .tablebox، .broadcasters).
   ============================================================================ */

/* 1) نص رسائل الغرفة والخاص */
.d2 .u-msg {
  direction: rtl !important;
  text-align: right !important;
  unicode-bidi: plaintext;
}

/* 2) صف الرسالة: الأفاتار يمين والمحتوى يساره — داخل الرسائل فقط
   (لا نلمس صفوف الحائط/الريشة ولا الأشرطة الهيكلية) */
.d2 > .uzr.mm.d-flex {
  direction: rtl;
  padding-right: 2px;
}
/* Uireta: الأفاتار انتقل إلى اليمين، لذا تُقلب استدارة الزاوية اليسرى */
html body.uireta-on:not(#uq) #d2 .uzr.d-flex:not(.hmsg) > .u-pic:not([style*="border-radius"]) {
  border-radius: 0 14px 14px 0 !important;
}

/* رأس الرسالة: الاسم يمين والوقت يسار (داخل الرأس فقط) */
.d2 .uzr.flex-fill.break > .d-flex:not(.fr) {
  direction: rtl;
}
.d2 .u-topic {
  direction: rtl !important;
  text-align: right !important;
  unicode-bidi: plaintext;
}
.d2 .tago {
  direction: ltr !important;
  unicode-bidi: embed !important;
}

/* 3) أزرار الرسالة (رد/حذف...) تنتقل لليسار مع اتجاه النص */
.d2 .u-msg > .d-flex.fr {
  float: left !important;
}

/* 4) اقتباس الرد */
.d2 .u-rply .grid-container {
  direction: rtl !important;
  text-align: right !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  border-left: 0 !important;
  border-right: 4px solid cornflowerblue !important;
}
.d2 .u-rply .item3,
.d2 .u-rply .item5 {
  text-align: right !important;
}

/* 5) تعليقات الحائط / نافذة التعليقات */
#cooment .comentmsg,
#cooment .comentmsg span,
#rmsg .u-msg {
  direction: rtl;
  text-align: right;
  unicode-bidi: plaintext;
}
#cooment .comentmsg .tago {
  direction: ltr;
  unicode-bidi: embed;
}

/* 6) قائمة المتصلين والغرف والخاص في الوضع الافتراضي (Nopta يضبطها بالفعل) */
body:not(.ul) #users .u-msg,
body:not(.ul) #rooms .u-msg,
body:not(.ul) #chats .u-msg {
  direction: rtl !important;
  text-align: right !important;
  unicode-bidi: plaintext;
}
body:not(.ul) #users .u-topic,
body:not(.ul) #rooms .u-topic,
body:not(.ul) #chats .u-topic {
  direction: rtl;
  text-align: right;
}

/* 7) الحائط في الوضع الافتراضي فقط (تصميم Nopta يضبط محاذاته) */
body:not(.wl) #d2bc .u-msg {
  direction: rtl !important;
  text-align: right !important;
  unicode-bidi: plaintext;
}
body:not(.wl) #d2bc .uzr.flex-fill.break > .d-flex:not(.fr) {
  direction: rtl;
}

/* 8) الإشعارات */
#wetchprofilenotifi .notification,
#wetchprofilenotifi .notification__message,
#wetchprofilenotifi .notification__sender__name {
  direction: rtl;
  text-align: right;
  unicode-bidi: plaintext;
}

/* 9) بروفايل العضو */
#upro .u-msg {
  direction: rtl !important;
  text-align: right !important;
  unicode-bidi: plaintext;
}

/* 10) قوائم مبدع الحائط/نجم XO */
#top10 .wt-nm,
#xotop .xs-nm {
  direction: rtl;
  text-align: right !important;
}
