/* Animations CSS - Keyframes and Transitions */

/* ========== Voice Button Animations ========== */

/* Holographic ring rotation */
@keyframes holo-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Pulse ring expansion */
@keyframes pulse-expand {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* Second pulse ring (delayed) */
@keyframes pulse-expand-delayed {
  0% {
    transform: scale(1);
    opacity: 0;
  }
  25% {
    opacity: 0.5;
  }
  100% {
    transform: scale(1.25);
    opacity: 0;
  }
}

/* Icon breathing animation for recording */
@keyframes icon-pulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 transparent);
  }
  50% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px var(--danger-glow));
  }
}

/* Wave bar animation for playing */
@keyframes wave-bar {
  0%, 100% {
    transform: scaleY(0.4);
    opacity: 0.6;
  }
  50% {
    transform: scaleY(1.4);
    opacity: 1;
  }
}

/* ========== UI Element Animations ========== */

/* Smooth fade in */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide in from left (for settings panel) */
@keyframes slide-in-left {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Slide out to left */
@keyframes slide-out-left {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-100%);
    opacity: 0;
  }
}

/* Scale pop */
@keyframes scale-pop {
  0% {
    transform: scale(0.95);
    opacity: 0;
  }
  60% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ========== Loading Animations ========== */

/* Spinner rotation */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Progress bar fill */
@keyframes progress-fill {
  0% { width: 0; }
  90% { width: 85%; }
  100% { width: 95%; }
}

/* Dots loading */
@keyframes dots-pulse {
  0%, 20% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
  80%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
}

/* ========== Background Animations ========== */

/* Grid shift (subtle movement) */
@keyframes grid-shift {
  0% { background-position: 0 0; }
  100% { background-position: 50px 50px; }
}

/* Glow pulse (for accent elements) */
@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 20px var(--accent-glow);
  }
  50% {
    box-shadow: 0 0 40px var(--accent-glow), 0 0 60px rgba(6, 182, 212, 0.2);
  }
}

/* Ambient color shift */
@keyframes ambient-shift {
  0%, 100% {
    filter: hue-rotate(0deg);
  }
  50% {
    filter: hue-rotate(15deg);
  }
}

/* ========== Micro-interactions ========== */

/* Button press */
@keyframes button-press {
  0% { transform: scale(1); }
  50% { transform: scale(0.97); }
  100% { transform: scale(1); }
}

/* Success flash */
@keyframes success-flash {
  0% {
    background-color: transparent;
  }
  50% {
    background-color: var(--success-glow);
  }
  100% {
    background-color: transparent;
  }
}

/* Error shake */
@keyframes error-shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* ========== Transition Classes ========== */

.transition-all {
  transition: all 0.2s ease;
}

.transition-fast {
  transition: all 0.1s ease;
}

.transition-slow {
  transition: all 0.4s ease;
}

.transition-spring {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Hover lift effect */
.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hard);
}

/* Glow on hover */
.hover-glow {
  transition: box-shadow 0.2s ease;
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

/* ========== State Transitions ========== */

/* For elements that appear/disappear */
.appear {
  animation: fade-in 0.3s ease forwards;
}

.disappear {
  animation: fade-in 0.3s ease reverse forwards;
}

/* For modals/panels */
.panel-enter {
  animation: slide-in-left 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.panel-exit {
  animation: slide-out-left 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Pop effect for buttons/cards */
.pop-in {
  animation: scale-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ========== Reduced Motion ========== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .holo-ring,
  .pulse-ring {
    display: none !important;
  }
}
