/* Animations CSS for Servizio-LuceGas.it */

/* CSS Animations Library for Enhanced UI */
:root {
  --animate-duration: 1s;
  --animate-delay: 0.5s;
  --animate-repeat: 1;
}

/* Base Animation Styles */
.animated {
  animation-duration: var(--animate-duration);
  animation-fill-mode: both;
}

.animated.infinite {
  animation-iteration-count: infinite;
}

.animated.delay-1s {
  animation-delay: 1s;
}

.animated.delay-2s {
  animation-delay: 2s;
}

.animated.delay-3s {
  animation-delay: 3s;
}

.animated.faster {
  animation-duration: 0.5s;
}

.animated.slower {
  animation-duration: 2s;
}

/* Hover Effects for Cards */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Hover effect for buttons */
.btn.hover-expand {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn.hover-expand:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

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

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

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

/* Animated icon effects */
.icon-spin {
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.icon-bounce {
  animation: bounce 2s ease infinite;
}

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

/* Advanced button animations */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple:after {
  content: "";
  display: block;
  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 .5s, opacity 1s;
}

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

/* Fade in animation for content sections */
.fade-in {
  animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Slide in animations */
.slide-in-left {
  animation: slideInLeft 1s ease-out;
}

@keyframes slideInLeft {
  0% {
    transform: translateX(-100px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-right {
  animation: slideInRight 1s ease-out;
}

@keyframes slideInRight {
  0% {
    transform: translateX(100px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-up {
  animation: slideInUp 1s ease-out;
}

@keyframes slideInUp {
  0% {
    transform: translateY(100px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Glow effect */
.glow {
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px var(--primary), 0 0 20px var(--primary);
  }
  to {
    text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px var(--primary), 0 0 40px var(--primary);
  }
}

/* Floating animation */
.float {
  animation: float 3s ease-in-out infinite;
}

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

/* Scroll reveal animation - to be triggered with JavaScript */
.reveal {
  opacity: 0;
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  transform: translateX(-100px);
}

.reveal-right {
  transform: translateX(100px);
}

.reveal-up {
  transform: translateY(100px);
}

.reveal-down {
  transform: translateY(-100px);
}

/* Media queries for responsive animations */
@media (max-width: 767.98px) {
  .animated {
    animation-duration: 0.8s;
  }
  
  .reveal {
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  }
}

/* Bubble Animation Effect */
.bubble-effect {
  position: relative;
  overflow: hidden;
}

.bubble-effect .bubble {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  animation: bubble-animation 6s infinite;
  z-index: 1;
  opacity: 0; /* Start invisible and fade in via JS */
  transition: opacity 0.3s ease;
}

@keyframes bubble-animation {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-100px) scale(1.2);
  }
  100% {
    transform: translateY(-300px) scale(1.5);
    opacity: 0;
  }
}

/* Assicuriamo che il contenuto sia sopra le bolle */
.bubble-effect .container {
  position: relative;
  z-index: 2;
}
