/* ==============================================
   Share Moment — 9:16 Instagram/TikTok Canvas
   ============================================== */

/* ── Share Moment Modal Overlay ── */

/* ── 9:16 Canvas Wrapper (the thing we capture) ── */

/* ── Background Layer ── */

/* ── Content Layer ── */

/* ── Header ── */

.sm-char-name {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 18px;
  font-weight: 700;
  color: #f5f0ff;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

/* ── Messages Scroll Area ── */
.sm-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 2px 6px;
  scrollbar-width: none;
}

.sm-messages::-webkit-scrollbar { display: none; }

/* ── Message Bubbles ── */
.sm-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: smFadeIn 0.3s ease both;
}

.sm-msg.assistant {
  align-self: flex-start;
  align-items: flex-start;
}

.sm-msg.user {
  align-self: flex-end;
  align-items: flex-end;
}

.sm-bubble {
  position: relative;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 11.5px;
  line-height: 1.55;
  font-family: 'Georgia', 'Times New Roman', serif;
  word-break: break-word;
}

.sm-msg.assistant .sm-bubble {
  background: rgba(30,30,40,0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom-left-radius: 18px;
  color: #e2d8f0;
  font-style: italic;
}

.sm-msg.user .sm-bubble {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-bottom-right-radius: 18px;
  color: #f5f0ff;
}

.sm-bubble-sparkle {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 8px;
  color: #c084fc;
  opacity: 0.7;
}

.sm-timestamp {
  font-size: 8.5px;
  color: rgba(255,255,255,0.3);
  margin-top: 3px;
  padding: 0 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: 0.3px;
}

/* ── Divider ── */

/* ── Footer ── */

/* ── Preview Modal Action Buttons ── */

/* ── Selection Mode Styles ── */

/* Selection bar at bottom of chat */
#shareMomentBar {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  display: none;
  align-items: center;
  gap: 10px;
  background: #1a1a2e;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 16px;
  padding: 8px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

#shareMomentBar.active {
  display: flex;
}

#shareMomentBar .sm-count {
  font-size: 12px;
  color: #c4b5fd;
  font-weight: 600;
  min-width: 60px;
  text-align: center;
}

/* Selection check circles on message bubbles */
.msg-select-circle {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  background: rgba(20,20,30,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all 0.15s;
}

.selecting .msg-select-circle {
  display: flex;
}

.msg-select-circle.selected {
  border-color: var(--accent);
  background: var(--accent);
}

.msg-select-circle.selected::after {
  content: '✓';
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.selecting .msg {
  user-select: none;
}

.selecting .msg-actions {
  pointer-events: none;
  opacity: 0.3;
}

.selecting .bubble {
  cursor: pointer;
}

/* ── Loading / Generating State ── */

@keyframes smSpin { to { transform: rotate(360deg); } }
@keyframes smFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Responsive: scale up on larger screens ── */
@media (min-width: 420px) {
}

@media (min-width: 520px) {
}

/* ==============================================
   Purple Chasing Spinner — dual-ring pulse
   ============================================== */

/* Back ring — steady slow */

/* Front ring — surges ahead then holds */

@keyframes verseSpinBack {
  to { transform: rotate(360deg); }
}

@keyframes verseSpinFront {
  0%   { transform: rotate(0deg); }
  35%  { transform: rotate(420deg); }  /* surge ahead fast */
  65%  { transform: rotate(420deg); }  /* hold, let back catch up */
  100% { transform: rotate(720deg); }  /* complete the lap */
}

/* ── Avatar wrapper with spinner ── */

/* Letter avatar (no image) — show spinner briefly then reveal */

@keyframes letterReveal {
  to { opacity: 1; }
}

/* Small spinner variant for tiny avatars */

/* ── Homepage Skeleton Loading ── */

@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Content fade-in after skeleton */

/* Skeleton wrapper — positioned to overlap real content during crossfade */
