/* ==========================================
   MERCADOSMART - ANIMAÇÕES
   ========================================== */

/* Slide in from bottom */
@keyframes slideInBottom {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Fade in */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Scale in */
@keyframes scaleIn {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* Item appear */
.item-appear {
  animation: slideInBottom 0.25s ease forwards;
}

/* Card appear */
.card-appear {
  animation: scaleIn 0.2s ease forwards;
}

/* Swipe out (delete) */
@keyframes swipeOut {
  to { transform: translateX(-100%); opacity: 0; height: 0; padding: 0; margin: 0; overflow: hidden; }
}
.swipe-out {
  animation: swipeOut 0.3s ease forwards;
}

/* Check animation */
@keyframes checkBounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.check-animate {
  animation: checkBounce 0.4s ease;
}

/* Shake (erro) */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60%  { transform: translateX(-6px); }
  40%, 80%  { transform: translateX(6px); }
}
.shake {
  animation: shake 0.4s ease;
}

/* Counter increment */
@keyframes countUp {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}
.count-update {
  animation: countUp 0.2s ease;
}

/* Ripple effect */
.ripple {
  position: relative; overflow: hidden;
}
.ripple::after {
  content: '';
  position: absolute;
  width: 200%; height: 200%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  animation: rippleEffect 0.4s ease;
}
@keyframes rippleEffect {
  to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  animation: slideInBottom 0.25s 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(n+6) { animation-delay: 0.30s; }

/* Number counter animation */
.value-updated {
  animation: countUp 0.3s ease;
}

/* Highlight flash */
@keyframes flashHighlight {
  0%, 100% { background: transparent; }
  50% { background: rgba(79, 195, 247, 0.15); }
}
.flash-highlight {
  animation: flashHighlight 0.5s ease;
}

/* Success celebration */
@keyframes celebration {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.1) rotate(-3deg); }
  50%  { transform: scale(1.1) rotate(3deg); }
  75%  { transform: scale(1.05) rotate(-1deg); }
  100% { transform: scale(1) rotate(0); }
}
.celebrate {
  animation: celebration 0.5s ease;
}

/* Dot pulse (loading) */
@keyframes dotPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%       { opacity: 1;   transform: scale(1.1); }
}

/* Page transitions */
.page-enter {
  animation: slideInBottom 0.25s ease forwards;
}

/* Chart update animation */
@keyframes chartFadeIn {
  from { opacity: 0; transform: scaleY(0.95); }
  to   { opacity: 1; transform: scaleY(1); }
}
.chart-appear {
  animation: chartFadeIn 0.4s ease forwards;
  transform-origin: bottom;
}

/* Low stock warning pulse */
@keyframes warningPulse {
  0%, 100% { border-color: rgba(255,183,77,0.3); }
  50%       { border-color: rgba(255,183,77,0.8); box-shadow: 0 0 8px rgba(255,183,77,0.3); }
}
.stock-warning {
  animation: warningPulse 2s ease infinite;
}

/* QR scan border */
@keyframes qrBorder {
  0%   { border-color: var(--accent-blue); box-shadow: 0 0 0 2px rgba(79,195,247,0.2); }
  50%  { border-color: var(--accent-green); box-shadow: 0 0 0 4px rgba(0,230,118,0.2); }
  100% { border-color: var(--accent-blue); box-shadow: 0 0 0 2px rgba(79,195,247,0.2); }
}
.qr-scanning {
  animation: qrBorder 1.5s ease infinite;
  border: 2px solid var(--accent-blue);
  border-radius: var(--radius);
}
