/* ============================================================
   Nomomail — animations.css
   Reusable keyframe animations
   ============================================================ */

/* ── Keyframes ── */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes scaleOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.92); }
}

@keyframes ripple {
  0%   { transform: scale(0);   opacity: 0.5; }
  100% { transform: scale(4);   opacity: 0; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

/* ── Utility Classes ── */

.animate-fade-in  { animation: fadeIn  var(--transition-normal, 300ms) ease both; }
.animate-fade-out { animation: fadeOut var(--transition-normal, 300ms) ease both; }

.animate-slide-in-down  { animation: slideInDown  var(--transition-normal, 300ms) ease both; }
.animate-slide-in-up    { animation: slideInUp    var(--transition-normal, 300ms) ease both; }
.animate-slide-in-left  { animation: slideInLeft  var(--transition-normal, 300ms) ease both; }
.animate-slide-in-right { animation: slideInRight var(--transition-normal, 300ms) ease both; }

.animate-scale-in  { animation: scaleIn  var(--transition-normal, 300ms) ease both; }
.animate-scale-out { animation: scaleOut var(--transition-normal, 300ms) ease both; }

.animate-spin   { animation: spin   1s linear infinite; }
.animate-pulse  { animation: pulse  2s ease-in-out infinite; }
.animate-bounce { animation: bounce 1s ease-in-out infinite; }

/* Ripple host element must be position:relative and overflow:hidden */
.ripple-host {
  position: relative;
  overflow: hidden;
}

.ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  margin-left: -20px;
  animation: ripple 600ms linear 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;
  }
}
