/* ═══════════════════════════════════════════════
   Instagram Stories WP — Frontend Styles
   ═══════════════════════════════════════════════ */

:root {
  --iswp-gradient: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  --iswp-seen: #ccc;
  --iswp-bg: #000;
  --iswp-radius: 50%;
  --iswp-bubble-size: 72px;
  --iswp-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Bubbles ──────────────────────────────────── */
.iswp-wrap { font-family: var(--iswp-font); }

.iswp-bubbles {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 12px 4px 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.iswp-bubbles::-webkit-scrollbar { display: none; }

.iswp-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: transform .18s ease;
}
.iswp-bubble:hover { transform: scale(1.08); }
.iswp-bubble:focus-visible { outline: 2px solid #0073aa; outline-offset: 4px; border-radius: 4px; }

.iswp-bubble-ring {
  display: block;
  width: var(--iswp-bubble-size);
  height: var(--iswp-bubble-size);
  border-radius: 50%;
  padding: 3px;
  background: var(--iswp-gradient);
}
.iswp-bubble.iswp-seen .iswp-bubble-ring {
  background: var(--iswp-seen);
}
.iswp-bubble-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  display: block;
}

.iswp-bubble-label {
  font-size: 11px;
  color: #333;
  max-width: 72px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Slider style ─────────────────────────────── */
.iswp-slider {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 4px 12px;
  scrollbar-width: none;
}
.iswp-slider::-webkit-scrollbar { display: none; }

.iswp-slide-thumb {
  flex-shrink: 0;
  width: 100px;
  height: 170px;
  border-radius: 12px;
  overflow: hidden;
  border: none;
  cursor: pointer;
  position: relative;
  padding: 0;
  background: #111;
  transition: transform .18s ease, box-shadow .18s ease;
}
.iswp-slide-thumb:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.iswp-slide-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.iswp-slide-thumb span {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 24px 6px 8px;
  font-size: 11px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  text-align: center;
  font-family: var(--iswp-font);
}

/* ── Overlay ──────────────────────────────────── */
.iswp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 99998;
  backdrop-filter: blur(4px);
  animation: iswp-fade-in .2s ease;
}

/* ── Viewer ───────────────────────────────────── */
.iswp-viewer {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(400px, 95vw);
  height: min(710px, 92vh);
  background: #111;
  border-radius: 16px;
  overflow: hidden;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  animation: iswp-pop-in .22s cubic-bezier(.34,1.56,.64,1);
}
.iswp-viewer[hidden] { display: none !important; }

/* Progress bar */
.iswp-viewer-progress {
  position: absolute;
  top: 10px; left: 10px; right: 10px;
  height: 3px;
  background: rgba(255,255,255,.3);
  border-radius: 3px;
  z-index: 10;
  overflow: hidden;
}
.iswp-viewer-bar {
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 3px;
  transition: width linear;
}

/* Close */
.iswp-viewer-close {
  position: absolute;
  top: 18px; right: 14px;
  background: rgba(0,0,0,.45);
  border: none;
  color: #fff;
  font-size: 18px;
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 11;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.iswp-viewer-close:hover { background: rgba(0,0,0,.7); }

/* Prev / Next */
.iswp-viewer-prev,
.iswp-viewer-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 28px;
  width: 40px; height: 60px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 11;
  transition: background .15s;
  display: flex; align-items: center; justify-content: center;
}
.iswp-viewer-prev { left: 6px; }
.iswp-viewer-next { right: 6px; }
.iswp-viewer-prev:hover,
.iswp-viewer-next:hover { background: rgba(255,255,255,.3); }

/* Media area */
.iswp-viewer-media {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}
.iswp-viewer-media img,
.iswp-viewer-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Caption */
.iswp-viewer-caption {
  padding: 10px 16px 14px;
  color: #fff;
  font-size: 13px;
  font-family: var(--iswp-font);
  text-align: center;
  background: rgba(0,0,0,.6);
  min-height: 38px;
}

/* ── Empty state ──────────────────────────────── */
.iswp-empty {
  color: #999;
  font-style: italic;
  font-size: 14px;
}

/* ── Animations ───────────────────────────────── */
@keyframes iswp-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes iswp-pop-in {
  from { opacity: 0; transform: translate(-50%, -48%) scale(.92); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
