/* ===== فونت Font Awesome مخصوص همین بخش (مستقل از FA سایت) ===== */
@font-face {
  font-family: "YS Awesome";
  font-style: normal;
  font-weight: 900;
  font-display: block;
  src: url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/webfonts/fa-solid-900.woff2") format("woff2"),
       url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/webfonts/fa-solid-900.ttf") format("truetype");
}
@font-face {
  font-family: "YS Awesome Regular";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/webfonts/fa-regular-400.woff2") format("woff2"),
       url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/webfonts/fa-regular-400.ttf") format("truetype");
}

/* فقط آیکن‌ها مجبور به استفاده از فونت awesome میشن */
.ys-i, .ys-i::before {
  font-family: "YS Awesome", "Font Awesome 6 Free", "Font Awesome 5 Free" !important;
  font-weight: 900 !important;
  font-style: normal !important;
  font-variant: normal !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
  -webkit-font-smoothing: antialiased;
}
.ys-i { display: inline-block; text-align: center; }
.ys-i.ys-i-heart-o, .ys-i.ys-i-heart-o::before {
  font-family: "YS Awesome Regular", "Font Awesome 6 Free", "Font Awesome 5 Free" !important;
  font-weight: 400 !important;
}
.ys-i-play::before        { content: "\f04b"; }
.ys-i-xmark::before       { content: "\f00d"; }
.ys-i-vol-on::before      { content: "\f028"; }
.ys-i-vol-off::before     { content: "\f6a9"; }
.ys-i-left::before        { content: "\f053"; }
.ys-i-right::before       { content: "\f054"; }
.ys-i-arrow-left::before  { content: "\f060"; }
.ys-i-heart::before,
.ys-i-heart-o::before     { content: "\f004"; }
.ys-i-spinner::before     { content: "\f110"; }
.ys-i-box::before         { content: "\f49e"; }
.ys-i-clap::before        { content: "\e131"; }
.ys-i-cap::before         { content: "\f19d"; }
.ys-i-tags::before        { content: "\f02c"; }
.ys-i-question::before    { content: "\f059"; }
.ys-i-star::before        { content: "\f005"; }
.ys-i-fire::before        { content: "\f06d"; }
.ys-i-gift::before        { content: "\f06b"; }
.ys-i-camera::before      { content: "\f030"; }
.ys-i-bag::before         { content: "\f290"; }
.ys-i-bolt::before        { content: "\f0e7"; }
.ys-i-bell::before        { content: "\f0f3"; }
.ys-i-crown::before       { content: "\f521"; }
.ys-i-percent::before     { content: "\25"; }
.ys-i-truck::before       { content: "\f0d1"; }
.ys-i-newspaper::before   { content: "\f1ea"; }
.ys-i-spinner { animation: ys-rot .9s linear infinite; }
@keyframes ys-rot { to { transform: rotate(360deg); } }

/* ============================================================
   بخش اصلی — همه مقادیر از متغیرهای CSS میان که از پنل تنظیم میشن
   ============================================================ */
.ys-section {
  --ys-ring-1: #ffb23c;
  --ys-ring-2: #ff3d77;
  --ys-ring-3: #8a3cff;
  --ys-seen: #cfd2da;
  --ys-gapc: #ffffff;
  --ys-text: #1c1d22;
  --ys-bg: transparent;
  --ys-radius: 0px;
  --ys-cols: 6;
  --ys-gx: 24px;
  --ys-gy: 32px;
  --ys-lgap: 6px;
  --ys-circle: 150px;
  --ys-max: 1200px;
  --ys-pady: 32px;
  --ys-padx: 16px;
  --ys-justify: center;
  --ys-rw: 4px;
  --ys-gw: 4px;
  --ys-label: 14px;
  --ys-lines: 2;
  --ys-title-size: 30px;
  --ys-title-w: 800;
  --ys-title-color: #1c1d22;
  --ys-sub-size: 15px;
  --ys-sub-color: #6b6f7b;
  --ys-hdr-gap: 28px;
  --ys-align: center;
  --ys-ml: auto;
  --ys-mr: auto;

  direction: rtl;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  width: 100%;
  max-width: var(--ys-max);
  margin: 0 auto;
  padding: var(--ys-pady) var(--ys-padx);
  background: var(--ys-bg);
  border-radius: var(--ys-radius);
  box-sizing: border-box;
}
.ys-section.ys-font-theme,
.ys-section.ys-font-theme .ys-hdr { font-family: inherit; }
.ys-section *, .ys-section *::before, .ys-section *::after,
.ys-modal *, .ys-modal *::before, .ys-modal *::after { box-sizing: border-box; }

/* ---------- عنوان بخش ---------- */
.ys-section .ys-hdr {
  text-align: var(--ys-align);
  margin: 0 0 var(--ys-hdr-gap);
  padding: 0;
}
.ys-section .ys-eyebrow {
  position: relative;
  isolation: isolate;
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 14px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.8;
  color: var(--ys-ring-3);
}
.ys-section .ys-eyebrow::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ys-ring-1), var(--ys-ring-2), var(--ys-ring-3));
  opacity: .14;
  z-index: -1;
}
.ys-section .ys-heading {
  display: block;
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: var(--ys-title-size);
  font-weight: var(--ys-title-w);
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ys-title-color);
}
.ys-section .ys-accent {
  display: block;
  width: 56px;
  height: 4px;
  border-radius: 4px;
  margin: 12px var(--ys-mr) 0 var(--ys-ml);
  background: linear-gradient(90deg, var(--ys-ring-1), var(--ys-ring-2), var(--ys-ring-3));
}
.ys-section .ys-sub {
  max-width: 680px;
  margin: 12px var(--ys-mr) 0 var(--ys-ml);
  padding: 0;
  font-family: inherit;
  font-size: var(--ys-sub-size);
  font-weight: 400;
  line-height: 1.95;
  color: var(--ys-sub-color);
}

/* ---------- شبکه دایره‌ها ---------- */
.ys-section .ys-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: var(--ys-justify);
  gap: var(--ys-gy) var(--ys-gx);
  list-style: none;
  margin: 0;
  padding: 0;
}
.ys-section .ys-item {
  /* ۰.۵ پیکسل کم میشه تا خطای گرد کردن مرورگر ردیف رو نشکنه */
  flex: 0 0 calc((100% - (var(--ys-cols) - 1) * var(--ys-gx)) / var(--ys-cols) - .5px);
  min-width: 0;
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
  opacity: 0;
  transform: translateY(24px) scale(.9);
}
.ys-section .ys-item::marker { content: none; }
.ys-section .ys-item.is-in {
  animation: ys-pop .7s cubic-bezier(.2,.9,.25,1.2) forwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.ys-section.ys-no-anim .ys-item { opacity: 1; transform: none; animation: none; }
@keyframes ys-pop { to { opacity: 1; transform: none; } }

.ys-section .ys-btn {
  all: unset;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ys-lgap);
  width: 100%;
  max-width: var(--ys-circle);
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.ys-section.ys-no-labels .ys-btn { gap: 0; }

/* ---------- حلقه رنگی چرخان ---------- */
.ys-ring {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
}
.ys-ring::before,
.ys-ring::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: conic-gradient(var(--ys-ring-1), var(--ys-ring-2), var(--ys-ring-3), var(--ys-ring-1));
  animation: ys-spin 5s linear infinite;
}
.ys-ring::before { inset: 0; }
.ys-ring::after  { inset: 6px; filter: blur(16px); opacity: 0; transition: opacity .4s; z-index: -1; }
@keyframes ys-spin { to { transform: rotate(360deg); } }
.ys-section.ys-no-spin .ys-ring::before,
.ys-section.ys-no-spin .ys-ring::after { animation: none; }

.ys-cover {
  position: absolute;
  inset: var(--ys-rw);
  border-radius: 50%;
  border: var(--ys-gw) solid var(--ys-gapc);
  background: #e9eaee;
  overflow: hidden;
  z-index: 1;
}
.ys-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  object-fit: cover;
  transition: transform .8s cubic-bezier(.2,.8,.2,1);
}
.ys-ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 30px;
  color: #fff;
  background: linear-gradient(135deg, var(--ys-ring-1), var(--ys-ring-2), var(--ys-ring-3));
}
.ys-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(138,60,255,.45), rgba(255,61,119,.45));
  opacity: 0;
  transition: opacity .35s;
  z-index: 1;
}
.ys-cover::after {
  content: "";
  position: absolute;
  top: -20%; bottom: -20%;
  width: 40%;
  left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-18deg);
  z-index: 2;
}
.ys-hover-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 26px;
  z-index: 3;
  opacity: 0;
  transform: scale(.4);
  transition: opacity .3s, transform .45s cubic-bezier(.2,.9,.25,1.4);
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.35));
}
.ys-hover-play i { margin-right: -4px; }

/* نشان کوچک آیکن پایین دایره */
.ys-badge {
  position: absolute;
  bottom: 2%;
  inset-inline-end: 2%;
  width: 22%;
  min-width: 24px;
  max-width: 34px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ys-ring-2), var(--ys-ring-3));
  color: #fff;
  border: 3px solid var(--ys-gapc);
  display: grid;
  place-items: center;
  font-size: 11px;
  z-index: 3;
  box-shadow: 0 4px 12px rgba(138,60,255,.45);
  transition: transform .4s cubic-bezier(.2,.9,.25,1.4);
}
.ys-badge i { margin-right: -1px; }
.ys-section.ys-no-badge .ys-badge { display: none; }

.ys-section .ys-title {
  display: -webkit-box;
  -webkit-line-clamp: var(--ys-lines);
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  font-size: var(--ys-label);
  font-weight: 600;
  line-height: 1.5;
  color: var(--ys-text);
  transition: color .3s;
}
.ys-section.ys-no-labels .ys-title { display: none; }

@media (hover: hover) {
  .ys-section:not(.ys-no-hover) .ys-btn:hover .ys-ring { transform: translateY(-8px) scale(1.05); }
  .ys-section:not(.ys-no-hover) .ys-btn:hover .ys-ring::after { opacity: .6; }
  .ys-section:not(.ys-no-hover) .ys-btn:hover .ys-img { transform: scale(1.18); }
  .ys-section:not(.ys-no-hover) .ys-btn:hover .ys-cover::before { opacity: 1; }
  .ys-section:not(.ys-no-hover) .ys-btn:hover .ys-cover::after { animation: ys-shine .9s ease; }
  .ys-section:not(.ys-no-hover) .ys-btn:hover .ys-hover-play { opacity: 1; transform: scale(1); }
  .ys-section:not(.ys-no-hover) .ys-btn:hover .ys-badge { transform: scale(0) rotate(-90deg); }
  .ys-section:not(.ys-no-hover) .ys-btn:hover .ys-title { color: var(--ys-ring-3); }
}
@keyframes ys-shine { to { left: 130%; } }
.ys-btn:active .ys-ring { transform: scale(.93); }
.ys-btn:focus-visible .ys-ring { outline: 3px solid var(--ys-ring-3); outline-offset: 5px; border-radius: 50%; }

/* استوری دیده‌شده: حلقه خاکستری و ثابت */
.ys-item.is-seen .ys-ring::before { background: var(--ys-seen); animation: none; }
.ys-item.is-seen .ys-ring::after { display: none; }
.ys-item.is-seen .ys-badge { background: #aeb2bd; box-shadow: none; }

@media (max-width: 768px) {
  .ys-badge { min-width: 22px; font-size: 10px; }
  .ys-hover-play { font-size: 22px; }
  .ys-ph { font-size: 24px; }
}

/* ============================================================
   پنجره پخش
   ============================================================ */
.ys-modal {
  --ys-overlay: rgba(10,10,14,.84);
  --ys-pr: 24px;
  --ys-ph: 88vh;
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  background: rgba(10,10,14,0);
  visibility: hidden;
  direction: rtl;
  font-family: var(--ys-font, "Vazirmatn", Tahoma, sans-serif);
  transition: background .4s, backdrop-filter .4s, visibility 0s .5s;
}
.ys-modal.is-open {
  background: var(--ys-overlay);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  visibility: visible;
  transition: background .4s, backdrop-filter .4s;
}
.ys-ambient {
  position: absolute;
  inset: -10%;
  background-size: cover;
  background-position: center;
  filter: blur(70px) saturate(1.6);
  opacity: 0;
  transition: opacity .6s;
  pointer-events: none;
}
.ys-modal.is-open .ys-ambient { opacity: .45; }

.ys-player {
  --ox: 50%; --oy: 50%;
  position: relative;
  height: min(var(--ys-ph), 820px);
  aspect-ratio: 9 / 16;
  max-width: 94vw;
  border-radius: var(--ys-pr);
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 90px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08);
  transform-origin: var(--ox) var(--oy);
  transform: scale(.12);
  opacity: 0;
  transition: transform .55s cubic-bezier(.2,.9,.25,1), opacity .3s;
}
.ys-modal.is-open .ys-player { transform: scale(1); opacity: 1; }

.ys-video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }

.ys-player::before, .ys-player::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  pointer-events: none;
  z-index: 2;
}
.ys-player::before { top: 0; height: 130px; background: linear-gradient(rgba(0,0,0,.65), transparent); }
.ys-player::after  { bottom: 0; height: 190px; background: linear-gradient(transparent, rgba(0,0,0,.75)); }

/* نوار پیشرفت بخش‌بخش مثل اینستاگرام */
.ys-progress {
  position: absolute;
  top: 12px; left: 14px; right: 14px;
  display: flex;
  gap: 4px;
  z-index: 5;
}
.ys-modal.ys-no-progress .ys-progress { display: none; }
.ys-seg {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: rgba(255,255,255,.3);
  overflow: hidden;
}
.ys-seg > span {
  display: block;
  height: 100%;
  width: 100%;
  background: #fff;
  transform-origin: right center;
  transform: scaleX(0);
}
.ys-seg.is-done > span { transform: scaleX(1); }

.ys-head {
  position: absolute;
  top: 24px; left: 14px; right: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 5;
  color: #fff;
}
.ys-modal.ys-no-progress .ys-head { top: 14px; }
.ys-head-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ys-ring-1), var(--ys-ring-2), var(--ys-ring-3));
  background-size: cover;
  background-position: center;
  flex: none;
  position: relative;
  box-shadow: 0 0 0 2px #fff;
}
.ys-head-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 1px 8px rgba(0,0,0,.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ys-icon-btn {
  all: unset;
  cursor: pointer;
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 15px;
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background .25s, transform .25s;
  -webkit-tap-highlight-color: transparent;
}
.ys-icon-btn:hover { background: rgba(255,255,255,.3); transform: scale(1.08); }
.ys-icon-btn:active { transform: scale(.88); }
.ys-icon-btn:focus-visible, .ys-cta:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* آیکن وسط ویدیو (توقف / لودینگ) */
.ys-center {
  position: absolute;
  top: 50%; left: 50%;
  width: 80px; height: 80px;
  margin: -40px 0 0 -40px;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 28px;
  z-index: 4;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .25s, transform .3s cubic-bezier(.2,.9,.25,1.4);
  pointer-events: none;
}
.ys-center .ys-ic-play { margin-right: -4px; }
.ys-center .ys-ic-load { display: none; }
.ys-player.is-paused .ys-center { opacity: 1; transform: scale(1); }
.ys-player.is-loading .ys-center { opacity: 1; transform: scale(1); }
.ys-player.is-loading .ys-ic-play { display: none; }
.ys-player.is-loading .ys-ic-load { display: block; }

/* قبلی / بعدی */
.ys-nav { position: absolute; top: 50%; margin-top: -19px; z-index: 5; }
.ys-nav.ys-next { left: 10px; }
.ys-nav.ys-prev { right: 10px; }
.ys-nav[hidden] { display: none; }
.ys-modal.ys-no-nav .ys-nav { display: none; }

/* دکمه لینک (CTA) */
.ys-cta {
  position: absolute;
  left: 14px; right: 14px;
  bottom: 72px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background: #fff;
  color: #14151a;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  transition: transform .25s, box-shadow .25s;
}
.ys-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0,0,0,.45); color: #14151a; }
.ys-cta[hidden] { display: none; }
.ys-cta .ys-i { font-size: 12px; }

/* نوار پایین: توضیح + لایک */
.ys-foot {
  position: absolute;
  left: 14px; right: 14px; bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 5;
  color: #fff;
}
.ys-foot-text {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.7;
  text-shadow: 0 1px 10px rgba(0,0,0,.6);
}
.ys-modal.ys-no-like .ys-like { display: none; }
.ys-like.is-liked { color: #ff3d77; background: rgba(255,255,255,.95); }
.ys-like.is-liked .ys-i { animation: ys-beat .5s cubic-bezier(.2,.9,.25,1.6); }
@keyframes ys-beat { 0%{transform:scale(.4)} 60%{transform:scale(1.45)} 100%{transform:scale(1)} }

/* قلب بزرگ وسط ویدیو با دابل‌کلیک */
.ys-burst {
  position: absolute;
  top: 50%; left: 50%;
  margin: -45px 0 0 -45px;
  font-size: 90px;
  color: #ff3d77;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 8px 24px rgba(255,61,119,.6));
}
.ys-burst.is-go { animation: ys-burst .8s ease-out; }
@keyframes ys-burst {
  0% { opacity: 0; transform: scale(.3); }
  25% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0; transform: scale(1.5) translateY(-40px); }
}

.ys-modal.is-open .ys-head,
.ys-modal.is-open .ys-foot,
.ys-modal.is-open .ys-cta { animation: ys-fade .5s .3s both; }
@keyframes ys-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* موبایل: تمام‌صفحه */
@media (max-width: 768px) {
  .ys-player {
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    max-width: 100vw;
    aspect-ratio: auto;
    border-radius: 0;
  }
  .ys-modal.is-open { background: #000; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .ys-ambient { display: none; }
  .ys-progress { top: calc(12px + env(safe-area-inset-top, 0px)); }
  .ys-head { top: calc(24px + env(safe-area-inset-top, 0px)); }
  .ys-modal.ys-no-progress .ys-head { top: calc(14px + env(safe-area-inset-top, 0px)); }
  .ys-foot { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .ys-cta { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .ys-section *, .ys-section *::before, .ys-section *::after,
  .ys-modal, .ys-player { animation-duration: .01s !important; transition-duration: .01s !important; animation-iteration-count: 1 !important; }
  .ys-section .ys-item { opacity: 1; transform: none; }
}
