/* =====================
   Toast Notifications
   ===================== */

/* الحاوية */
#toastContainer {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 360px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  margin: 0 auto;
  padding: 12px 18px;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.4s ease;
  position: relative;
  text-align: center;
  pointer-events: auto;
}

/* ألوان */
.toast.error {
  background: #ef4444;
}
.toast.success {
  background: #10b981;
}
.toast.system {
  background: #3b82f6;
}
.toast.announce {
  background: #facc15;
  color: #111;
  border: 2px solid #eab308;
  font-size: 16px;
}

/* أنيميشن دخول وخروج */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-10px) scale(0.95); }
}
.toast.fade-out {
  animation: fadeOut 0.5s forwards;
}

/* أنيميشن نبض (للإعلان) */
.toast.pulse {
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.6);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 12px 6px rgba(250, 204, 21, 0.4);
  }
}

/* =====================
   🎤 أيقونات الميكروفون
   ===================== */
.mic-icon {
  font-size: 18px;
  margin-right: 6px;
}

/* ساكت */
.mic-idle::after {
  content: "🎤";
  color: gray;
}

/* يتكلم مع إضاءة متوهجة */
.mic-speaking::after {
  content: "🎤";
  color: #e30922; /* أخضر فاتح */
  font-weight: bold;
  text-shadow: 0 0 6px rgba(34, 197, 94, 0.8),
               0 0 12px rgba(34, 197, 94, 0.6),
               0 0 18px rgba(34, 197, 94, 0.4);
  animation: pulseMicGlow 1s infinite;
}

/* مكتوم من الأدمن */
.mic-admin-muted::after {
  content: "🔇";
  color: red;
  font-weight: bold;
}

/* مكتوم عندك فقط */
.mic-local-muted::after {
  content: "🔕";
  color: orange;
  font-weight: bold;
}

/* حركة نبض + إضاءة عند الكلام */
@keyframes pulseMicGlow {
  0%, 100% {
    transform: scale(1);
    text-shadow: 0 0 6px rgba(34, 197, 94, 0.8),
                 0 0 12px rgba(34, 197, 94, 0.6),
                 0 0 18px rgba(34, 197, 94, 0.4);
  }
  50% {
    transform: scale(1.2);
    text-shadow: 0 0 12px rgba(34, 197, 94, 1),
                 0 0 24px rgba(34, 197, 94, 0.8),
                 0 0 36px rgba(34, 197, 94, 0.6);
  }
}

/* =====================
   👥 قائمة المستخدمين
   ===================== */
#users {
  margin-top: 1rem;
  padding: 0.5rem;
  border-radius: 12px;
  background: #f9fafb;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
  max-height: 400px;
  overflow-y: auto;
}

#users > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: background 0.2s ease;
}

#users > div:hover {
  background: #f0f9ff;
}

#users span {
  font-size: 15px;
}

/* اسم الأدمن */
#users .text-yellow-600 {
  color: #d97706 !important;
}

/* اسم المستخدم العادي */
#users .text-blue-800 {
  color: #1e3a8a !important;
}

/* مستخدم يتكلم (إضاءة) */
#users > div.speaking {
  background: #e30922; /* أخضر فاتح */
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6),
              0 0 16px rgba(34, 197, 94, 0.4);
  border-left: 4px solid #22c55e;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

/* =====================
   🖼️ صور الدردشة
   ===================== */
.chat-image {
  object-fit: cover;
  border-radius: 8px;
  margin-top: 4px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

/* حركة بسيطة عند المرور */
.chat-image:hover {
  transform: scale(1.05);
}

/* مصغرات ديناميكية */
.chat-image {
  width: 96px;
  height: 96px;
}
@media (min-width: 768px) {
  .chat-image {
    width: 128px;
    height: 128px;
  }
}

/* =====================
   🔍 لايت بوكس للصور
   ===================== */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#lightbox.active {
  display: flex;
  opacity: 1;
}

#lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

/* زر الإغلاق */
#lightbox::after {
  content: "✖";
  position: absolute;
  top: 16px;
  right: 24px;
  font-size: 24px;
  color: white;
  cursor: pointer;
}
.username {
  font-weight: bold;
  font-size: 14px;
}

.username.host {
  color: green;   /* هوست */
}

.username.admin {
  color: crimson; /* أدمن */
}

.username.regular {
  color: blue;    /* مستخدم عادي */
}

/* لو عايز تضيف الرموز مع الألوان */
.username.host::before {
  content: "🛡️ ";
}
.username.admin::before {
  content: "👑 ";
}
.username.regular::before {
  content: "🎙️ ";
}

/* CSS للأيقونة */
.mic-icon {
  font-size: 18px;
  opacity: 0.4;
  transition: 0.2s;
}
.mic-icon.speaking {
  color: green;
  opacity: 1;
  transform: scale(1.2);
}
