/* ==========================================================================
   استایل‌های سیستم تیکت پشتیبانی (هماهنگ با قالب سایت)
   ========================================================================== */
.sts-wrap {
  font-family: inherit;
  direction: rtl;
  text-align: right;
  color: var(--text-main, #334155);
}

/* کارت اصلی */
.sts-card {
  background: var(--white, #ffffff);
  border-radius: 24px;
  padding: 30px;
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: var(--shadow-md, 0 10px 30px -10px rgba(0, 0, 0, 0.05));
  margin-bottom: 30px;
}
.sts-card-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--dark, #0f172a);
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px dashed var(--border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* دکمه‌ها */
.sts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(
    135deg,
    var(--primary, #4f46e5),
    var(--secondary, #0ea5e9)
  );
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
  transition: all 0.3s ease;
}
.sts-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(79, 70, 229, 0.4);
  color: #fff !important;
}
.sts-btn-secondary {
  background: var(--bg-light, #f8fafc);
  color: var(--text-main, #334155) !important;
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: none;
}
.sts-btn-secondary:hover {
  background: var(--border, #e2e8f0);
  transform: translateY(-2px);
  color: var(--dark, #0f172a) !important;
}
.sts-btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: 8px;
}

/* فرم‌ها */
.sts-form-group {
  margin-bottom: 20px;
}
.sts-form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--dark, #0f172a);
  font-size: 0.95rem;
}
.sts-form-group input[type="text"],
.sts-form-group select,
.sts-form-group textarea {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: var(--bg-light, #f8fafc);
  font-family: inherit;
  font-size: 0.95rem;
  transition: 0.3s;
  color: var(--text-main, #334155);
}
.sts-form-group input[type="text"]:focus,
.sts-form-group select:focus,
.sts-form-group textarea:focus {
  outline: none;
  border-color: var(--primary, #4f46e5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
  background: var(--white, #ffffff);
}
.sts-form-group input[type="file"] {
  padding: 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: var(--bg-light, #f8fafc);
  width: 100%;
  cursor: pointer;
}

/* جدول تیکت‌ها */
.sts-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  margin-top: 20px;
}
.sts-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
}
.sts-table th,
.sts-table td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  font-size: 0.95rem;
}
.sts-table th {
  background: var(--bg-light, #f8fafc);
  color: var(--text-muted, #64748b);
  font-weight: 800;
  font-size: 0.9rem;
}
.sts-table tr:last-child td {
  border-bottom: none;
}
.sts-table tbody tr {
  transition: 0.3s;
}
.sts-table tbody tr:hover {
  background: var(--bg-light, #f8fafc);
}

/* بج‌ها (Badges) */
.sts-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 800;
  border: 1px solid transparent;
}
.sts-open {
  background: #fef2f2;
  color: #ef4444;
  border-color: #fecaca;
}
.sts-answered {
  background: #ecfdf5;
  color: #10b981;
  border-color: #a7f3d0;
}
.sts-closed {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

/* ==========================================================================
   جعبه پیام‌های گفتگوی تیکت (Chat Bubbles)
   ========================================================================== */
.sts-msg-box {
  padding: 15px 20px;
  margin-bottom: 15px;
  line-height: 1.7;
  max-width: 85%;
  position: relative;
  clear: both;
}

.sts-msg-box p {
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.sts-msg-box p:last-child {
  margin-bottom: 0;
}

/* پیام‌های کاربر (فرستنده - سمت راست) */
.sts-user-msg {
  background: var(--white, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  border-radius: 16px 16px 2px 16px; /* گوشه تیز پایین راست */
  margin-left: auto;
  margin-right: 0;
}

/* پیام‌های پشتیبان/ادمین (گیرنده - سمت چپ) */
.sts-admin-msg {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.05);
  border-radius: 16px 16px 16px 2px; /* گوشه تیز پایین چپ */
  margin-right: auto;
  margin-left: 0;
}

/* هدر پیام‌ها */
.sts-msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
  padding-bottom: 10px;
  font-weight: 800;
  color: var(--dark, #0f172a);
  font-size: 0.9rem;
}

.sts-admin-msg .sts-msg-header {
  color: #0369a1;
  border-bottom-color: rgba(14, 165, 233, 0.2);
}

.sts-msg-header span {
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  opacity: 0.8;
}

.sts-admin-msg .sts-msg-header span {
  color: #0284c7;
}

/* لینک ضمیمه‌ها در چت */
.sts-attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main, #334155);
  margin-top: 10px;
  text-decoration: none;
  transition: 0.3s;
}
.sts-attachment-link:hover {
  background: var(--white, #ffffff);
  border-color: var(--primary, #4f46e5);
  color: var(--primary, #4f46e5);
}

/* ==========================================================================
   استایل‌های دکمه شناور و پاپ‌آپ (Modal)
   ========================================================================== */

/* دکمه شناور */
.sts-floating-btn {
  position: fixed;
  bottom: 20px;
  z-index: 9999;
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  color: #fff !important;
  padding: 14px 28px;
  border-radius: 50px;
  text-decoration: none !important;
  font-weight: 800;
  font-family: inherit;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sts-floating-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(79, 70, 229, 0.5);
}
.sts-floating-pos-right {
  right: 25px;
}
.sts-floating-pos-left {
  left: 25px;
}

/* پس‌زمینه محو پاپ‌آپ */
.sts-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  z-index: 10000;
  display: none; /* پیش‌فرض مخفی */
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* باکس اصلی پاپ‌آپ */
.sts-modal-box {
  background: #fff;
  width: 90%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  padding: 30px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  font-family: inherit;
  animation: stsModalFadeIn 0.3s ease-out;
}

/* انیمیشن پاپ‌آپ */
@keyframes stsModalFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* دکمه بستن پاپ‌آپ */
.sts-modal-close {
  position: absolute;
  top: 20px;
  left: 20px; /* سمت چپ برای سایت‌های راست‌چین */
  cursor: pointer;
  font-size: 28px;
  color: #94a3b8;
  line-height: 1;
  transition: 0.2s;
  background: #f1f5f9;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.sts-modal-close:hover {
  color: #ef4444;
  background: #fee2e2;
}

/* نوار پیشرفت آپلود */
.sts-progress-container {
  width: 100%;
  background-color: #f1f5f9;
  border-radius: 8px;
  margin: 15px 0;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.sts-progress-bar {
  width: 0%;
  height: 24px;
  background: linear-gradient(90deg, #10b981, #34d399);
  text-align: center;
  line-height: 24px;
  color: white;
  font-size: 13px;
  font-weight: 800;
  transition: width 0.3s ease;
}
