/* ============================================================
   VELORA — Stories, Creator Goals & Web Push styles
   ============================================================ */

/* ── Story rings (feed row) ──────────────────────────────── */
.stories-section { margin-bottom: 1.5rem; }

.stories-scroll {
  display: flex;
  gap: .85rem;
  overflow-x: auto;
  padding: .25rem .1rem .75rem;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}
.stories-scroll::-webkit-scrollbar { display: none; }

.story-item, .story-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  flex-shrink: 0;
  scroll-snap-align: start;
}

/* Avatar ring */
.story-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform .2s;
}
.story-ring:hover { transform: scale(1.06); }

.story-ring.seen {
  background: var(--border);
}

.story-ring-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg2);
  border: 2.5px solid var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  overflow: hidden;
}
.story-ring-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Live badge on story */
.story-live-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid var(--bg);
  animation: story-pulse 1.4s infinite;
}
@keyframes story-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
  50%       { box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

.story-name {
  font-size: .7rem;
  font-weight: 600;
  color: var(--text2);
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* Add story button */
.story-add-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--card);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text3);
  transition: border-color .2s, color .2s;
}
.story-add:hover .story-add-ring {
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Full-screen story viewer ────────────────────────────── */
.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  flex-direction: column;
}

/* Progress bars */
.story-progress-row {
  display: flex;
  gap: 4px;
  padding: .6rem .75rem .3rem;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

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

.story-progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 2px;
  width: 0%;
  transition: none;
}
.story-progress-fill.done   { width: 100%; }
.story-progress-fill.active { width: 0%; }

/* Story header */
.story-header {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 2.25rem .75rem .5rem;
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(0,0,0,.6) 0%, transparent 100%);
}

.story-header-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .88rem;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.4);
}

.story-header-info { flex: 1; }
.story-header-name {
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
}
.story-header-time {
  font-size: .72rem;
  color: rgba(255,255,255,.65);
}

.story-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.35rem;
  cursor: pointer;
  padding: .25rem;
  line-height: 1;
  opacity: .85;
}
.story-close-btn:hover { opacity: 1; }

/* Story media area */
.story-media {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.story-media img,
.story-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-text-card {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.story-text-content {
  font-size: clamp(1.3rem, 5vw, 2rem);
  font-weight: 800;
  line-height: 1.35;
  word-break: break-word;
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
}

/* Tap zones */
.story-tap-left,
.story-tap-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 35%;
  z-index: 5;
  cursor: pointer;
}
.story-tap-left  { left: 0; }
.story-tap-right { right: 0; }

/* Footer */
.story-footer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 1.25rem .75rem calc(env(safe-area-inset-bottom) + 1rem);
  background: linear-gradient(to top, rgba(0,0,0,.65) 0%, transparent 100%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: .65rem;
}

.story-views-label {
  font-size: .78rem;
  color: rgba(255,255,255,.7);
  display: flex;
  align-items: center;
  gap: .3rem;
}

/* Story composer (modal) */
.story-compose-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.story-type-tabs {
  display: flex;
  gap: .5rem;
}

.story-type-tab {
  flex: 1;
  padding: .55rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg2);
  color: var(--text2);
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all .18s;
}
.story-type-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.story-bg-colors {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
}
.story-bg-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform .15s, border-color .15s;
}
.story-bg-swatch:hover { transform: scale(1.15); }
.story-bg-swatch.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--primary); }

.story-preview-box {
  height: 180px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1.4;
  overflow: hidden;
  position: relative;
}

/* ── Creator Goals ────────────────────────────────────────── */
.goals-page { max-width: 700px; }

.goal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: .85rem;
  transition: border-color .2s;
}
.goal-card:hover { border-color: var(--primary); }

.goal-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: .85rem;
}

.goal-type-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: .22rem .6rem;
  border-radius: 20px;
  margin-bottom: .35rem;
}

.goal-title {
  font-size: .95rem;
  font-weight: 800;
  color: var(--text1);
}
.goal-desc {
  font-size: .82rem;
  color: var(--text3);
  margin-top: .15rem;
}

.goal-progress-wrap { margin-top: .75rem; }
.goal-progress-bar-bg {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin: .4rem 0;
}
.goal-progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .6s ease;
  min-width: 4px;
}

.goal-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
}
.goal-current { color: var(--primary); font-weight: 700; }
.goal-target   { color: var(--text3); }

.goal-achieved-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  font-weight: 700;
  color: #22c55e;
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.25);
  padding: .2rem .6rem;
  border-radius: 20px;
  margin-top: .5rem;
}

.goal-reward {
  font-size: .82rem;
  color: var(--text2);
  margin-top: .5rem;
  padding: .55rem .75rem;
  background: rgba(168,85,247,.08);
  border: 1px solid rgba(168,85,247,.2);
  border-radius: 8px;
}
.goal-reward::before { content: '🎁 '; }

.goal-actions {
  display: flex;
  gap: .5rem;
  margin-top: .85rem;
}

/* Goal form */
.goal-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .5rem;
  margin-top: .5rem;
}
.goal-type-btn {
  padding: .65rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg2);
  color: var(--text2);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all .18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
}
.goal-type-btn .goal-type-icon { font-size: 1.25rem; }
.goal-type-btn:hover,
.goal-type-btn.selected {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(168,85,247,.08);
}

/* Push notification banner */
.push-banner {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1.1rem;
  background: linear-gradient(135deg, rgba(168,85,247,.1), rgba(236,72,153,.1));
  border: 1px solid rgba(168,85,247,.25);
  border-radius: 14px;
  margin-bottom: 1.25rem;
}
.push-banner-icon { font-size: 1.5rem; flex-shrink: 0; }
.push-banner-text { flex: 1; }
.push-banner-title { font-size: .88rem; font-weight: 700; color: var(--text1); }
.push-banner-desc  { font-size: .78rem; color: var(--text3); margin-top: .1rem; }
.push-banner-btn   { flex-shrink: 0; }

@media (max-width: 768px) {
  .story-ring { width: 52px; height: 52px; }
  .story-add-ring { width: 52px; height: 52px; }
}
