/* Advanced Animation Effects - Created May 23, 2025 */

/* Animated Card Effect */
.animation-card {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.animation-card:hover {
  transform: translateY(-15px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* Shine Effect - DISABILITATO per le service cards */
.shine-effect {
  position: relative;
  overflow: hidden;
}

.service-card.shine-effect::before {
  display: none !important;
}

.shine-effect::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 100%
  );
  transform: skewX(-25deg);
  z-index: 2;
  transition: all 0.75s ease;
}

.shine-effect:hover::before {
  animation: shine 1s;
}

.service-card.shine-effect:hover::before {
  animation: none !important;
}

@keyframes shine {
  100% {
    left: 125%;
  }
}

/* Ripple Effect for Buttons */
.ripple-btn {
  position: relative;
  overflow: hidden;
}

.ripple-btn::after {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  left: 25%;
  height: 100%;
  width: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: scale(0);
  opacity: 0;
  transition: transform 0.5s, opacity 0.3s;
}

.ripple-btn:active::after {
  transform: scale(5);
  opacity: 0;
  transition: 0s;
}

/* Floating Animation */
.float-animation {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0px);
  }
}

/* Hover Grow Effect */
.hover-grow {
  transition: transform 0.3s ease;
}

.hover-grow:hover {
  transform: scale(1.05);
}

/* Staggered Text Animation */
.text-animation-parent {
  overflow: hidden;
}

.text-animation-child {
  display: inline-block;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.text-animation-parent.visible .text-animation-child {
  transform: translateY(0);
  opacity: 1;
}

/* Staggered Children Animation */
.staggered-parent .staggered-child {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.staggered-parent.visible .staggered-child {
  opacity: 1;
  transform: translateY(0);
}

.staggered-parent.visible .staggered-child:nth-child(1) {
  transition-delay: 0.1s;
}

.staggered-parent.visible .staggered-child:nth-child(2) {
  transition-delay: 0.2s;
}

.staggered-parent.visible .staggered-child:nth-child(3) {
  transition-delay: 0.3s;
}

.staggered-parent.visible .staggered-child:nth-child(4) {
  transition-delay: 0.4s;
}

.staggered-parent.visible .staggered-child:nth-child(5) {
  transition-delay: 0.5s;
}

/* 3D Card Effect */
.card-3d {
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.card-3d:hover {
  transform: rotateY(10deg) rotateX(10deg);
}

/* Background Gradient Animation */
.gradient-animation {
  background: linear-gradient(-45deg, #4361ee, #3a0ca3, #7209b7, #4361ee);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Button Pulse Animation */
.pulse-btn {
  animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
  0% {
    box-shadow: 0 0 0 0 rgba(67, 97, 238, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(67, 97, 238, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(67, 97, 238, 0);
  }
}

/* Border Gradient Animation */
.border-gradient {
  position: relative;
  border-radius: 12px;
  padding: 3px;
  background: linear-gradient(
    45deg,
    #4361ee,
    #3a0ca3,
    #7209b7,
    #4361ee
  );
  background-size: 400% 400%;
  animation: gradient 15s ease infinite;
}

.border-gradient .content {
  background: white;
  border-radius: 9px;
  padding: 30px;
  height: 100%;
}

@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Text Reveal Animation */
.text-reveal {
  position: relative;
  color: transparent;
}

.text-reveal::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: var(--dark-color);
  overflow: hidden;
  border-right: 3px solid var(--primary-color);
  animation: typewriter 3s steps(40) 1s forwards, 
             blink-caret 0.75s step-end infinite;
  white-space: nowrap;
}

@keyframes typewriter {
  0% {
    width: 0;
  }
  100% {
    width: 100%;
  }
}

@keyframes blink-caret {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--primary-color);
  }
}

/* Rotating Icon */
.rotating-icon {
  animation: rotating 4s linear infinite;
}

@keyframes rotating {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Bouncing Animation */
.bounce-animation {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-30px);
  }
  60% {
    transform: translateY(-15px);
  }
}

/* Shake Animation */
.shake-animation:hover {
  animation: shake 0.5s;
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(5px);
  }
  75% {
    transform: translateX(-5px);
  }
  100% {
    transform: translateX(0);
  }
}

/* Pop Animation */
.pop-animation:hover {
  animation: pop 0.3s;
}

@keyframes pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Slide-In-From-Bottom Animation for Scroll Reveal */
.slide-in-bottom {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.slide-in-bottom.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Slide-In-From-Left Animation for Scroll Reveal */
.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Slide-In-From-Right Animation for Scroll Reveal */
.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Scale-In Animation for Scroll Reveal */
.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Fade-In Animation for Scroll Reveal */
.fade-in {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
}

/* Glow Animation */
.glow-animation {
  animation: glow 2s infinite alternate;
}

@keyframes glow {
  from {
    box-shadow: 0 0 5px rgba(67, 97, 238, 0.5);
  }
  to {
    box-shadow: 0 0 20px rgba(67, 97, 238, 0.8);
  }
}

/* Social Icons Pulse */
.social-pulse {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  transition: all 0.3s ease;
  position: relative;
}

.social-pulse:hover {
  transform: translateY(-5px);
}

.social-pulse::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--gradient-primary);
  z-index: -1;
  opacity: 0.7;
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.3);
    opacity: 0;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* Expanded Scroll Reveal System */
[data-scroll] {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-scroll="fade-up"] {
  transform: translateY(50px);
}

[data-scroll="fade-down"] {
  transform: translateY(-50px);
}

[data-scroll="fade-left"] {
  transform: translateX(50px);
}

[data-scroll="fade-right"] {
  transform: translateX(-50px);
}

[data-scroll="scale"] {
  transform: scale(0.9);
}

[data-scroll="rotate"] {
  transform: rotate(15deg);
}

[data-scroll].visible {
  opacity: 1;
  transform: translate(0) rotate(0) scale(1);
}

/* Delay Classes */
.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;
}

.delay-600 {
  transition-delay: 0.6s;
}

.delay-700 {
  transition-delay: 0.7s;
}

.delay-800 {
  transition-delay: 0.8s;
}

.delay-900 {
  transition-delay: 0.9s;
}

.delay-1000 {
  transition-delay: 1s;
}
