/* ==========================================================================
   📌 پلتفرم دایرکت صنایع دستی - استایل‌دهی پریمیوم، رسپانسیو و گلس‌مورفیک
   ========================================================================== */

@import url("../base/variables.5e7fedb82cda.css");

/* 🎨 هماهنگی کامل متغیرهای رنگی با تم‌های فعال سیستم */
body.theme-dark {
  --bg-main: #141412;
  --bg-card: #1E1E1C;
  --bg-card-rgb: 30, 30, 28;
  --bg-muted: #2A2A27;
  --text-primary: #ECE5DC;
  --text-secondary: #C8BFB5;
  --text-muted: #8E8478;
  --border-color: #38322B;
}

body.theme-earthy {
  --bg-main: #F0D9C0;
  --bg-card: #F9EFE4;
  --bg-card-rgb: 249, 239, 228;
  --bg-muted: #E2C09C;
  --text-primary: #4A2E1B;
  --text-secondary: #70472D;
  --text-muted: #997157;
  --border-color: #D3A77C;
  --primary: #C46A2B; /* رنگ آجری رسی */
  --secondary: #8B5E3C; /* قهوه‌ای چوبی ملایم */
}

/* ─── تنظیمات پایه دایرکت چت ─── */
body.page-direct {
  background-color: var(--bg-main, #F7F3EE);
  color: var(--text-primary, #333);
  overflow: hidden;
  height: 100vh;
  margin: 0;
  padding: 0;
  font-family: "iranSans-m", sans-serif;
}

/* کانتینر اصلی صفحه دایرکت */
.direct-container {
  display: flex;
  width: 100%;
  height: 100vh;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  body.page-direct {
    padding-right: 70px; /* دقیقاً هم‌تراز با عرض ۷۰ پیکسلی desktop-sidebar بدون هیچ فاصله اضافی */
    padding-left: 0;
    margin: 0;
  }
  .direct-container {
    width: 100%;
    margin: 0;
  }
}

/* ==========================================================================
   💬 ستون راست: پنل لیست گفتگوها (Chat List Panel)
   ========================================================================== */
.chat-list-panel {
  width: 350px;
  background-color: var(--bg-card, #fff);
  border-left: 1px solid var(--border-color, #eee);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
  height: 100%;
}

@media (max-width: 767px) {
  .chat-list-panel {
    width: 100%;
    height: 100vh;
  }
}

/* هدر پنل چت */
.chat-list-header {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color, #eee);
  position: relative;
  z-index: 30;
  background-color: var(--bg-card, #fff);
}

/* دراپ‌داون انتخاب هویت (Identity Switcher) */
.chat-identity-dropdown-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.identity-selector-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 8px;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.identity-selector-btn:hover {
  background-color: var(--bg-muted, #f8fafc);
  border-color: var(--border-color, #e2e8f0);
}

.identity-selector-btn[aria-expanded="true"] {
  background-color: var(--bg-muted, #f8fafc);
  border-color: var(--primary, #c2410c);
}

.identity-avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(194, 65, 12, 0.25);
  background-color: var(--bg-muted, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.identity-avatar-mini img,
.identity-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.identity-selector-btn .user-handle {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary, #1e293b);
  margin: 0;
  display: inline-block;
  line-height: 1;
}

.identity-selector-btn .arrow-icon {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  transition: transform 0.25s ease, color 0.2s ease;
  flex-shrink: 0;
}

.identity-selector-btn[aria-expanded="true"] .arrow-icon {
  transform: rotate(180deg);
  color: var(--primary, #c2410c);
}

/* منوی بازشونده هویت */
.identity-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 100;
  min-width: 280px;
  max-width: 340px;
  width: max-content;
  background-color: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
  padding: 8px;
  flex-direction: column;
  gap: 4px;
  animation: identityDropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes identityDropdownFade {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.identity-menu-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
  padding: 6px 10px 4px;
  text-align: right;
  user-select: none;
}

.identity-menu-subtitle {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
  padding: 6px 10px 2px;
  text-align: right;
  user-select: none;
}

.identity-menu-divider {
  height: 1px;
  background-color: var(--border-color, #e2e8f0);
  margin: 4px 0;
}

.identity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: right;
  transition: all 0.2s ease;
  font-family: inherit;
  color: inherit;
  box-sizing: border-box;
}

.identity-item:hover {
  background-color: var(--bg-muted, #f8fafc);
  border-color: var(--border-color, #e2e8f0);
}

.identity-item.active {
  background-color: rgba(194, 65, 12, 0.08);
  border-color: rgba(194, 65, 12, 0.22);
}

.identity-item-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(194, 65, 12, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background-color: var(--bg-muted, #f8fafc);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.identity-item.active .identity-item-icon {
  border-color: var(--primary, #c2410c);
  box-shadow: 0 0 0 2px rgba(194, 65, 12, 0.2);
}

.identity-item-icon img,
.identity-item-avatar-img,
.identity-shop-logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.identity-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
  flex: 1;
  min-width: 0;
}

.identity-item-info strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.identity-item.active .identity-item-info strong {
  color: var(--primary, #c2410c);
}

.identity-item-info span {
  font-size: 11px;
  color: var(--text-secondary, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.identity-item .checkmark-icon {
  font-size: 12px;
  color: var(--primary, #c2410c);
  margin-right: auto;
  opacity: 0;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.identity-item.active .checkmark-icon {
  opacity: 1;
}

/* دکمه گفتگوی جدید */
.new-message-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-primary, #333);
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.new-message-btn:hover {
  background-color: var(--bg-muted, #f5f5f5);
  color: var(--primary, #c2410c);
  transform: scale(1.05);
}

/* نوار کاربران آنلاین بالای چت‌ها (Active Users Bar) */
.active-users-bar {
  padding: 12px 16px 14px;
  border-bottom: 1px solid var(--border-color, #eee);
  background-color: var(--bg-card, #fff);
}

.active-users-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.active-users-scroll::-webkit-scrollbar {
  display: none;
}

.active-user-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.active-user-circle span {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary, #555);
  max-width: 54px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* رینگ گرادیانی آواتار کاربر آنلاین */
.avatar-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  padding: 2.5px;
  background: var(--border-color, #eee);
  position: relative;
  transition: transform 0.2s;
}

.active-user-circle:hover .avatar-ring {
  transform: scale(1.05);
}

.avatar-ring.online {
  background: linear-gradient(135deg, var(--secondary, #C46A2B), var(--primary, #8B5E3C));
}

.avatar-ring.online::after {
  content: "";
  position: absolute;
  bottom: 1px;
  left: 1px;
  width: 11px;
  height: 11px;
  background-color: #2ec4b6; /* سبز فعال درخشان */
  border-radius: 50%;
  border: 2px solid var(--bg-card, #fff);
}

.avatar-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-card, #fff);
}

/* فالبک حروف اول نام کاربر به صورت رنگی سنتی */
.avatar-fallback-initials {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--bg-muted, #efe8de);
  color: var(--primary, #8B5E3C);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
  border: 2px solid var(--bg-card, #fff);
}

/* سرچ چت‌های دایرکت */
.chat-search-wrap {
  position: relative;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, #eee);
}

.chat-search-wrap input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border-color, #ccc);
  border-radius: var(--radius-sm, 6px);
  background-color: var(--bg-main, #f5f5f5);
  padding: 0 40px 0 12px;
  outline: none;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-primary, #333);
  transition: border-color 0.2s, background-color 0.2s;
}

.chat-search-wrap input:focus {
  border-color: var(--primary, #8B5E3C);
  background-color: var(--bg-card, #fff);
}

.chat-search-wrap i {
  position: absolute;
  top: 50%;
  right: 28px;
  transform: translateY(-50%);
  color: var(--text-muted, #888);
  font-size: 0.95rem;
}

/* اسکرول لیست پیام‌ها */
.conversations-scroll {
  flex: 1;
  overflow-y: auto;
}

.conversations-scroll::-webkit-scrollbar { width: 5px; }
.conversations-scroll::-webkit-scrollbar-thumb { background: var(--border-color, #eee); border-radius: 10px; }

/* هر ردیف چت (مکالمات) */
.chat-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background-color var(--transition-fast, 0.2s);
  border-right: 3px solid transparent;
}

.chat-item-row:hover {
  background-color: var(--bg-main, #fcfbf9);
}

.chat-item-row.active {
  background-color: rgba(196, 106, 43, 0.05); /* هایلایت با رنگ رسی ملایم */
  border-right-color: var(--primary, #C46A2B);
}

.chat-row-avatar-wrap {
  flex-shrink: 0;
}

.chat-row-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  position: relative;
}

.chat-row-avatar.online::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 11px;
  height: 11px;
  background-color: #2ec4b6;
  border-radius: 50%;
  border: 2px solid var(--bg-card, #fff);
}

.chat-row-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.chat-row-details {
  flex: 1;
  min-width: 0;
  text-align: right;
}

.chat-row-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary, #333);
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-row-name .icon-verified {
  color: #3897f0;
  font-size: 0.85rem;
}

.chat-row-last-msg {
  font-size: 0.82rem;
  color: var(--text-muted, #777);
  margin: 0;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.chat-row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.chat-row-time {
  font-size: 0.74rem;
  color: var(--text-muted, #888);
}

.chat-row-unread {
  background-color: var(--primary, #C46A2B);
  color: white;
  font-size: 0.68rem;
  font-weight: bold;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(196, 106, 43, 0.25);
}

/* ==========================================================================
   💬 ستون چپ: پنل جزئیات و نمایش چت فعال (Chat View Panel)
   ========================================================================== */
.chat-view-panel {
  flex: 1;
  background-color: var(--bg-card, #fff);
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
}

@media (max-width: 767px) {
  .chat-view-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh; /* هماهنگی کامل با ارتفاع متغیر در مرورگرهای موبایل */
    z-index: 2500; /* لایه‌بندی کاملاً بالاتر از نوبار شناور موبایل */
    transform: translateX(-100%); /* اسلاید چت از چپ به راست در حالت RTL */
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    background-color: var(--bg-main, #F7F3EE);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .chat-view-panel.is-open {
    transform: translateX(0);
  }

  /* پدینگ انتهای لیست گفتگوها تا نوبار شناور هیچ آیتمی را نپوشاند */
  .chat-list-panel .conversations-scroll {
    padding-bottom: 96px;
  }
}

/* 🚫 مخفی‌سازی روان نوبار شناور موبایل هنگام باز بودن چت */
@media (max-width: 767px) {
  body.chat-view-active .bottom-nav,
  body.has-active-chat .bottom-nav,
  body:has(.chat-view-panel.is-open) .bottom-nav {
    transform: translateY(140%) scale(0.92) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }
}

/* استایل حالت چت انتخاب نشده (Empty State) */
.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  background-color: var(--bg-main, #F7F3EE);
}

.empty-icon-wrap {
  width: 96px;
  height: 96px;
  border: 2px solid var(--text-secondary, #555);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  color: var(--text-secondary, #555);
  margin-bottom: 20px;
  background-color: var(--bg-card, #fff);
  box-shadow: var(--shadow-sm);
}

.chat-empty-state h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 10px 0;
  color: var(--text-primary, #333);
}

.chat-empty-state p {
  font-size: 0.88rem;
  color: var(--text-muted, #777);
  max-width: 320px;
  margin: 0 0 24px 0;
  line-height: 1.6;
}

.empty-action-btn {
  background: linear-gradient(135deg, var(--secondary, #8B5E3C), var(--primary, #C46A2B));
  color: white;
  padding: 12px 28px;
  border-radius: var(--radius-sm, 6px);
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(196, 106, 43, 0.2);
  transition: transform 0.2s;
}

.empty-action-btn:active {
  transform: scale(0.96);
}

/* پنجره چت فعال (Chat Window) */
.chat-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-window-header {
  height: 64px;
  border-bottom: 1px solid var(--border-color, rgba(226, 218, 208, 0.85));
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}

@media (max-width: 767px) {
  .chat-window-header {
    height: calc(60px + env(safe-area-inset-top, 0px));
    padding-top: max(6px, env(safe-area-inset-top, 6px));
    padding-right: 12px;
    padding-left: 12px;
  }
}

.chat-back-btn {
  display: none;
  background: rgba(139, 94, 60, 0.07);
  border: 1px solid rgba(139, 94, 60, 0.12);
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  font-size: 1.1rem;
  color: var(--text-primary, #333);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  margin-left: 10px;
}

.chat-back-btn:hover {
  background: rgba(139, 94, 60, 0.14);
  color: var(--primary, #8B5E3C);
}

.chat-back-btn:active {
  transform: scale(0.92);
  background: rgba(139, 94, 60, 0.2);
}

@media (max-width: 767px) {
  .chat-back-btn {
    display: inline-flex;
  }
}

.chat-header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  text-align: right;
  min-width: 0;
}

.chat-header-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.chat-header-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-card, #fff);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* نشانگر پالس‌دار وضعیت آنلاین بودن */
.chat-status-pulse-dot {
  position: absolute;
  bottom: 1px;
  left: 1px;
  width: 11px;
  height: 11px;
  background-color: #10b981;
  border-radius: 50%;
  border: 2px solid var(--bg-card, #fff);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  animation: pulseStatusOnline 2.4s infinite;
}

@keyframes pulseStatusOnline {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.chat-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chat-header-name {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-primary, #1e293b);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.chat-header-status {
  font-size: 0.75rem;
  color: #10b981;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.chat-header-status .status-bullet {
  font-size: 8px;
  color: #10b981;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* دکمه ارسال اثر صنایع دستی در هدر */
.header-action-btn.js-open-product-share {
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(196, 106, 43, 0.1) 0%, rgba(139, 94, 60, 0.06) 100%);
  border: 1px solid rgba(196, 106, 43, 0.28);
  color: var(--secondary, #C46A2B);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(196, 106, 43, 0.08);
  -webkit-tap-highlight-color: transparent;
}

.header-action-btn.js-open-product-share:hover {
  background: linear-gradient(135deg, rgba(196, 106, 43, 0.18) 0%, rgba(139, 94, 60, 0.12) 100%);
  border-color: var(--secondary, #C46A2B);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(196, 106, 43, 0.15);
}

.header-action-btn.js-open-product-share:active {
  transform: scale(0.95);
}

.header-action-btn.js-open-product-share i {
  font-size: 0.95rem;
}

@media (max-width: 480px) {
  .header-action-btn.js-open-product-share {
    padding: 0 10px;
    height: 36px;
  }
  .header-action-btn.js-open-product-share .action-btn-text {
    font-size: 0.78rem;
  }
}

/* دکمه قطع/وصل صدای اعلان در هدر چت */
.header-action-btn.js-toggle-chat-sound {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  -webkit-tap-highlight-color: transparent;
}

.header-action-btn.js-toggle-chat-sound:hover {
  background: var(--bg-muted, #f8fafc);
  color: var(--primary, #c2410c);
  border-color: var(--primary, #c2410c);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.header-action-btn.js-toggle-chat-sound.is-muted {
  color: var(--text-muted, #94a3b8);
  opacity: 0.7;
}

.header-action-btn.js-toggle-chat-sound:active {
  transform: scale(0.95);
}

@media (max-width: 480px) {
  .header-action-btn.js-toggle-chat-sound {
    width: 36px;
    height: 36px;
  }
}

/* ─── ناحیه هیستوری و اسکرول پیام‌ها ─── */
.chat-messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: var(--bg-main, #F7F3EE);
}

.chat-messages-area::-webkit-scrollbar { width: 5px; }
.chat-messages-area::-webkit-scrollbar-thumb { background: var(--border-color, #ccc); border-radius: 10px; }

.chat-date-divider {
  text-align: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted, #888);
  margin: 12px 0;
  position: relative;
}

/* استایل سطر پیام‌ها */
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 78%;
  position: relative;
  transition: transform 0.2s ease;
}

.msg-row--received {
  align-self: flex-start; /* پیام‌های دریافتی سمت راست در RTL */
}

.msg-row--sent {
  align-self: flex-end; /* پیام‌های ارسالی سمت چپ در RTL */
  flex-direction: row-reverse; /* معکوس کردن ردیف برای خروجی قرینه */
  max-width: 72%;
}

.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  margin-top: 4px;
}

.msg-bubble-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
}

.msg-row--sent .msg-bubble-wrap {
  align-items: flex-end;
}

/* دکمه اکشن سریع Reply کنار پیام */
.msg-reply-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #e0d8d0);
  color: var(--text-muted, #777);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  margin-bottom: 6px;
}

.msg-row:hover .msg-reply-btn {
  opacity: 1;
  visibility: visible;
}

.msg-reply-btn:hover {
  background-color: var(--primary, #C46A2B);
  color: #fff;
  border-color: var(--primary, #C46A2B);
  transform: scale(1.1);
}

/* کادر حبابی پیام‌ها */
.msg-bubble {
  padding: 10px 14px;
  font-size: 0.89rem;
  line-height: 1.62;
  border-radius: 16px;
  word-break: break-word;
  text-align: right;
  position: relative;
}

/* نمایش نام ادمین غرفه شبیه نیک‌نیم تلگرام (Telegram Admin Nickname) */
.msg-admin-nickname {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 5px;
  line-height: 1.2;
  user-select: none;
}

.msg-row--received .msg-admin-nickname {
  color: var(--primary, #C25E26);
}

.msg-row--sent .msg-admin-nickname {
  color: rgba(255, 255, 255, 0.95);
}

.msg-admin-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.msg-admin-name i {
  font-size: 0.7rem;
  opacity: 0.85;
}

.msg-admin-badge {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 6px;
  letter-spacing: -0.2px;
}

.msg-row--received .msg-admin-badge {
  background-color: rgba(194, 94, 38, 0.1);
  color: var(--primary, #C25E26);
  border: 1px solid rgba(194, 94, 38, 0.2);
}

.msg-row--sent .msg-admin-badge {
  background-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.msg-bubble-admin-tag {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  margin-bottom: 4px;
}

/* کارت نقل‌قول داخل حباب پیام (Quoted Reply Card) */
.msg-quote-card {
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
  border-right: 3px solid var(--secondary, #C46A2B);
  background-color: rgba(0, 0, 0, 0.04);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}

.msg-row--sent .msg-quote-card {
  border-right-color: #ffffff;
  background-color: rgba(255, 255, 255, 0.2);
}

.msg-quote-card:hover {
  background-color: rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.msg-row--sent .msg-quote-card:hover {
  background-color: rgba(255, 255, 255, 0.28);
}

.msg-quote-sender {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--secondary, #C46A2B);
  display: flex;
  align-items: center;
  gap: 4px;
}

.msg-row--sent .msg-quote-sender {
  color: #ffffff;
}

.msg-quote-text {
  font-size: 0.78rem;
  color: var(--text-primary, #444);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.msg-row--sent .msg-quote-text {
  color: rgba(255, 255, 255, 0.92);
}

/* پیام دریافتی (سمت راست - سفید لطیف با کانتور تمیز) */
.msg-row--received .msg-bubble {
  background-color: var(--bg-card, #ffffff);
  color: var(--text-primary, #1e293b);
  border-top-right-radius: 3px;
  border: 1px solid rgba(226, 218, 208, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* پیام ارسالی (سمت چپ - گرادیانت گرم و غنی صنایع دستی بقچه) */
.msg-row--sent .msg-bubble {
  background: linear-gradient(135deg, #C25E26 0%, #9C4B18 100%);
  color: #ffffff;
  border-top-left-radius: 3px;
  box-shadow: 0 4px 14px rgba(194, 94, 38, 0.25);
}

/* انیمیشن هایلایت هنگام پرش به پیام مرجع */
@keyframes highlightTargetPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(196, 106, 43, 0.5);
  }
  40% {
    transform: scale(1.03);
    box-shadow: 0 0 0 10px rgba(196, 106, 43, 0.25);
  }
  100% {
    transform: scale(1);
    box-shadow: none;
  }
}

.msg-row.highlight-pulse .msg-bubble {
  animation: highlightTargetPulse 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-color: var(--primary, #C46A2B) !important;
}

.msg-time {
  font-size: 0.72rem;
  color: var(--text-muted, #888);
  display: flex;
  align-items: center;
  gap: 4px;
}

.read-tick {
  font-size: 0.8rem;
  color: var(--text-muted, #888);
  transition: color 0.2s ease;
}

.read-tick.is-read {
  color: var(--primary, #C46A2B);
}

/* ─── کارت اشتراک گذاری آثار صنایع دستی در چت ─── */
.chat-product-card {
  width: 250px;
  background-color: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #eee);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-bottom: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.chat-prod-img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  background-color: var(--bg-muted, #f5f5f5);
}

.chat-prod-details {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
}

.chat-prod-details h5 {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary, #333);
}

.chat-prod-price {
  font-size: 0.82rem;
  color: var(--primary, #8B5E3C);
  font-weight: 700;
}

.chat-prod-buy-btn {
  background-color: var(--secondary, #8B5E3C);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  transition: background-color var(--transition-fast, 0.2s), transform 0.1s;
}

.chat-prod-buy-btn:hover {
  background-color: var(--primary, #C46A2B);
}

.chat-prod-buy-btn:active {
  transform: scale(0.96);
}

/* ─── کارت اشتراک گذاری پست، ریلز و استوری در چت ─── */
.chat-post-card, .chat-story-card {
  width: 250px;
  background-color: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #eee);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-bottom: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition-fast, 0.2s), box-shadow var(--transition-fast, 0.2s);
}

.chat-post-card:hover, .chat-story-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.chat-post-media-wrap {
  position: relative;
  width: 100%;
  height: 140px;
  background-color: #111;
  overflow: hidden;
}

.chat-post-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-post-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-post-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
}

.chat-post-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
}

.chat-post-shop-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary, #333);
}

.chat-post-caption {
  font-size: 0.78rem;
  color: var(--text-muted, #666);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── فوتر و کادر پیام‌نویسی چت فعال ─── */
/* ─── فوتر و کادر پیام‌نویسی چت فعال ─── */
.chat-input-area {
  padding: 10px 16px;
  border-top: 1px solid var(--border-color, rgba(226, 218, 208, 0.85));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}

@media (max-width: 767px) {
  .chat-input-area {
    padding: 8px 12px max(10px, env(safe-area-inset-bottom, 10px));
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.04);
  }
}

/* نشان هویت فرستنده پیام (میکروپیل مدرن) */
.chat-sender-identity-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: rgba(139, 94, 60, 0.06);
  border: 1px solid rgba(139, 94, 60, 0.12);
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-muted, #777);
  width: fit-content;
  user-select: none;
}

.chat-sender-identity-badge .active-role {
  color: var(--secondary, #C46A2B);
  font-weight: 800;
}

/* نوار پیش‌نمایش پاسخ به پیام */
@keyframes slideDownReply {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-reply-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background-color: var(--bg-main, #F7F3EE);
  border: 1px solid var(--border-color, #e8dfd8);
  border-right: 4px solid var(--secondary, #C46A2B);
  border-radius: 12px;
  padding: 8px 12px;
  animation: slideDownReply 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.reply-preview-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}

.reply-preview-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--secondary, #C46A2B);
}

.reply-preview-header i {
  font-size: 0.72rem;
  transform: scaleX(-1); /* جهت آیکون ریپلای متناسب با RTL */
}

.reply-preview-text {
  font-size: 0.8rem;
  color: var(--text-muted, #666);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-preview-close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--text-muted, #888);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.reply-preview-close:hover {
  background-color: rgba(0, 0, 0, 0.06);
  color: var(--text-primary, #222);
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.chat-input-container {
  flex: 1;
  background-color: var(--bg-main, #F4EFE8);
  border: 1.5px solid transparent;
  border-radius: 24px;
  padding: 2px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.22s ease;
}

.chat-input-container:focus-within {
  background-color: #ffffff;
  border-color: var(--secondary, #C46A2B);
  box-shadow: 0 0 0 3px rgba(196, 106, 43, 0.12);
}

.chat-input-textbox {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text-primary, #1e293b);
  max-height: 110px;
  min-height: 24px;
  padding: 7px 2px;
  line-height: 1.5;
}

.chat-input-textbox::placeholder {
  color: var(--text-muted, #94a3b8);
}

.chat-input-btn {
  background: none;
  border: none;
  color: var(--text-secondary, #64748b);
  font-size: 1.15rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.chat-input-btn:hover {
  color: var(--secondary, #C46A2B);
  background-color: rgba(196, 106, 43, 0.08);
}

.chat-input-btn:active {
  transform: scale(0.92);
}

/* دکمه دایره‌ای ارسال */
.chat-send-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background-color: #E2DBD2;
  color: #A39686;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: not-allowed;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.chat-send-btn i {
  font-size: 1.05rem;
  transform: scaleX(-1); /* تراز جهت هواپیمای کاغذی در زبان راست‌به‌چپ */
  transition: transform 0.2s ease;
}

.chat-send-btn:not(:disabled) {
  background: linear-gradient(135deg, #C25E26 0%, #9C4B18 100%);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(194, 94, 38, 0.35);
}

.chat-send-btn:not(:disabled):hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(194, 94, 38, 0.42);
}

.chat-send-btn:not(:disabled):active {
  transform: scale(0.92);
}

/* ==========================================================================
   📦 بخش جدید: طراحی شیک مودال اشتراک کالا در گفتگو (Product Share Modal)
   ========================================================================== */
.product-share-modal {
  position: fixed;
  inset: 0;
  z-index: 3000; /* لایه‌بندی کاملاً بالاتر از پنل چت و نوبار موبایل */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.product-share-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.product-share-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.product-share-modal__content {
  position: relative;
  background-color: var(--bg-card, #ffffff);
  width: 92%;
  max-width: 480px;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  z-index: 10;
  transform: scale(0.94) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color, rgba(226, 218, 208, 0.85));
}

.product-share-modal.is-open .product-share-modal__content {
  transform: scale(1) translateY(0);
}

.product-share-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color, #eee);
  padding-bottom: 12px;
}

.share-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-modal-title-wrap i {
  font-size: 1.15rem;
}

.product-share-modal__header h3 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-primary, #1e293b);
}

.product-share-modal__header button {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  font-size: 1.1rem;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.product-share-modal__header button:hover {
  background-color: #ef4444;
  color: #ffffff;
}

/* نوار جستجوی زنده آثار در مودال */
.share-modal-search-wrap {
  position: relative;
  margin-bottom: 14px;
}

.share-modal-search-wrap i {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: var(--text-muted, #94a3b8);
  font-size: 0.9rem;
}

.share-modal-search {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border-color, #e2e8f0);
  background-color: var(--bg-main, #f8fafc);
  padding: 0 40px 0 14px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-primary, #1e293b);
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.share-modal-search:focus {
  border-color: var(--secondary, #C46A2B);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(196, 106, 43, 0.12);
}

.product-share-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 2px;
  max-height: 52vh;
}

.product-share-modal__body::-webkit-scrollbar {
  width: 4px;
}

.product-share-modal__body::-webkit-scrollbar-thumb {
  background: var(--border-color, #cbd5e1);
  border-radius: 4px;
}

.share-products-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.share-product-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  background-color: var(--bg-card, #ffffff);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: right;
  user-select: none;
}

.share-product-item:hover {
  background-color: var(--bg-main, #FAF7F2);
  border-color: var(--secondary, #C46A2B);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(196, 106, 43, 0.08);
}

.share-product-item:active {
  transform: scale(0.98);
}

.share-product-item img {
  width: 58px;
  height: 58px;
  min-width: 58px;
  border-radius: 10px;
  object-fit: cover;
  background-color: var(--bg-muted, #f1f5f9);
  border: 1px solid var(--border-color, #e2e8f0);
}

.share-prod-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.share-prod-title {
  font-size: 0.9rem;
  color: var(--text-primary, #1e293b);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.share-prod-price {
  font-size: 0.84rem;
  color: var(--secondary, #C46A2B);
  font-weight: 800;
}

.send-item-btn {
  background: linear-gradient(135deg, #C25E26 0%, #9C4B18 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 3px 10px rgba(194, 94, 38, 0.25);
  transition: all 0.2s ease;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.send-item-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(194, 94, 38, 0.35);
}

.send-item-btn:active {
  transform: scale(0.94);
}

/* ==========================================================================
   ⏳ استایل‌های وضعیت ارسال پیام (Pending, Failed, Retry)
   ========================================================================== */
.msg-row.msg-status--pending {
  opacity: 0.72;
}

.msg-row.msg-status--pending .msg-bubble {
  position: relative;
}

.msg-row.msg-status--failed {
  opacity: 1;
}

.msg-row.msg-status--failed .msg-bubble {
  border: 1.5px solid #ef4444 !important;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.25) !important;
}

.msg-status-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
}

.msg-status-icon.is-pending {
  color: rgba(255, 255, 255, 0.8);
}

.msg-row--received .msg-status-icon.is-pending {
  color: var(--text-muted, #888);
}

.msg-status-icon.is-failed {
  color: #ef4444;
  font-weight: 700;
  cursor: pointer;
}

/* دکمه تلاش مجدد ارسال پیام */
.msg-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #ef4444;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.msg-retry-btn:hover {
  background-color: #dc2626;
  transform: scale(1.05);
}

.msg-retry-btn:active {
  transform: scale(0.95);
}

.msg-error-notice {
  font-size: 0.7rem;
  color: #ef4444;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

/* بنر وضعیت قطعی اتصال چت */
.chat-connection-banner {
  background-color: #fef2f2;
  border-bottom: 1px solid #fee2e2;
  color: #991b1b;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideDownBanner 0.25s ease;
  z-index: 15;
}

@keyframes slideDownBanner {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Toast Notification در صفحه دایرکت (تم قهوه نسکافه‌ای) */
.explore-toast.js-toast {
  position: fixed;
  bottom: 85px;
  left: 50%;
  transform: translate(-50%, 30px);
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  z-index: 10000;
  direction: rtl;
}

.explore-toast.js-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
