/* Webrra Stories — circles row + fullscreen viewer (RTL, responsive) */
.webrra-stories, .webrra-stories * { box-sizing: border-box; }
.webrra-stories { width: 100%; max-width: 100%; margin: 20px auto; font-family: inherit; }

/* ---------------- ردیف دایره‌ها ---------------- */
.webrra-stories-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 6px 2px 12px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.webrra-stories-row::-webkit-scrollbar { display: none; }

.webrra-story-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 84px;
  padding: 0;
  border: 0;
  background: transparent !important;
  background-color: transparent !important;
  cursor: pointer;
  scroll-snap-align: start;
}

.webrra-story-ring {
  --wst-ring: #0071e3;
  width: 74px;
  height: 74px;
  padding: 3px;
  border-radius: 50%;
  background: var(--wst-ring);
  background: linear-gradient(140deg, var(--wst-ring), color-mix(in srgb, var(--wst-ring) 55%, #ffffff));
  transition: transform .2s ease;
}
.webrra-story-item:hover .webrra-story-ring { transform: scale(1.04); }
.webrra-story-item.is-seen .webrra-story-ring { background: #cdd6e2; }

.webrra-story-thumb {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #eef4fb;
}
.webrra-story-thumb img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: cover !important;
  object-position: center center !important;
}

.webrra-story-title {
  max-width: 84px;
  overflow: hidden;
  color: #3a4657;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- نمایشگر تمام‌صفحه ---------------- */
.webrra-stories-viewer {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 20, .93);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease;
}
.webrra-stories-viewer.is-open { opacity: 1; visibility: visible; }

.webrra-story-stage {
  position: relative;
  width: min(440px, 96vw);
  height: min(88vh, 860px);
  overflow: hidden;
  border-radius: 16px;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  touch-action: pan-y;
}

.webrra-story-media { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; background: #000; }
.webrra-story-media img,
.webrra-story-media video {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: #000;
}

/* گرادیانت‌های بالا و پایین برای خوانایی */
.webrra-story-stage::before {
  content: "";
  position: absolute; top: 0; inset-inline: 0; height: 120px; z-index: 3;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.webrra-story-bars {
  position: absolute; top: 10px; inset-inline: 12px; z-index: 5;
  display: flex; gap: 5px;
}
.webrra-story-bar { flex: 1; height: 3px; overflow: hidden; border-radius: 3px; background: rgba(255, 255, 255, .35); }
.webrra-story-bar span { display: block; width: 0; height: 100%; border-radius: 3px; background: #fff; }
.webrra-story-bar.is-done span { width: 100%; }

.webrra-story-topbar {
  position: absolute; top: 22px; inset-inline: 12px; z-index: 6;
  display: flex; align-items: center; gap: 10px; color: #fff;
}
.webrra-story-topbar .ava { flex: 0 0 auto; width: 34px; height: 34px; overflow: hidden; border: 2px solid rgba(255, 255, 255, .7); border-radius: 50%; }
.webrra-story-topbar .ava img { width: 100%; height: 100%; object-fit: cover; }
.webrra-story-topbar .name { font-size: 13px; font-weight: 800; text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.webrra-story-close {
  -webkit-appearance: none !important; appearance: none !important;
  margin: 0 0 0 auto !important; padding: 0 !important;
  width: 36px !important; height: 36px !important; min-width: 36px !important; min-height: 36px !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  border: 0 !important; border-radius: 50% !important;
  background: rgba(0, 0, 0, .42) !important; background-color: rgba(0, 0, 0, .42) !important;
  color: #fff !important; line-height: 0 !important; cursor: pointer;
}
.webrra-story-close svg { display: block !important; width: 18px !important; height: 18px !important; margin: auto !important; flex: 0 0 18px; }

/* نواحی لمسی چپ/راست */
.webrra-story-nav { position: absolute; inset: 0; z-index: 4; display: flex; }
.webrra-story-nav .zone { height: 100%; }
.webrra-story-nav .zone.prev { flex: 0 0 32%; }
.webrra-story-nav .zone.next { flex: 1; }

/* فلش دسکتاپ */
.webrra-story-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 6;
  -webkit-appearance: none !important; appearance: none !important;
  width: 34px !important; height: 34px !important; min-width: 34px !important; min-height: 34px !important;
  margin: 0 !important; padding: 0 !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  border: 1px solid rgba(255, 255, 255, .7) !important; border-radius: 9px !important;
  color: #fff !important; line-height: 0 !important; cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .3) !important;
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}
.webrra-story-arrow:hover { transform: translateY(-50%) scale(1.06); filter: brightness(1.08); box-shadow: 0 8px 20px rgba(0, 0, 0, .38) !important; }
.webrra-story-arrow svg { display: block !important; width: 17px !important; height: 17px !important; margin: auto !important; flex: 0 0 17px; }
.webrra-story-arrow.prev { right: 9px; background: linear-gradient(135deg, #0b78f0, #064da9) !important; background-color: #0b78f0 !important; }
.webrra-story-arrow.next { left: 9px; background: linear-gradient(135deg, #8bc6ff, #398fe6) !important; background-color: #62adf5 !important; }
.webrra-story-arrow[disabled] { opacity: .3; pointer-events: none; }

.webrra-story-cta { position: absolute; bottom: 22px; inset-inline: 0; z-index: 6; display: flex; justify-content: center; }
.webrra-story-cta a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 22px; border-radius: 12px;
  background: #fff; color: #12203a; font-size: 13px; font-weight: 800; text-decoration: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
}
.webrra-story-cta a svg { width: 15px; height: 15px; }

@media (max-width: 560px) {
  .webrra-story-stage { width: 100vw; height: 100vh; border-radius: 0; }
  .webrra-story-arrow { display: inline-flex !important; width: 32px !important; height: 32px !important; min-width: 32px !important; min-height: 32px !important; border-radius: 8px !important; }
  .webrra-story-arrow.prev { right: 7px; }
  .webrra-story-arrow.next { left: 7px; }
}
