/**
 * Custom AOS Animations Styling
 * Enhances the default AOS library with additional custom effects
 * and smooth transitions for the theme
 */

/* Smooth transitions for all AOS elements */
[data-aos] {
  transition-property: transform, opacity;
  will-change: transform, opacity;
}

[data-aos].aos-animate {
  transition-timing-function: ease-in-out;
}

/* Custom fade animations with enhanced smoothness */
[data-aos='fade-up'] {
  opacity: 0;
  transform: translate3d(0, 60px, 0);
}

[data-aos='fade-up'].aos-animate {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

[data-aos='fade-down'] {
  opacity: 0;
  transform: translate3d(0, -60px, 0);
}

[data-aos='fade-down'].aos-animate {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

[data-aos='fade-left'] {
  opacity: 0;
  transform: translate3d(60px, 0, 0);
}

[data-aos='fade-left'].aos-animate {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

[data-aos='fade-right'] {
  opacity: 0;
  transform: translate3d(-60px, 0, 0);
}

[data-aos='fade-right'].aos-animate {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Enhanced zoom animations */
[data-aos='zoom-in'] {
  opacity: 0;
  transform: scale3d(0.8, 0.8, 0.8);
}

[data-aos='zoom-in'].aos-animate {
  opacity: 1;
  transform: scale3d(1, 1, 1);
}

[data-aos='zoom-out'] {
  opacity: 0;
  transform: scale3d(1.2, 1.2, 1.2);
}

[data-aos='zoom-out'].aos-animate {
  opacity: 1;
  transform: scale3d(1, 1, 1);
}

/* Custom animations for specific elements */

/* Header animations */
.editorial-header[data-aos] {
  transform-origin: top center;
}

/* Hero section animations */
.editorial-hero-section[data-aos] {
  transform-origin: center center;
}

.editorial-hero-content[data-aos] {
  transform-origin: left center;
}

.editorial-hero-visual[data-aos] {
  transform-origin: right center;
}

/* About section animations */
.editorial-about-section[data-aos] {
  transform-origin: center center;
}

.editorial-about-image-wrapper[data-aos] {
  transform-origin: center center;
}

.editorial-about-content[data-aos] {
  transform-origin: left center;
}

/* Journal cards animations */
.editorial-journal-card[data-aos] {
  transform-origin: bottom center;
  transition-property: transform, opacity, box-shadow;
}

.editorial-journal-card[data-aos].aos-animate {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.editorial-journal-card[data-aos].aos-animate:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Footer animations */
.editorial-footer[data-aos] {
  transform-origin: bottom center;
}

/* Force footer to always be visible - override AOS */
.editorial-footer {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

/* Footer content should have animation instead */
.editorial-footer .editorial-hero-container[data-aos] {
  transform-origin: bottom center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  /* Reduce animation distance on mobile */
  [data-aos='fade-up'] {
    transform: translate3d(0, 30px, 0);
  }

  [data-aos='fade-down'] {
    transform: translate3d(0, -30px, 0);
  }

  [data-aos='fade-left'] {
    transform: translate3d(30px, 0, 0);
  }

  [data-aos='fade-right'] {
    transform: translate3d(-30px, 0, 0);
  }

  /* Disable zoom animations on very small screens */
  [data-aos='zoom-in'],
  [data-aos='zoom-out'] {
    transform: scale3d(1, 1, 1);
  }
}

/* Performance optimizations */
[data-aos] {
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Ensure smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom easing for smoother animations */
[data-aos][data-aos-easing='custom-ease'] {
  transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Enhanced stagger effect for multiple elements */
[data-aos][data-aos-delay='100'] {
  transition-delay: 100ms;
}

[data-aos][data-aos-delay='200'] {
  transition-delay: 200ms;
}

[data-aos][data-aos-delay='300'] {
  transition-delay: 300ms;
}

[data-aos][data-aos-delay='400'] {
  transition-delay: 400ms;
}

[data-aos][data-aos-delay='500'] {
  transition-delay: 500ms;
}

/* Bidirectional animation support */
/* When scrolling back up, elements will animate out smoothly */
[data-aos][data-aos].aos-animate {
  transition: all 0.8s ease-in-out;
}

/* Add subtle blur effect during animation for extra smoothness */
[data-aos]:not(.aos-animate) {
  filter: blur(2px);
  transition: filter 0.3s ease;
}

[data-aos].aos-animate {
  filter: blur(0);
}

/* Prevent layout shift during animations */
[data-aos] {
  min-height: 1px;
}

/* Custom pulse animation for important elements */
@keyframes aos-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

[data-aos='pulse'].aos-animate {
  animation: aos-pulse 2s ease-in-out infinite;
}

/* Custom slide animations with rotation */
[data-aos='slide-rotate-left'] {
  opacity: 0;
  transform: translate3d(-100px, 0, 0) rotate(-10deg);
}

[data-aos='slide-rotate-left'].aos-animate {
  opacity: 1;
  transform: translate3d(0, 0, 0) rotate(0);
}

[data-aos='slide-rotate-right'] {
  opacity: 0;
  transform: translate3d(100px, 0, 0) rotate(10deg);
}

[data-aos='slide-rotate-right'].aos-animate {
  opacity: 1;
  transform: translate3d(0, 0, 0) rotate(0);
}

/* Print styles - disable animations */
@media print {
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Reduced motion support for accessibility */
@media (prefers-reduced-motion: reduce) {
  [data-aos] {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
