/* Animation Variables */
:root {
  --animation-duration-fast: 0.2s;
  --animation-duration-normal: 0.4s;
  --animation-duration-slow: 0.6s;
  --animation-timing-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --animation-timing-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Transition Effects */
.fade-in {
  animation: fadeIn var(--animation-duration-normal) var(--animation-timing-ease);
}

.slide-up {
  animation: slideUp var(--animation-duration-normal) var(--animation-timing-ease);
}

.slide-down {
  animation: slideDown var(--animation-duration-normal) var(--animation-timing-ease);
}

.zoom-in {
  animation: zoomIn var(--animation-duration-normal) var(--animation-timing-bounce);
}

/* Hover Effects */
.hover-lift {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.hover-grow {
  transition: transform var(--transition-normal);
}

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

.hover-shadow {
  transition: box-shadow var(--transition-normal);
}

.hover-shadow:hover {
  box-shadow: var(--shadow-md);
}

/* Pulse Animation for CTAs */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(59, 90, 122, 0.4);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(59, 90, 122, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(59, 90, 122, 0);
  }
}

/* Rotation Animation */
.rotate {
  animation: rotate 2s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Shake Animation (for errors) */
.shake {
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  10%, 90% {
    transform: translateX(-1px);
  }
  20%, 80% {
    transform: translateX(2px);
  }
  30%, 50%, 70% {
    transform: translateX(-4px);
  }
  40%, 60% {
    transform: translateX(4px);
  }
}

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

/* Slide Up Animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide Down Animation */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Zoom In Animation */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Fade In Effect for Page Loading */
body {
  animation: fadeIn 0.5s ease-in-out;
}

/* Staggered Animation for list items */
.stagger-items > * {
  opacity: 0;
  transform: translateY(10px);
  animation: slideUp var(--animation-duration-normal) var(--animation-timing-ease) forwards;
}

.stagger-items > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-items > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-items > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-items > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-items > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-items > *:nth-child(6) { animation-delay: 0.6s; }

/* Shimmer effect (for loading states) */
.shimmer {
  background: linear-gradient(
    90deg,
    var(--color-accent-light) 0%,
    var(--color-accent) 50%,
    var(--color-accent-light) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

/* Mobile Menu Animation */
.menu-toggle span {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animated Link Underline */
.animated-link {
  position: relative;
  text-decoration: none;
}

.animated-link::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--color-primary);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease-out;
}

.animated-link:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* Image Hover Zoom */
.img-zoom {
  overflow: hidden;
}

.img-zoom img {
  transition: transform 0.5s ease;
}

.img-zoom:hover img {
  transform: scale(1.1);
}

/* Button Click Effect */
.btn-click {
  transition: transform 0.1s ease;
}

.btn-click:active {
  transform: scale(0.95);
}

/* Feature Card Animations */
.feature-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Product Image Transitions */
.product-image img {
  transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

/* Form Field Focus Animation */
input:focus, 
textarea:focus, 
select:focus {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Page Transition (when supported) */
.page-transition {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-exit {
  opacity: 0;
  transform: translateY(10px);
}

.page-enter {
  opacity: 0;
  transform: translateY(-10px);
}

.page-enter-active {
  opacity: 1;
  transform: translateY(0);
}


/* Enhanced feature card styling for layout consistency and cross-browser compatibility */
.feature-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  padding: 1rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.feature-card img {
  width: 100%;
  height: auto;
  border-radius: 0.5rem 0.5rem 0 0;
  object-fit: cover;
  max-height: 160px;
}

.feature-card h4 {
  margin-top: 1rem;
  font-size: 1.125rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.feature-card p {
  font-size: 0.95rem;
  line-height: 1.5;
}
