/* ==========================
   Simple Support – Base Cards
   ========================== */
.ss-card {
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.06);
  background: #fff;
  overflow: hidden;
}
.ss-card-header {
  display:flex;align-items:center;justify-content:space-between;
  padding:14px 16px;border-bottom:1px solid rgba(0,0,0,.05);
}
.ss-title {font-size:16px;font-weight:700;margin:0;}
.ss-meta {font-size:12px;color:#6c757d;}
.ss-body {padding:14px 16px;}
.ss-badge {
  display:inline-block;padding:4px 10px;border-radius:999px;font-size:12px;
}
.ss-badge-open {background:#eafaf1;color:#198754;border:1px solid #cdebd9;}
.ss-badge-pending {background:#fff5e6;color:#b36b00;border:1px solid #ffe0b3;}
.ss-badge-closed {background:#f1f3f5;color:#6c757d;border:1px solid #e9ecef;}
.ss-actions {gap:8px}
.ss-actions .btn {border-radius:10px}
.ss-chip {
  display:inline-flex;align-items:center;gap:6px;
  font-size:12px;padding:4px 10px;border-radius:999px;background:#f8f9fa;color:#495057;
}

/* ===========================
   Simple Support – Forms
   =========================== */
.ss-form {
  max-width: 640px;
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  padding: 24px;
}
.ss-form .form-control {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
}
.ss-form label {
  font-weight: 600;
  color: #333;
}
.ss-form .btn-primary {
  border-radius: 10px;
  font-size: 16px;
  padding: 10px 0;
  font-weight: 600;
}
.ss-form .btn-primary:hover {opacity: .9;}

/* ===========================
   Simple Support – RTL Layout
   =========================== */
.support-tickets {
  max-width: 960px;
  margin: 0 auto;
  direction: rtl;
  text-align: right;
}
.support-tickets .row {justify-content: center;}
.support-tickets .ticket-card {
  transition: all .25s ease;
  border: none;
  border-radius: 1rem;
  overflow: hidden;
  background-color: #fff;
}
.support-tickets .ticket-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}
.support-tickets .card-body {padding: 1.5rem 1.75rem;}
.support-tickets .card-body h5 {
  font-weight: 600;
  font-size: 1.05rem;
}
.support-tickets .badge {
  font-size: .85rem;
  padding: .4em .7em;
  border-radius: .45rem;
  line-height: 1.2;
}
.support-tickets .btn-primary {
  border-radius: .5rem;
  font-weight: 600;
  padding: .45rem 1.1rem;
  transition: .2s;
}
.support-tickets .btn-primary:hover {
  opacity: .9;
  transform: translateY(-1px);
}

/* ==========================
   Simple Support Dashboard
   ========================== */
.support-dashboard {
  max-width: 960px;
  margin: 0 auto;
  direction: rtl;
  text-align: right;
}
.support-dashboard .ticket-card {
  background: #fff;
  border: 1px solid #eee;
  transition: all .3s ease;
  border-radius: 1rem;
  text-decoration: none !important;
}
.support-dashboard .ticket-card:hover {
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  transform: translateY(-2px);
}

/* ===============================
   💬 Modern Chat UI - Final Fixed
   =============================== */
.ticket-detail {
  max-width: 850px;
  margin: auto;
  direction: rtl;
  text-align: right;
}

.conversation-box {
  background: #f9fafb;
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.02);
  direction: rtl;
  overflow-y: auto;
  max-height: 70vh;
}

/* پیام‌ها */
.message {
  display: flex;
  align-items: flex-end;
  margin-bottom: 1.6rem;
  position: relative;
  animation: fadeInUp .4s ease;
}

/* آواتار */
.message .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  z-index: 2;
}
.message .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.avatar-fallback {
  background: #dbeafe;
  color: #1e40af;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.avatar-fallback.admin {
  background: #e0f2fe;
  color: #0369a1;
}

/* حباب گفتگو */
.bubble {
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  max-width: 75%;
  line-height: 1.7;
  position: relative;
  word-break: break-word;
}

/* پیام کاربر فعلی (سمت راست) */
.user-msg {
  flex-direction: row-reverse;
  text-align: right;
}
.user-msg .bubble {
  background: #097745;
  color: #fff;
  border-bottom-left-radius: 0.3rem;
  margin-right: 0.75rem;
  margin-left: 0;
}
.user-msg .avatar {
  margin-left: 0;
  margin-right: 0.75rem;
  order: 0; /* آواتار بعد از متن (در سمت راست) */
}

.user-msg .meta{
 color: #fff;
}

/* پیام پشتیبان / دیگران (سمت چپ) */
.admin-msg {
  flex-direction: row;
  text-align: right;
}
.admin-msg .bubble {
  background: #fff;
  color: #333;
  border-bottom-right-radius: 0.3rem;
  margin-left: 0.75rem;
  margin-right: 0;
}
.admin-msg .avatar {
  margin-right: 0;
  margin-left: 0.75rem;
  order: 0; /* آواتار قبل از متن (در سمت چپ) */
}

/* اطلاعات متا */
.meta {
  font-size: 0.75rem;
  color: #6b7280;
  opacity: 0.9;
  margin-bottom: 0.3rem;
}

/* ظاهر با انیمیشن ورود */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* حالت موبایل */
@media (max-width: 576px) {
  .bubble {
    max-width: 90%;
    font-size: 14px;
  }
  .message .avatar {
    width: 36px;
    height: 36px;
  }
}

/* ===========================
   💌 Reply Form Box
   =========================== */
.reply-box {
  border-radius: 1rem;
  margin-top: 2rem;
  background: #fff;
}
.reply-box .card-body {
  padding: 1.5rem;
}
.reply-box textarea {
  border-radius: 0.5rem;
}
.reply-box .form-submit {
  border-radius: 0.5rem;
  padding: 0.5rem 1.5rem;
  background: #2563eb;
  color: #fff;
  border: none;
  transition: 0.2s;
}
.reply-box .form-submit:hover {
  background: #1d4ed8;
}

