/* ========================================
   SCROLL ANIMATIONS CSS
   ======================================== */

/* Stato iniziale per tutti gli elementi animati */
.scroll-element {
  opacity: 0;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Stato animato quando l'elemento entra nel viewport */
.scroll-element.animate-in {
  opacity: 1;
}

/* ========================================
   FADE UP - Elemento sale dal basso
   ======================================== */
.fade-up {
  transform: translateY(50px);
}

.fade-up.animate-in {
  transform: translateY(0);
}

/* ========================================
   FADE DOWN - Elemento scende dall'alto
   ======================================== */
.fade-down {
  transform: translateY(-50px);
}

.fade-down.animate-in {
  transform: translateY(0);
}

/* ========================================
   FADE LEFT - Elemento arriva da sinistra
   ======================================== */
.fade-left {
  transform: translateX(-50px);
}

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

/* ========================================
   FADE RIGHT - Elemento arriva da destra
   ======================================== */
.fade-right {
  transform: translateX(50px);
}

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

/* ========================================
   SCALE UP - Elemento si ingrandisce
   ======================================== */
.scale-up {
  transform: scale(0.8);
}

.scale-up.animate-in {
  transform: scale(1);
}

/* ========================================
   SCALE DOWN - Elemento si rimpicciolisce
   ======================================== */
.scale-down {
  transform: scale(1.2);
}

.scale-down.animate-in {
  transform: scale(1);
}

/* ========================================
   ROTATE IN - Elemento ruota entrando
   ======================================== */
.rotate-in {
  transform: rotate(-10deg) scale(0.9);
}

.rotate-in.animate-in {
  transform: rotate(0deg) scale(1);
}

/* ========================================
   ROTATE IN LEFT - Rotazione da sinistra
   ======================================== */
.rotate-in-left {
  transform: rotate(-45deg) translateX(-50px);
  transform-origin: left center;
}

.rotate-in-left.animate-in {
  transform: rotate(0deg) translateX(0);
}

/* ========================================
   ROTATE IN RIGHT - Rotazione da destra
   ======================================== */
.rotate-in-right {
  transform: rotate(45deg) translateX(50px);
  transform-origin: right center;
}

.rotate-in-right.animate-in {
  transform: rotate(0deg) translateX(0);
}

/* ========================================
   FLIP - Elemento si capovolge
   ======================================== */
.flip {
  transform: perspective(1000px) rotateY(90deg);
}

.flip.animate-in {
  transform: perspective(1000px) rotateY(0deg);
}

/* ========================================
   SLIDE UP - Scorre verso l'alto
   ======================================== */
.slide-up {
  transform: translateY(100px);
}

.slide-up.animate-in {
  transform: translateY(0);
}

/* ========================================
   ZOOM IN - Zoom con fade
   ======================================== */
.zoom-in {
  transform: scale(0.5);
}

.zoom-in.animate-in {
  transform: scale(1);
}

/* ========================================
   ZOOM OUT - Zoom inverso con fade
   ======================================== */
.zoom-out {
  transform: scale(1.5);
}

.zoom-out.animate-in {
  transform: scale(1);
}

/* ========================================
   BLUR IN - Sfocatura che si risolve
   ======================================== */
.blur-in {
  filter: blur(10px);
  transform: scale(1.1);
}

.blur-in.animate-in {
  filter: blur(0);
  transform: scale(1);
}

/* ========================================
   BOUNCE IN - Rimbalzo entrando
   ======================================== */
.bounce-in {
  transform: scale(0);
}

.bounce-in.animate-in {
  animation: bounceIn 0.6s ease-out forwards;
}

@keyframes bounceIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ========================================
   SLIDE IN DIAGONAL - Diagonale
   ======================================== */
.slide-diagonal {
  transform: translate(-50px, 50px);
}

.slide-diagonal.animate-in {
  transform: translate(0, 0);
}

/* ========================================
   FADE IN BLUR - Fade con blur
   ======================================== */
.fade-blur {
  filter: blur(5px);
  opacity: 0;
}

.fade-blur.animate-in {
  filter: blur(0);
  opacity: 1;
}

/* ========================================
   VARIANTI CON DELAY
   ======================================== */
.delay-100 {
  transition-delay: 0.1s;
}

.delay-200 {
  transition-delay: 0.2s;
}

.delay-300 {
  transition-delay: 0.3s;
}

.delay-400 {
  transition-delay: 0.4s;
}

.delay-500 {
  transition-delay: 0.5s;
}

/* ========================================
   VARIANTI CON DURATA DIVERSA
   ======================================== */
.duration-fast {
  transition-duration: 0.3s;
}

.duration-normal {
  transition-duration: 0.6s;
}

.duration-slow {
  transition-duration: 1s;
}

.duration-slower {
  transition-duration: 1.5s;
}

/* ========================================
   EFFETTI COMBINATI
   ======================================== */
.fade-up-scale {
  transform: translateY(50px) scale(0.9);
}

.fade-up-scale.animate-in {
  transform: translateY(0) scale(1);
}

.fade-rotate-scale {
  transform: rotate(-10deg) scale(0.8) translateY(30px);
}

.fade-rotate-scale.animate-in {
  transform: rotate(0deg) scale(1) translateY(0);
}

/* ========================================
   EFFETTO STAGGER per liste
   Usa con nth-child per animare in sequenza
   ======================================== */
.stagger-item:nth-child(1) { transition-delay: 0.1s; }
.stagger-item:nth-child(2) { transition-delay: 0.2s; }
.stagger-item:nth-child(3) { transition-delay: 0.3s; }
.stagger-item:nth-child(4) { transition-delay: 0.4s; }
.stagger-item:nth-child(5) { transition-delay: 0.5s; }
.stagger-item:nth-child(6) { transition-delay: 0.6s; }
.stagger-item:nth-child(7) { transition-delay: 0.7s; }
.stagger-item:nth-child(8) { transition-delay: 0.8s; }

/* ========================================
   RESPONSIVE - Disabilita animazioni su mobile
   se preferisci migliorare le performance
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  .scroll-element {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}