/* Animations CSS */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes slideRight {
  from {
    transform: translateX(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes scaleUp {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 102, 255, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(0, 102, 255, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 102, 255, 0);
  }
}

/* Animation Classes */
.fade-in {
  opacity: 0;
  animation-name: fadeIn;
  animation-duration: 0.8s;
  animation-fill-mode: forwards;
  animation-timing-function: ease-in-out;
}

.slide-up {
  opacity: 0;
  animation-name: slideUp;
  animation-duration: 0.8s;
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
}

.slide-right {
  opacity: 0;
  animation-name: slideRight;
  animation-duration: 0.8s;
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
}

.scale-up {
  opacity: 0;
  animation-name: scaleUp;
  animation-duration: 0.8s;
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
}

.bounce {
  animation-name: bounce;
  animation-duration: 1s;
  animation-fill-mode: both;
}

.pulse {
  animation-name: pulse;
  animation-duration: 2s;
  animation-iteration-count: infinite;
}

/* Animation Delays */
.delay-100 {
  animation-delay: 100ms;
}

.delay-200 {
  animation-delay: 200ms;
}

.delay-300 {
  animation-delay: 300ms;
}

.delay-400 {
  animation-delay: 400ms;
}

.delay-500 {
  animation-delay: 500ms;
}

.delay-600 {
  animation-delay: 600ms;
}

.delay-800 {
  animation-delay: 800ms;
}

.delay-1000 {
  animation-delay: 1000ms;
}

/* On-Load Animation Trigger */
.animate-on-load {
  opacity: 0;
}

/* On-Scroll Animation Trigger */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  transform: translateY(20px);
}

.animate-on-scroll.animate-fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* Different animation styles for scroll animations */
.animate-on-scroll.from-left {
  transform: translateX(-30px);
}

.animate-on-scroll.from-left.animate-fade-in {
  transform: translateX(0);
}

.animate-on-scroll.from-right {
  transform: translateX(30px);
}

.animate-on-scroll.from-right.animate-fade-in {
  transform: translateX(0);
}

.animate-on-scroll.scale {
  transform: scale(0.9);
}

.animate-on-scroll.scale.animate-fade-in {
  transform: scale(1);
}

/* Hover Animations */
.hover-lift {
  transition: transform 0.3s ease-out;
}

.hover-lift:hover {
  transform: translateY(-5px);
}

.hover-scale {
  transition: transform 0.3s ease-out;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-glow {
  transition: box-shadow 0.3s ease-out;
}

.hover-glow:hover {
  box-shadow: 0 0 15px rgba(0, 102, 255, 0.5);
}

/* Button press effect */
.btn-press {
  transition: transform 0.1s ease-out;
}

.btn-press:active {
  transform: scale(0.97);
}

/* Specific element animations */
.hero h1 {
  opacity: 0;
  animation: fadeIn 1s ease-out 0.2s forwards;
}

.hero p {
  opacity: 0;
  animation: fadeIn 1s ease-out 0.4s forwards;
}

.hero-cta {
  opacity: 0;
  animation: fadeIn 1s ease-out 0.6s forwards;
}

.product-card {
  transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}

.feature-icon {
  transition: transform 0.3s ease-out, background-color 0.3s ease-out;
}

.feature-card:hover .feature-icon {
  transform: scale(1.1);
  background-color: rgba(0, 102, 255, 0.2);
}

.product-item {
  transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

/* Tab transitions */
.tab-panel {
  transition: opacity 0.3s ease-out;
}

/* Quantity button animations */
.quantity-decrease:hover,
.quantity-increase:hover {
  background-color: var(--gray-300);
}

.quantity-decrease:active,
.quantity-increase:active {
  transform: scale(0.95);
}

/* Social icons hover effect */
.social-icon {
  transition: transform 0.3s ease-out, background-color 0.3s ease-out;
}

.social-icon:hover {
  transform: scale(1.1);
}

/* Mobile menu animation */
.mobile-menu {
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  transform: translateY(-10px);
  opacity: 0;
}

.mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
}

/* Navigation link animations */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: width 0.3s ease-out;
}

.nav-link:hover::after {
  width: 100%;
}

/* Header scroll animation */
.header {
  transition: background-color 0.3s ease-out, box-shadow 0.3s ease-out, padding 0.3s ease-out;
}

/* Hero section parallax effect */
.hero {
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 30% 50%, rgba(0, 102, 255, 0.1), transparent 70%);
  pointer-events: none;
}

/* Additional animation utilities */
.no-animation {
  animation: none !important;
  transition: none !important;
}

.animate-on-hover {
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.animate-on-hover:hover {
  transform: translateY(-5px);
}

/* Cart item enter/exit animations */
@keyframes cartItemEnter {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

.cart-item-enter {
  animation: cartItemEnter 0.3s forwards;
}

.cart-item-exit {
  animation: cartItemExit 0.3s forwards;
}

/* Typing animation for messages */
@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

.typing {
  overflow: hidden;
  white-space: nowrap;
  display: inline-block;
  animation: typing 1.5s steps(40, end);
}