/* ============================================
   ANIMATIONS.CSS - Animações Reutilizáveis
   Sistema de animações modernas para e-commerce
   ============================================ */

/* Fade In Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale Animations */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleUp {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

/* Slide Animations */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

/* Pulse Animations */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(0, 102, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(0, 102, 255, 0);
  }
}

/* Bounce Animations */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

/* Rotate Animations */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-200deg);
  }
  to {
    opacity: 1;
    transform: rotate(0);
  }
}

/* Shake Animation */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

/* Shimmer/Loading Animation */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Progress Bar Animation */
@keyframes progressBar {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

/* Ripple Effect */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* Notification Slide */
@keyframes notificationSlide {
  0% {
    transform: translateX(400px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Cart Badge Bounce */
@keyframes cartBadgeBounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
}

/* Skeleton Loading */
@keyframes skeletonLoading {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* Floating Animation */
@keyframes floating {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Glow Animation */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(0, 102, 255, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 102, 255, 0.8);
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Fade In Classes */
.animate-fadeIn {
  animation: fadeIn 0.5s ease-in-out;
}

.animate-fadeInUp {
  animation: fadeInUp 0.6s ease-out;
}

.animate-fadeInDown {
  animation: fadeInDown 0.6s ease-out;
}

.animate-fadeInLeft {
  animation: fadeInLeft 0.6s ease-out;
}

.animate-fadeInRight {
  animation: fadeInRight 0.6s ease-out;
}

/* Scale Classes */
.animate-scaleIn {
  animation: scaleIn 0.4s ease-out;
}

.animate-scaleUp {
  animation: scaleUp 0.3s ease-out forwards;
}

/* Slide Classes */
.animate-slideInRight {
  animation: slideInRight 0.4s ease-out;
}

.animate-slideInLeft {
  animation: slideInLeft 0.4s ease-out;
}

.animate-slideInUp {
  animation: slideInUp 0.4s ease-out;
}

.animate-slideInDown {
  animation: slideInDown 0.4s ease-out;
}

/* Pulse Classes */
.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-pulseGlow {
  animation: pulseGlow 2s ease-in-out infinite;
}

/* Bounce Classes */
.animate-bounce {
  animation: bounce 1s ease-in-out infinite;
}

.animate-bounceIn {
  animation: bounceIn 0.6s ease-out;
}

/* Rotate Classes */
.animate-rotate {
  animation: rotate 2s linear infinite;
}

.animate-rotateIn {
  animation: rotateIn 0.6s ease-out;
}

/* Shake Class */
.animate-shake {
  animation: shake 0.5s ease-in-out;
}

/* Shimmer Class */
.animate-shimmer {
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #e0e0e0 50%,
    #f0f0f0 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* Floating Class */
.animate-floating {
  animation: floating 3s ease-in-out infinite;
}

/* Glow Class */
.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

/* ============================================
   HOVER EFFECTS
   ============================================ */

.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(0, 102, 255, 0.5);
}

.hover-brightness {
  transition: filter 0.3s ease;
}

.hover-brightness:hover {
  filter: brightness(1.1);
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 102, 255, 0.1);
  border-top-color: #0066FF;
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}

.loading-spinner--sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.loading-spinner--lg {
  width: 60px;
  height: 60px;
  border-width: 6px;
}

.loading-dots {
  display: inline-flex;
  gap: 8px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: #0066FF;
  border-radius: 50%;
  animation: bounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

.loading-bar {
  width: 100%;
  height: 4px;
  background: rgba(0, 102, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.loading-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 30%;
  background: #0066FF;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 0px,
    #e0e0e0 40px,
    #f0f0f0 80px
  );
  background-size: 200px;
  animation: skeletonLoading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

/* ============================================
   TRANSITION UTILITIES
   ============================================ */

.transition-fast {
  transition: all 0.15s ease-in-out;
}

.transition-base {
  transition: all 0.3s ease-in-out;
}

.transition-slow {
  transition: all 0.5s ease-in-out;
}

/* ============================================
   ANIMATION DELAYS
   ============================================ */

.delay-100 {
  animation-delay: 0.1s;
}

.delay-200 {
  animation-delay: 0.2s;
}

.delay-300 {
  animation-delay: 0.3s;
}

.delay-400 {
  animation-delay: 0.4s;
}

.delay-500 {
  animation-delay: 0.5s;
}

/* ============================================
   SCROLL REVEAL
   ============================================ */

.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   CART ANIMATIONS
   ============================================ */

.cart-item-enter {
  animation: slideInRight 0.4s ease-out;
}

.cart-item-exit {
  animation: slideInLeft 0.4s ease-out reverse;
}

.cart-badge-update {
  animation: cartBadgeBounce 0.4s ease-out;
}

/* ============================================
   NOTIFICATION ANIMATIONS
   ============================================ */

.notification-enter {
  animation: notificationSlide 0.4s ease-out;
}

.notification-exit {
  animation: notificationSlide 0.4s ease-out reverse;
}

/* ============================================
   MODAL ANIMATIONS
   ============================================ */

.modal-backdrop-enter {
  animation: fadeIn 0.3s ease-out;
}

.modal-content-enter {
  animation: scaleIn 0.3s ease-out;
}

.modal-exit {
  animation: fadeIn 0.3s ease-out reverse;
}

/* ============================================
   PRODUCT CARD ANIMATIONS
   ============================================ */

.product-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.product-card__image img {
  transition: transform 0.5s ease;
}

.product-card:hover .product-card__image img {
  transform: scale(1.1);
}

/* ============================================
   BUTTON RIPPLE EFFECT
   ============================================ */

.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::after {
  width: 300px;
  height: 300px;
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
