/* ============================================
   INTERACTIONS.CSS — Micro-UX Visual Styles
   Ripple, reactions, celebrations, tips, etc.
   ============================================ */

/* ── Ripple Effect ── */
.vtv-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.25);
  transform: scale(0);
  animation: rippleAnim 0.6s ease-out forwards;
  pointer-events: none;
  z-index: 1;
}
@keyframes rippleAnim {
  to { transform: scale(1); opacity: 0; }
}

/* ── Reaction Picker ── */
.reaction-picker {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 28px;
  padding: 6px 8px;
  display: flex;
  gap: 2px;
  z-index: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.reaction-picker.visible {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}
.rp-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 20px;
  transition: all 0.15s;
}
.rp-btn:hover {
  background: rgba(255,255,255,0.08);
  transform: scale(1.3);
}
.rp-emoji { font-size: 24px; }

/* ── Reaction Bar (under content) ── */
.reaction-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  flex-wrap: wrap;
}
.rb-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 16px;
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.15);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.rb-item:hover { background: rgba(212,175,55,0.15); }
.rb-count { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.rb-add {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.15);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.rb-add:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212,175,55,0.06);
}

/* ── Confetti ── */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99999;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  animation: confettiFall 2s ease-in forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ── Heart Burst ── */
.heart-burst {
  position: fixed;
  top: 50%;
  font-size: 28px;
  pointer-events: none;
  z-index: 99998;
  animation: heartFloat 1.5s ease-out forwards;
}
@keyframes heartFloat {
  0%   { transform: translateY(0) scale(0.5); opacity: 1; }
  50%  { transform: translateY(-60px) scale(1.2); opacity: 0.8; }
  100% { transform: translateY(-140px) scale(0.8); opacity: 0; }
}

/* ── Cross Sparkle ── */
.cross-sparkle {
  position: fixed;
  font-size: 64px;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  z-index: 99998;
  animation: crossSparkle 1.2s ease-out forwards;
}
@keyframes crossSparkle {
  0%   { transform: translate(-50%, -50%) scale(0) rotate(0deg); opacity: 1; }
  50%  { transform: translate(-50%, -50%) scale(1.5) rotate(15deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2) rotate(0deg); opacity: 0; }
}

/* ── Toast with Undo ── */
.toast-undo {
  display: flex !important;
  align-items: center;
  gap: 12px;
}
.toast-undo-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.toast-undo-btn:hover { background: rgba(255,255,255,0.3); }

/* ── Presence Indicator ── */
.presence-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(78, 203, 113, 0.08);
  border: 1px solid rgba(78, 203, 113, 0.15);
  border-radius: 10px;
  margin-bottom: 12px;
}
.presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: presencePulse 2s ease infinite;
  flex-shrink: 0;
}
@keyframes presencePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(78,203,113,0.4); }
  50%      { opacity: 0.7; box-shadow: 0 0 0 6px rgba(78,203,113,0); }
}
.presence-text {
  font-size: 12px;
  color: var(--success);
  font-weight: 500;
}

/* ── Context Tips ── */
.context-tip {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--text-secondary);
  z-index: 9000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  opacity: 0;
  transition: all 0.3s ease;
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.context-tip.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Error State ── */
.error-state {
  text-align: center;
  padding: 40px 20px;
}
.es-icon {
  font-size: 48px;
  color: var(--error);
  margin-bottom: 12px;
}
.es-icon i { font-size: 48px; }
.es-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.es-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 16px;
}
.es-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--gold-gradient);
  color: #000;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.es-btn i { font-size: 14px; }
.es-link {
  display: block;
  margin-top: 12px;
  color: var(--gold);
  font-size: 13px;
  text-decoration: underline;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}
.es-illustration {
  font-size: 56px;
  margin-bottom: 16px;
  animation: floatParticle 3s ease-in-out infinite;
}
.empty-state h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 20px;
}
.es-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}
.es-suggest-btn {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.es-suggest-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.es-cta {
  padding: 12px 24px;
  background: var(--gold-gradient);
  color: #000;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

/* ── Image Viewer ── */
.img-viewer {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.img-viewer.open { opacity: 1; }
.iv-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.9);
}
.iv-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.iv-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  position: relative;
  z-index: 1;
}

/* ── Share Options ── */
.share-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
  text-decoration: none;
  transition: background 0.15s;
  font-family: var(--font-body);
}
.share-option:hover { background: var(--bg-elevated); }

/* ── Light Theme Overrides ── */
[data-theme="light"] .reaction-picker {
  background: #fff;
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
[data-theme="light"] .rb-item {
  background: rgba(212,175,55,0.06);
  border-color: rgba(212,175,55,0.12);
}
[data-theme="light"] .presence-bar {
  background: rgba(78,203,113,0.06);
  border-color: rgba(78,203,113,0.12);
}
[data-theme="light"] .context-tip {
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
[data-theme="light"] .es-suggest-btn {
  background: #f0f0f0;
  border-color: rgba(0,0,0,0.08);
}

/* ── Typing Indicator ── */
.typing-dots::after {
  content: '';
  animation: typingDots 1.4s steps(4, end) infinite;
}
@keyframes typingDots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: ''; }
}

/* ── UI Sound Feedback ── */
.sound-tap {
  transition: transform 0.1s ease;
}
.sound-tap:active {
  transform: scale(0.95);
}
