/* ==================== اسلایدر پویش‌ها (صفحه‌ی اصلی اعضا + صفحه‌ی صندوق‌های مالک) ==================== */
/* مستقل از پوسته‌ی برنامه است (رنگ‌ها داخل خودش)؛ همه‌جا یک‌شکل دیده می‌شود. */
.cs, .cs * { box-sizing: border-box; }
.cs {
  --cs-red: #ef4444; --cs-gold: #f5c542; --cs-gold2: #e0a912;
  position: relative; width: 100%; aspect-ratio: 16 / 7; min-height: 200px; max-height: 340px;
  border-radius: 22px; overflow: hidden; isolation: isolate; direction: rtl; text-align: right;
  background: linear-gradient(135deg, #0f6b34, #0b4a25); color: #fff; cursor: pointer;
  box-shadow: 0 16px 36px -18px rgba(11, 74, 37, .6), 0 0 0 1px rgba(255, 255, 255, .06) inset;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; touch-action: pan-y;
  font-family: Vazirmatn, Tahoma, sans-serif; line-height: 1.6;
}
@media (max-width: 560px) { .cs { aspect-ratio: 4 / 3; max-height: 300px; border-radius: 20px; } }
.cs:focus-visible { outline: 3px solid var(--cs-gold); outline-offset: 2px; }

.cs-stage { position: absolute; inset: 0; }
.cs-slide { position: absolute; inset: 0; visibility: hidden; overflow: hidden; }
.cs-slide.is-active, .cs-slide.is-in, .cs-slide.is-out { visibility: visible; }
.cs-slide.is-active { z-index: 2; }
.cs-slide.is-out { z-index: 2; }
.cs-slide.is-in { z-index: 3; }

.cs-bg { position: absolute; inset: -3%; background: linear-gradient(135deg, #1faa59, #0b4a25) center / cover no-repeat; will-change: transform; }
.cs-bg.noimg::after { content: "❤"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 96px; color: rgba(255, 255, 255, .16); }
.cs-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .28) 0%, rgba(0, 0, 0, 0) 32%, rgba(4, 22, 12, .55) 62%, rgba(4, 22, 12, .93) 100%); }

/* ---- حرکت آرام تصویر در حالت عادی (با نگه‌داشتن موس متوقف می‌شود) ---- */
.cs-slide.is-active .cs-bg { animation: cs-kb 9s ease-out both; }
.cs.is-paused .cs-bg { animation-play-state: paused; }
@keyframes cs-kb { from { transform: scale(1.04); } to { transform: scale(1.13) translate(-1%, -1%); } }

/* ---- محو شدن پویش قبلی: ذوب شدن در نور (بزرگ‌شدن، تاری و روشن‌شدن) ---- */
.cs-slide.is-out { animation: cs-dissolve .95s cubic-bezier(.5, 0, .75, 0) both; }
@keyframes cs-dissolve {
  0%   { opacity: 1; transform: scale(1);    filter: blur(0)    brightness(1)   saturate(1); }
  100% { opacity: 0; transform: scale(1.16); filter: blur(14px) brightness(1.7) saturate(1.7); }
}

/* ---- ظاهر شدن پویش بعدی: باز شدن دایره‌ای از یک نقطه + فرود تصویر + جرقه‌ی طلایی + ورود متن ---- */
.cs-slide.is-in { animation: cs-reveal 1.2s cubic-bezier(.22, .8, .2, 1) both; }
@keyframes cs-reveal {
  from { clip-path: circle(0% at var(--ox, 50%) var(--oy, 50%)); }
  to   { clip-path: circle(150% at var(--ox, 50%) var(--oy, 50%)); }
}
.cs-slide.is-in .cs-bg { animation: cs-land 1.7s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes cs-land {
  from { transform: scale(1.45) rotate(1.2deg); filter: blur(12px) brightness(1.5); }
  to   { transform: scale(1.04) rotate(0);      filter: blur(0)    brightness(1); }
}
.cs-shine { position: absolute; top: -20%; bottom: -20%; width: 34%; left: -50%; z-index: 4; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, transparent, rgba(255, 244, 200, .0) 20%, rgba(255, 230, 140, .55) 50%, rgba(255, 244, 200, 0) 80%, transparent);
  transform: skewX(-18deg); }
.cs-slide.is-in .cs-shine { animation: cs-sweep 1.1s .3s ease-out both; }
@keyframes cs-sweep { 0% { left: -50%; opacity: 0; } 15% { opacity: 1; } 100% { left: 130%; opacity: 0; } }

.cs-sp { position: absolute; z-index: 4; width: 9px; height: 9px; pointer-events: none; opacity: 0; color: var(--cs-gold);
  left: var(--x, 50%); top: var(--y, 50%); }
.cs-sp::before { content: "✦"; position: absolute; inset: 0; font-size: var(--s, 14px); line-height: 1; transform: translate(-50%, -50%); text-shadow: 0 0 10px rgba(245, 197, 66, .9); }
.cs-slide.is-in .cs-sp { animation: cs-spark 1.3s var(--d, .2s) ease-out both; }
@keyframes cs-spark { 0% { opacity: 0; transform: translate(0, 10px) scale(.2); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--tx, 0), var(--ty, -40px)) scale(1.1) rotate(80deg); } }

.cs-slide.is-in .cs-up { animation: cs-rise .8s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(.45s + var(--i, 0) * .09s); }
@keyframes cs-rise { from { opacity: 0; transform: translateY(22px); filter: blur(4px); } to { opacity: 1; transform: none; filter: blur(0); } }

/* ---- متن روی عکس ---- */
.cs-cap { position: absolute; z-index: 3; inset: auto 0 0 0; padding: 0 20px 26px; display: flex; flex-direction: column; gap: 8px; }
.cs-title { margin: 0; font-size: clamp(17px, 3.6vw, 26px); font-weight: 800; line-height: 1.45; text-shadow: 0 2px 14px rgba(0, 0, 0, .55); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cs-desc { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .86); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 560px) { .cs-desc { display: none; } }
.cs-pg { display: flex; align-items: center; gap: 10px; }
.cs-pct { font-weight: 800; font-size: 15px; color: var(--cs-gold); white-space: nowrap; }
.cs-bar { flex: 1; height: 9px; border-radius: 99px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.cs-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #f6cf55, var(--cs-gold2)); box-shadow: 0 0 12px rgba(245, 197, 66, .8); transition: width .9s ease; }
.cs-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12px; color: rgba(255, 255, 255, .9); }
.cs-meta span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.cs-cta { margin-inline-start: auto; background: linear-gradient(135deg, #f6cf55, var(--cs-gold2)); color: #3b2a00; font-weight: 800; font-size: 12.5px; padding: 5px 14px; border-radius: 99px; box-shadow: 0 6px 16px -6px rgba(224, 169, 18, .9); }

.cs-badge { position: absolute; z-index: 5; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 14px; border-radius: 99px; font-size: 12px; font-weight: 700;
  background: rgba(0, 0, 0, .38); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .18); }
.cs-badge b { color: var(--cs-red); font-size: 15px; line-height: 1; animation: cs-beat 1.6s ease-in-out infinite; display: inline-block; text-shadow: 0 0 10px rgba(239, 68, 68, .7); }
@keyframes cs-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.3); } 30% { transform: scale(1); } 45% { transform: scale(1.18); } }
.cs-count { position: absolute; z-index: 5; top: 12px; left: 12px; font-size: 12px; padding: 4px 11px; border-radius: 99px; background: rgba(0, 0, 0, .38); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .18); }

.cs-dots { position: absolute; z-index: 5; left: 0; right: 0; bottom: 9px; display: flex; justify-content: center; gap: 7px; pointer-events: none; }
.cs-dot { pointer-events: auto; width: 8px; height: 8px; border-radius: 99px; border: 0; padding: 0; background: rgba(255, 255, 255, .45); cursor: pointer; transition: width .3s, background .3s; }
.cs-dot::after { content: ""; position: absolute; inset: -8px; }
.cs-dot { position: relative; }
.cs-dot.on { width: 24px; background: var(--cs-gold); }
.cs-timer { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .15); }
.cs-timer i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f6cf55, var(--cs-gold2)); float: right; }
.cs.is-paused .cs-timer i { background: linear-gradient(90deg, #fff, #ddd); }

/* ---- بدون پویش ---- */
.cs-empty { aspect-ratio: auto; min-height: 0; max-height: none; cursor: default; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 26px 18px; text-align: center;
  background: rgba(127, 154, 136, .1); color: inherit; border: 1.5px dashed rgba(127, 154, 136, .55); box-shadow: none; }
.cs-empty .cs-ei { font-size: 26px; filter: grayscale(.3); }
.cs-empty b { display: block; font-size: 14.5px; }
.cs-empty small { display: block; opacity: .75; font-size: 12px; }

/* ---- کاهش حرکت (تنظیم دسترسی‌پذیری دستگاه): فقط محو ساده ---- */
@media (prefers-reduced-motion: reduce) {
  .cs-slide.is-active .cs-bg, .cs-slide.is-in .cs-bg, .cs-slide.is-in .cs-shine, .cs-slide.is-in .cs-sp, .cs-badge b { animation: none; }
  .cs-slide.is-in { animation: cs-fade .6s both; }
  .cs-slide.is-out { animation: cs-fade-out .6s both; }
  .cs-slide.is-in .cs-up { animation: cs-fade .6s both; }
  @keyframes cs-fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes cs-fade-out { from { opacity: 1; } to { opacity: 0; } }
}
