


/* ── Highlights (Instagram profile style) ─────────────────────── */
.highlight-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  transition: transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.highlight-circle:hover { transform: scale(1.05); }
.highlight-circle:active { transform: scale(0.95); }
.highlight-circle:focus-visible .highlight-ring {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.highlight-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.highlight-cover {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  background-size: cover;
  background-position: center;
  color: #fff;
  overflow: hidden;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

.highlight-cover-icon { font-size: 1.5rem; line-height: 1; }
.highlight-cover-text { font-size: 0.85rem; font-weight: 800; letter-spacing: -0.5px; }

.highlight-name {
  font-size: 0.65rem;
  color: #475569;
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  line-height: 1.3;
  font-weight: 600;
}

@media (min-width: 768px) {
  .highlight-ring { width: 76px; height: 76px; }
  .highlight-cover { width: 70px; height: 70px; }
  .highlight-name { font-size: 0.7rem; max-width: 84px; }
}


/* ===================================================================
   Stories Bar + Viewer Styles
   Mobile-first, RTL-aware, dark overlay viewer, 16:9 cards
   =================================================================== */

/* ── Stories Bar ─────────────────────────────────────────────────── */
.stories-bar {
  margin: 0 auto;
  max-width: 80rem;
  padding: 0.75rem 1rem;
  position: relative;
  z-index: 40;
}

.stories-bar-inner {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
}

.stories-track {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.25rem 0.5rem;
  flex: 1;
}

.stories-track::-webkit-scrollbar { display: none; }

/* ── Story Circle Thumbnail ──────────────────────────────────────── */
.story-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  transition: transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.story-circle:focus-visible .story-ring {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.story-circle:not(.watched) .story-ring {
  animation: ringPulse 2.2s ease-in-out infinite;
}

.story-circle:hover { transform: scale(1.05); }
.story-circle:active { transform: scale(0.95); }

/* Ring around thumbnail */
.story-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 3px;
  transition: opacity 0.3s;
}


/* Inner circle (gradient/image background) */
.story-thumb {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  color: #fff;
  overflow: hidden;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

.story-thumb-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.story-thumb-text {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.story-label {
  font-size: 0.65rem;
  color: #475569;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  line-height: 1.3;
}

/* ── Scroll Buttons ──────────────────────────────────────────────── */
.stories-scroll-btn {
  display: none; /* hidden on mobile; shown on desktop via media */
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  z-index: 1;
}

.stories-scroll-btn:hover {
  background: #f8fafc;
  color: #1e293b;
  border-color: #cbd5e1;
}

.stories-scroll-btn:active { transform: scale(0.9); }

@media (min-width: 768px) {
  .stories-scroll-btn { display: flex; }
  .story-ring { width: 76px; height: 76px; }
  .story-thumb { width: 70px; height: 70px; }
  .story-label { font-size: 0.7rem; max-width: 150px; }
}





/* ===================================================================
   Story Viewer — Full-Screen Overlay
   =================================================================== */
.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.story-viewer.open {
  opacity: 1;
  pointer-events: auto;
}

/* Dark backdrop */
.story-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* ── Card Container (16:9) ──────────────────────────────────────── */
.story-viewer-card {
  position: relative;
  width: min(92vw, 480px);
  aspect-ratio: 9/16;
  max-height: 85vh;
  border-radius: 1.25rem;
  overflow: hidden;
  z-index: 2;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 80px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.08);
  animation: storyCardIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes storyCardIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes storyCardOut {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to   { opacity: 0; transform: scale(0.9) translateY(30px); }
}

.story-viewer-card.close-anim {
  animation: storyCardOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ── Loading Skeleton ────────────────────────────────────────────── */
.story-skeleton {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem 2rem 2rem;
  background: linear-gradient(135deg, #1e293b, #334155);
  border-radius: 1.25rem;
}

.skeleton-bar {
  border-radius: 0.5rem;
  background: linear-gradient(90deg, rgba(255,255,255,.06) 25%, rgba(255,255,255,.12) 50%, rgba(255,255,255,.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  margin-bottom: 0.5rem;
}

.skeleton-title {
  width: 60%;
  height: 1.4rem;
  border-radius: 0.4rem;
}

.skeleton-text {
  width: 80%;
  height: 0.75rem;
  border-radius: 0.35rem;
}

.skeleton-text-1 { width: 80%; }
.skeleton-text-2 { width: 65%; }
.skeleton-text-3 { width: 45%; }

.skeleton-btn {
  width: 10rem;
  height: 2.4rem;
  border-radius: 2rem;
  margin-top: 0.75rem;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes ringPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 43, 120, 0.4); }
  50%      { transform: scale(1.06); box-shadow: 0 0 12px 2px rgba(37, 43, 120, 0.15); }
}

/* ── Progress Track ──────────────────────────────────────────────── */
.story-progress-track {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 4px;
  z-index: 5;
}

.story-progress-seg {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,.25);
  overflow: hidden;
}

.story-progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 2px;
  width: 0;
  transition: width 0.1s linear;
}

.story-progress-seg.done .story-progress-fill { width: 100%; background: rgba(255,255,255,.7); }
.story-progress-seg.active .story-progress-fill { background: #fff; }
.story-progress-seg.paused .story-progress-fill { animation-play-state: paused; }

/* ── Header (counter + close) ────────────────────────────────────── */
.story-viewer-header {
  position: absolute;
  top: 1.25rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
}

.story-viewer-counter {
  color: rgba(255,255,255,.7);
  font-size: 0.75rem;
  font-weight: 600;
}

.story-viewer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.story-viewer-close:hover { background: rgba(255,255,255,.2); }

/* ── Body (gradient card content) ────────────────────────────────── */
.story-viewer-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem 1.5rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  transition: background 0.4s ease;
}

.story-viewer-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: .85;
  line-height: 1;
}

.story-viewer-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 0.75rem;
  line-height: 1.4;
}

.story-viewer-text {
  font-size: 0.9rem;
  line-height: 1.9;
  opacity: .9;
  margin: 0;
  max-width: 360px;
  white-space: pre-line;
}

/* CTA link button */
.story-viewer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  padding: 0.6rem 1.5rem;
  border-radius: 2rem;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  border: 1.5px solid rgba(255,255,255,.25);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.story-viewer-link:hover {
  background: rgba(255,255,255,.28);
  border-color: rgba(255,255,255,.4);
  transform: translateY(-1px);
}

/* ── Actions Bar (Like + Share) ──────────────────────────────────── */
.story-viewer-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(0,0,0,.25);
  z-index: 5;
}

.story-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,.1);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}

.story-action:hover { background: rgba(255,255,255,.18); }
.story-action:active { transform: scale(0.95); }

.story-like-btn.liked {
  color: #ef4444;
  background: rgba(239,68,68,.2);
}

.story-like-btn.liked i { color: #ef4444; }

/* ── Navigation Tap Zones ────────────────────────────────────────── */
.story-nav-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 25%;
  z-index: 4;
  background: transparent;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.story-nav-prev { left: 0; }
.story-nav-next { right: 0; }

/* ── Like Heart Animation ────────────────────────────────────────── */
.story-like-heart {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 10000;
  pointer-events: none;
  font-size: 5rem;
  color: #ef4444;
  opacity: 0;
  transition: none;
}

.story-like-heart.pop {
  animation: heartPop 0.7s ease forwards;
}

@keyframes heartPop {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.3); }
  30%  { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
  60%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (min-width: 640px) {
  .story-viewer-card {
    width: min(70vw, 420px);
    border-radius: 1.5rem;
  }
  .story-viewer-body { padding: 3.5rem 2rem 2rem; }
  .story-viewer-title { font-size: 1.5rem; }
  .story-viewer-text { font-size: 1rem; }
  .story-viewer-icon { font-size: 3.5rem; }
}

@media (min-width: 1024px) {
  .story-viewer-card {
    width: min(40vw, 400px);
  }
}

/* ── Swipe Visual Feedback Arrows ────────────────────────────────── */
.swipe-arrow {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  opacity: 0;
  pointer-events: none;
  z-index: 6;
  will-change: transform, opacity;
}

.swipe-arrow-prev { left: 16px; }
.swipe-arrow-next { right: 16px; }

/* ── Visible Arrow Navigation Buttons ─────────────────────────────── */
.story-arrow-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s, opacity 0.3s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  opacity: 0;
  pointer-events: none;
}

.story-viewer.open .story-arrow-btn {
  opacity: 1;
  pointer-events: auto;
}

.story-arrow-btn:hover {
  background: rgba(255,255,255,.25);
  transform: translateY(-50%) scale(1.1);
}

.story-arrow-btn:active {
  transform: translateY(-50%) scale(0.9);
  background: rgba(255,255,255,.35);
}

.story-arrow-prev { left: calc((100vw - min(92vw, 480px)) / 2 - 54px); }
.story-arrow-next { right: calc((100vw - min(92vw, 480px)) / 2 - 54px); }

/* On narrow screens, put arrows inside the card edges */
@media (max-width: 600px) {
  .story-arrow-prev { left: 4px; }
  .story-arrow-next { right: 4px; }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  .story-viewer-card,
  .story-viewer-card.close-anim,
  .story-circle,
  .story-like-heart { animation: none !important; }
  .story-circle:not(.watched) .story-ring { animation: none; }
  .story-viewer { transition: none !important; }
  .swipe-arrow { display: none !important; }
}
