/* ============================================================
   YouTube Search Modal — استايل يوتيوب للنافذة المنبثقة
   ============================================================ */

.yt-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.72);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.yt-modal-box {
  width: 100%;
  max-width: 480px;
  max-height: 82vh;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  direction: rtl;
  font-family: inherit;
}

/* ---------- Header ---------- */
.yt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #ff0000, #cc0000);
  color: #fff;
  flex-shrink: 0;
}

.yt-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
}

.yt-modal-title i {
  font-size: 20px;
}

.yt-modal-close {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.yt-modal-close:hover {
  background: rgba(255, 255, 255, 0.32);
  transform: rotate(90deg);
}

/* ---------- Body / list ---------- */
.yt-modal-body {
  overflow-y: auto;
  padding: 8px;
  background: #fafafa;
}

.yt-modal-body::-webkit-scrollbar {
  width: 8px;
}
.yt-modal-body::-webkit-scrollbar-track {
  background: transparent;
}
.yt-modal-body::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 8px;
}
.yt-modal-body::-webkit-scrollbar-thumb:hover {
  background: #b5b5b5;
}

.yt-modal-empty {
  text-align: center;
  padding: 30px 10px;
  color: #777;
  font-size: 14px;
}

/* ---------- Video item card ---------- */
.yt-video-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.yt-video-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.yt-video-item:last-child {
  margin-bottom: 0;
}

.yt-video-thumb-wrap {
  position: relative;
  flex-shrink: 0;
  width: 110px;
  height: 62px;
  border-radius: 8px;
  overflow: hidden;
  background: #eee;
}

.yt-video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.yt-video-duration {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.yt-video-info {
  flex: 1;
  min-width: 0;
}

.yt-video-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #0f0f0f;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.yt-send-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  background: #ff0000;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.1s ease;
}

.yt-send-btn:hover {
  background: #d90000;
}

.yt-send-btn:active {
  transform: scale(0.95);
}

.yt-send-btn i {
  font-size: 12px;
}

/* ============================================================
   Room YouTube search box (opened from the "..." menu)
   ============================================================ */
.yt-modal-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.yt-modal-search-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 13px;
  outline: none;
  text-align: right;
  transition: border-color 0.15s ease;
}

.yt-modal-search-input:focus {
  border-color: #ff0000;
}

.yt-modal-search-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #ff0000;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}

.yt-modal-search-btn:hover {
  background: #d90000;
}

.yt-modal-search-btn:active {
  transform: scale(0.92);
}

.yt-modal-loading {
  text-align: center;
  padding: 34px 10px;
  color: #777;
  font-size: 13px;
}

.yt-modal-loading i {
  font-size: 26px;
  color: #ff0000;
  margin-bottom: 8px;
  display: block;
}

/* ============================================================
   Room "..." menu buttons — unified look
   [UPDATED] اليوتيوب طلع من هنا لبرا (بقى زرار مباشر جوه الشريط، شوف
   .roomYoutubeBtn في bottom-toolbar.css)، والريكورد كمان طلع برا وبقى
   جنب زرار التلات نقط مباشرة (.roomRecordBtn في bottom-toolbar.css).
   بدالهم دخل زرار "خروج من الغرفة" (roomExitBtn) هنا جوه القايمة.
   ============================================================ */
.roomMediaMenu {
  display: flex;
  gap: 2px;
}

.roomMediaMenu button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.roomMediaMenu button:active {
  transform: scale(0.92);
}

.roomExitBtn {
  color: #e74c3c !important;
}

.roomExitBtn:hover {
  background: rgba(231, 76, 60, 0.14) !important;
}

/* ============================================================
   Voice recording bar (replaces the toolbar while recording)
   ============================================================ */
.roomVoiceBar {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  background: rgb(170, 170, 175);
  border-radius: 4px;
  padding: 0 8px;
  z-index: 20;
}

.roomVoiceBarInner {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
}

.roomVoiceCancel,
.roomVoiceSend {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-size: 14px;
  transition: transform 0.1s ease, background 0.15s ease;
}

.roomVoiceCancel:active,
.roomVoiceSend:active {
  transform: scale(0.9);
}

.roomVoiceCancel {
  background: #e53e3e;
}

.roomVoiceCancel:hover {
  background: #c53030;
}

.roomVoiceSend {
  background: var(--theme-btcolor, #337ab7);
}

.roomVoiceRecIcon {
  flex-shrink: 0;
  color: #e53e3e;
  font-size: 12px;
}

.roomVoiceWave {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 24px;
  min-width: 40px;
}

.roomVoiceWave span {
  width: 4px;
  border-radius: 3px;
  background: var(--theme-btcolor, #e53e3e);
  height: 30%;
}

.roomVoiceTimer {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: #222;
  min-width: 38px;
  text-align: center;
  direction: ltr;
}

/* ============================================================
   Voice message bubble in chat (nice player, matches theme)
   ============================================================ */
.voiceMsg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--theme-btcolor, #4a5568), var(--theme-hicolor, #2d3748));
  color: #fff;
  padding: 6px 14px 6px 6px;
  border-radius: 22px;
  max-width: 220px;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  margin: 3px 0;
  direction: ltr;
}

.voiceMsgPlay {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.voiceMsgPlay:hover {
  background: rgba(255, 255, 255, 0.4);
}

.voiceMsgWave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 18px;
  flex: 1;
  min-width: 55px;
}

.voiceMsgWave span {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.5);
  height: 35%;
}

.voiceMsgWave span:nth-child(3n) { height: 100%; }
.voiceMsgWave span:nth-child(2n) { height: 65%; }

.voiceMsg.playing .voiceMsgWave span { background: #fff; }

.voiceMsgTime {
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 30px;
  text-align: center;
}

/* ============================================================
   رسالة نظام (تم حذف الرسالة/الرسائل من قبل فلان)
   ============================================================ */
.roomSystemNotice {
  text-align: center !important;
  justify-content: center;
  background: rgba(0, 0, 0, 0.035) !important;
  border-radius: 12px;
  font-size: 12px;
  color: #888;
  padding: 4px 10px !important;
  margin: 4px auto !important;
  max-width: fit-content;
}

.roomSystemNotice .u-msg {
  color: #888 !important;
  font-size: 12px !important;
}

.roomSystemNotice .u-topic,
.roomSystemNotice .u-pic,
.roomSystemNotice .u-ico {
  display: none !important;
}

/* ============================================================
   رسائل النظام (دخول / انتقال / مغادرة / تسجيل خروج)
   ============================================================ */
.sysNotice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 600;
  direction: rtl;
  line-height: 1.6;
}

.sysNotice i {
  font-size: 12px;
  flex-shrink: 0;
}

.sysNotice-join {
  background: rgba(46, 160, 67, 0.12);
  color: #1f8b3a;
}

.sysNotice-leave {
  background: rgba(130, 130, 130, 0.15);
  color: #6b6b6b;
}

.sysNotice-logout {
  background: rgba(229, 62, 62, 0.12);
  color: #c53030;
}

.sysNoticeText {
  white-space: nowrap;
}

.sysNoticeRoomBtn {
  display: inline-block;
  background: var(--theme-btcolor, #337ab7);
  color: #fff !important;
  padding: 2px 12px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.sysNoticeRoomBtn:hover {
  opacity: 0.85;
}

.sysNoticeRoomBtn:active {
  transform: scale(0.95);
}

/* ============================================================
   أزرار تفاعل الرسالة (إعجاب / رد / حذف) - العام والحائط
   ============================================================ */
.msgActions {
  gap: 3px;
}

.msgActionBtn {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.045);
  color: #999;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  margin: 0 !important;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.msgActionBtn:hover {
  transform: scale(1.1);
}

.msgActionBtn:active {
  transform: scale(0.9);
}

.msgActionBtn-like:hover,
.msgActionBtn-like.liked {
  background: rgba(229, 62, 62, 0.14);
  color: #e53e3e;
}

.msgActionBtn-reply:hover {
  background: rgba(51, 122, 183, 0.14);
  color: var(--theme-btcolor, #337ab7);
}

.msgActionBtn-del:hover {
  background: rgba(229, 62, 62, 0.14);
  color: #e53e3e;
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
  .yt-modal-overlay {
    padding: 0;
  }
  .yt-modal-box {
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
  }
  .yt-video-thumb-wrap {
    width: 90px;
    height: 52px;
  }
  .yt-video-title {
    font-size: 12px;
  }
  .sysNoticeRoomBtn {
    max-width: 110px;
  }
}
