/* ═══════════════════════════════════════════════
   KOVAT Moments CSS — WS3-003
   Disappearing stories (24h), friend-only feed
   ═══════════════════════════════════════════════ */

/* ── Moments Strip (Chat tab top) ── */
.moments-strip {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--border, #2A2A38);
  margin-bottom: 4px;
}
.moments-strip::-webkit-scrollbar { height: 0; }

.moment-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
  min-width: 68px;
}
.moment-bubble .moment-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, var(--accent-blue, #4A7AFF), var(--accent-purple, #8B5CF6));
  transition: transform 200ms ease;
}
.moment-bubble:hover .moment-ring { transform: scale(1.08); }
.moment-bubble.unviewed .moment-ring {
  background: linear-gradient(135deg, var(--accent-yellow, #EAB308), var(--accent-purple, #8B5CF6));
}
.moment-bubble .moment-ring img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--primary-bg, #050507);
  object-fit: cover;
}
.moment-bubble .moment-name {
  font-size: 11px;
  color: var(--text-secondary, #9090A8);
  max-width: 68px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.moment-add-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px dashed var(--border, #2A2A38);
  background: var(--surface-raised, #1A1A22);
  color: var(--accent-blue, #4A7AFF);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms ease;
}
.moment-add-btn:hover {
  border-color: var(--accent-blue, #4A7AFF);
  background: rgba(74,122,255,0.1);
}

/* ── Moment Viewer Modal ── */
.moment-viewer {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  animation: momentFadeIn 300ms ease;
}
.moment-viewer .moment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
}
.moment-viewer .moment-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.moment-viewer .moment-user img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.moment-viewer .moment-user .moment-user-name {
  color: #fff;
  font-weight: 600;
  font-size: 15px;
}
.moment-viewer .moment-user .moment-time {
  color: rgba(255,255,255,0.7);
  font-size: 12px;
}
.moment-viewer .moment-close {
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 200ms ease;
}
.moment-viewer .moment-close:hover { background: rgba(255,255,255,0.2); }

/* Progress bar at top */
.moment-progress {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.15);
  z-index: 11;
}
.moment-progress-bar {
  height: 100%;
  background: #fff;
  transition: width 100ms linear;
}

/* Media area */
.moment-media {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.moment-media img,
.moment-media video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.moment-caption {
  position: absolute;
  bottom: 80px;
  left: 16px;
  right: 16px;
  color: #fff;
  font-size: 15px;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.moment-mood {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 48px;
}

/* Bottom actions */
.moment-actions {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px 16px 32px;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
}
.moment-reply-input {
  flex: 1;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 24px;
  padding: 10px 16px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 200ms ease;
}
.moment-reply-input::placeholder { color: rgba(255,255,255,0.5); }
.moment-reply-input:focus { border-color: var(--accent-blue, #4A7AFF); }

.moment-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 200ms ease;
  flex-shrink: 0;
}
.moment-action-btn:hover { background: rgba(255,255,255,0.2); }
.moment-action-btn.reacted { color: var(--accent-yellow, #EAB308); }

/* Emoji picker in viewer */
.moment-emoji-picker {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  background: rgba(0,0,0,0.8);
  padding: 8px 14px;
  border-radius: 24px;
  z-index: 12;
}
.moment-emoji-picker button {
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  transition: transform 150ms ease;
}
.moment-emoji-picker button:hover { transform: scale(1.3); }

/* Viewers list */
.moment-viewers-list {
  position: absolute;
  bottom: 80px;
  left: 16px;
  right: 16px;
  max-height: 200px;
  overflow-y: auto;
  background: rgba(0,0,0,0.85);
  border-radius: 12px;
  padding: 12px;
  z-index: 12;
}
.moment-viewers-list .viewer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  color: #fff;
  font-size: 14px;
}
.moment-viewers-list .viewer-row img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

/* Swipe hint */
.moment-swipe-hint {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 9;
}
.moment-swipe-hint span {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.3);
  transition: background 200ms ease;
}
.moment-swipe-hint span.active { background: #fff; }

/* Delete button */
.moment-delete-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
}
.moment-delete-btn:hover { color: var(--accent-red, #EF4444); }

/* ── Create Moment Modal ── */
.moment-create-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  animation: modalFadeIn 200ms ease;
}
.moment-create-modal .create-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  color: #fff;
}
.moment-create-modal .create-header h3 { font-size: 18px; }
.moment-create-modal .create-close {
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: #fff;
  cursor: pointer;
}
.moment-create-modal .create-preview {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #111;
}
.moment-create-modal .create-preview video,
.moment-create-modal .create-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.moment-create-modal .create-controls {
  display: flex;
  gap: 12px;
  padding: 16px;
  justify-content: center;
  background: rgba(0,0,0,0.8);
}
.moment-create-modal .create-controls button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  transition: all 200ms ease;
}
.moment-create-modal .create-controls button:hover {
  background: rgba(255,255,255,0.2);
}
.moment-create-modal .create-controls button.capture {
  width: 64px;
  height: 64px;
  background: #fff;
  color: #000;
  border: 3px solid var(--accent-blue, #4A7AFF);
}
.moment-create-modal .create-caption-input {
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-size: 14px;
  outline: none;
  margin: 0 16px 80px;
  border-radius: 12px;
}
.moment-create-modal .create-post-btn {
  margin: 0 16px 24px;
  padding: 14px;
  background: var(--accent-blue, #4A7AFF);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 200ms ease;
}
.moment-create-modal .create-post-btn:active { transform: scale(0.97); }
.moment-create-modal .create-post-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Animations ── */
@keyframes momentFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes momentSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── Moments Tab ── */
#tab-moments .moments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 4px;
  padding: 4px;
}
#tab-moments .moments-grid .moment-thumb {
  aspect-ratio: 9/16;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 150ms ease;
}
#tab-moments .moments-grid .moment-thumb:hover { transform: scale(1.02); }

@media (max-width: 600px) {
  .moments-strip { padding: 8px 12px; gap: 8px; }
  .moment-bubble { min-width: 60px; }
  .moment-bubble .moment-ring { width: 52px; height: 52px; }
  .moment-bubble .moment-ring img { width: 48px; height: 48px; }
  .moment-action-btn { width: 36px; height: 36px; font-size: 16px; }
}
