/* ============================================================
   ANIMATIONS.CSS — Keyframes & Micro-Animations
   Hydrogel Film Business POS
   ============================================================ */

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

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(30px); }
}

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

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

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

@keyframes progressSheen {
  from { transform: translateX(-100%); }
  to   { transform: translateX(200%); }
}

@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

@keyframes ripple {
  from { transform: scale(0); opacity: 0.5; }
  to   { transform: scale(4); opacity: 0; }
}

@keyframes checkmark {
  from { stroke-dashoffset: 50; }
  to   { stroke-dashoffset: 0; }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ─── Animation Utilities ────────────────────────────────── */
.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; }
.animate-fade-in  { animation: fadeIn 0.3s ease forwards; }
.animate-slide-up { animation: slideUp 0.4s var(--transition-bounce) forwards; }
.animate-scale-in { animation: scaleIn 0.3s var(--transition-bounce) forwards; }
.animate-float    { animation: float 3s ease-in-out infinite; }

/* ─── Stagger Children ────────────────────────────────────── */
.stagger-children > * {
  opacity: 0;
  animation: fadeSlideUp 0.35s ease forwards;
}

.stagger-children > *:nth-child(1)  { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2)  { animation-delay: 0.10s; }
.stagger-children > *:nth-child(3)  { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4)  { animation-delay: 0.20s; }
.stagger-children > *:nth-child(5)  { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6)  { animation-delay: 0.30s; }
.stagger-children > *:nth-child(7)  { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8)  { animation-delay: 0.40s; }

/* ─── Success Checkmark ──────────────────────────────────── */
.success-check {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--success-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  animation: scaleIn 0.4s var(--transition-bounce);
}

.success-check svg {
  width: 36px;
  height: 36px;
  color: var(--success);
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: checkmark 0.4s ease 0.2s forwards;
}

/* ─── Hover Lift ─────────────────────────────────────────── */
.hover-lift {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ─── Press Effect ───────────────────────────────────────── */
.press-effect { transition: transform var(--transition-fast); }
.press-effect:active { transform: scale(0.97); }

/* ─── Page Transitions ────────────────────────────────────── */
.page-transition-enter {
  animation: fadeSlideUp 0.3s ease forwards;
}

.page-transition-exit {
  animation: fadeIn 0.2s ease reverse forwards;
}

/* ─── Loading Dots ───────────────────────────────────────── */
.loading-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: bounce 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ─── Notifications Badge Pulse ──────────────────────────── */
.badge-pulse {
  position: relative;
}

.badge-pulse::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg-surface);
  animation: pulse 2s infinite;
}

/* ─── Gradient Text Animation ─────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--primary-700), var(--primary-400), var(--primary-600));
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 3s linear infinite;
}

@keyframes gradientShift {
  0%   { background-position: 0% center; }
  50%  { background-position: 100% center; }
  100% { background-position: 0% center; }
}

/* ─── Swipe Hint ─────────────────────────────────────────── */
.swipe-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-xs);
  animation: fadeIn 1s ease 1s both;
}

.swipe-hint svg {
  animation: float 2s ease-in-out infinite;
}

/* ─── Number Counter Animation ────────────────────────────── */
.counter-animate {
  animation: countUp 0.5s var(--transition-bounce);
}

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