/* ============================================================
   PuroArchive – Animationen & Micro-Interactions (animations.css)
   ============================================================ */

/* ==============================
   SCREEN TRANSITIONS
   ============================== */

.screen {
  transition: transform var(--transition-screen), opacity var(--transition-screen);
}

/* Vorwärts: neuer Screen kommt von rechts */
.screen.entering {
  transform: translateX(100%);
  opacity: 1;
}

.screen.active {
  transform: translateX(0);
  opacity: 1;
}

.screen.exiting {
  transform: translateX(-25%);
  opacity: 0.7;
}

/* Rückwärts: vorheriger Screen kommt von links zurück */
.screen.entering-back {
  transform: translateX(-25%);
  opacity: 0.7;
}

.screen.active-back {
  transform: translateX(0);
  opacity: 1;
}

/* Kein Transition beim initialen Laden */
.screen.no-transition {
  transition: none !important;
}

/* ==============================
   HOME BLOB ANIMATION
   ============================== */

.home-blob {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
  filter: blur(60px);
  opacity: 0.6;
  animation: blobPulse 6s ease-in-out infinite;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  pointer-events: none;
}

@keyframes blobPulse {
  0%   { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; transform: scale(1); }
  50%  { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; transform: scale(1.05); }
  100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; transform: scale(1); }
}

/* ==============================
   KI-ANALYSE BLOB (schneller pulsierend + Farbwechsel)
   ============================== */

.analyze-blob {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
  filter: blur(50px);
  opacity: 0.75;
  animation: blobPulse 2s ease-in-out infinite, colorShift 4s ease-in-out infinite;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  pointer-events: none;
}

@keyframes colorShift {
  0%, 100% { background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%); }
  50%       { background: radial-gradient(circle, var(--color-primary-dark) 0%, transparent 70%); }
}

/* ==============================
   BUTTON MICRO-INTERACTIONS
   ============================== */

.btn:active,
button:active {
  transform: scale(0.96);
  transition: transform 100ms ease !important;
}

/* Kein Scale bei Disabled */
button:disabled:active {
  transform: none;
}

/* ==============================
   TOAST NOTIFICATION
   ============================== */

@keyframes toastIn {
  from { transform: translateX(-50%) translateY(-80px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(-50%) translateY(0);    opacity: 1; }
  to   { transform: translateX(-50%) translateY(-80px); opacity: 0; }
}

/* ==============================
   SPRACHEINGABE – WELLENANIMATION
   ============================== */

.voice-wave {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 28px;
}

.voice-wave__bar {
  width: 4px;
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transform: scaleY(0.3);
  transform-origin: center;
  animation: waveBar 0.8s ease-in-out infinite;
}

.voice-wave__bar:nth-child(1) { animation-delay: 0ms; }
.voice-wave__bar:nth-child(2) { animation-delay: 100ms; }
.voice-wave__bar:nth-child(3) { animation-delay: 200ms; }
.voice-wave__bar:nth-child(4) { animation-delay: 100ms; }
.voice-wave__bar:nth-child(5) { animation-delay: 0ms; }

@keyframes waveBar {
  0%, 100% { transform: scaleY(0.3); }
  50%       { transform: scaleY(1); }
}

/* Gestoppt: alle Balken klein */
.voice-wave.stopped .voice-wave__bar {
  animation: none;
  transform: scaleY(0.3);
}

/* ==============================
   MIKROFON-BUTTON – PULSRENDER RING
   ============================== */

.mic-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mic-pulse-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  animation: micPulse 1.5s ease-in-out infinite;
  pointer-events: none;
  opacity: 0;
}

.mic-btn.recording .mic-pulse-ring {
  opacity: 1;
}

@keyframes micPulse {
  0%   { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ==============================
   LADE-SPINNER
   ============================== */

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(250, 250, 248, 0.3);
  border-top-color: var(--color-text-inverse);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.spinner--dark {
  border-color: rgba(13, 13, 13, 0.15);
  border-top-color: var(--color-text);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==============================
   FADE IN (Karten, Inhalte)
   ============================== */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn var(--transition-base) ease both;
}

/* Staggered Cards: wird per JS mit --delay gesetzt */
.card-item {
  animation: fadeIn var(--transition-base) ease both;
  animation-delay: var(--delay, 0ms);
}

/* ==============================
   SHUTTER BLINK (Kamera)
   ============================== */

@keyframes shutterBlink {
  0%   { opacity: 0; }
  10%  { opacity: 0.9; }
  30%  { opacity: 0; }
  100% { opacity: 0; }
}

.shutter-flash {
  position: fixed;
  inset: 0;
  background: white;
  pointer-events: none;
  opacity: 0;
  z-index: 999;
}

.shutter-flash.active {
  animation: shutterBlink 0.35s ease-out forwards;
}

/* ==============================
   ACTION SHEET OVERLAY
   ============================== */

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.action-sheet-overlay.visible {
  animation: overlayFadeIn var(--transition-base) ease;
}

/* ==============================
   SYNC-STATUS INDICATOR
   ============================== */

@keyframes syncPending {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.sync-indicator--pending {
  animation: syncPending 2s ease-in-out infinite;
}
