/**
 * Olio Pizza Napoletana - Animation Styles
 * Custom animations, transitions, and effects
 */

/* ========================================
   AOS Customizations
   ======================================== */

[data-aos] {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom fade-up with scale */
[data-aos="fade-up-scale"] {
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition-property: opacity, transform;
}

[data-aos="fade-up-scale"].aos-animate {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ========================================
   Parallax Effect (CSS-based fallback)
   ======================================== */

.parallax {
  will-change: transform;
}

/* ========================================
   Hover Effects
   ======================================== */

/* Link underline animation */
.link-animated {
  position: relative;
  display: inline-block;
}

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

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

/* Card lift effect */
.card-hover {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

/* Image zoom on hover */
.img-zoom {
  overflow: hidden;
}

.img-zoom img {
  transition: transform var(--transition-slow);
}

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

/* ========================================
   Loading States
   ======================================== */

/* Skeleton loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-warm-gray) 25%,
    var(--color-beige) 50%,
    var(--color-warm-gray) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Pulse animation */
.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ========================================
   Entrance Animations
   ======================================== */

/* Fade in */
.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Slide in from bottom */
.slide-up {
  animation: slideUp 0.6s ease-out forwards;
}

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

/* Slide in from left */
.slide-in-left {
  animation: slideInLeft 0.6s ease-out forwards;
}

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

/* Slide in from right */
.slide-in-right {
  animation: slideInRight 0.6s ease-out forwards;
}

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

/* Scale in */
.scale-in {
  animation: scaleIn 0.5s ease-out forwards;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========================================
   Interactive Elements
   ======================================== */

/* Button press effect */
.btn-press:active {
  transform: scale(0.97);
}

/* Ripple effect container */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform 0.5s, opacity 1s;
}

.ripple:active::after {
  transform: scale(0, 0);
  opacity: 0.3;
  transition: 0s;
}

/* ========================================
   Scroll Indicator Animation
   ======================================== */

.bounce {
  animation: bounce 2s infinite;
}

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

/* ========================================
   Text Reveal
   ======================================== */

.text-reveal {
  overflow: hidden;
}

.text-reveal span {
  display: inline-block;
  transform: translateY(100%);
  animation: textReveal 0.8s ease-out forwards;
}

@keyframes textReveal {
  to {
    transform: translateY(0);
  }
}

/* Stagger delay for multiple lines */
.text-reveal span:nth-child(2) { animation-delay: 0.1s; }
.text-reveal span:nth-child(3) { animation-delay: 0.2s; }
.text-reveal span:nth-child(4) { animation-delay: 0.3s; }

/* ========================================
   Float Animation
   ======================================== */

.float {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* ========================================
   Glow Effect
   ======================================== */

.glow {
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    box-shadow: 0 0 10px var(--color-primary), 0 0 20px var(--color-primary);
  }
  to {
    box-shadow: 0 0 20px var(--color-primary), 0 0 40px var(--color-primary);
  }
}

/* ========================================
   Reduced Motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
}
