/* 
  Animated Gradient Text Effect
  Using @property + linear-gradient() + background-clip + text-fill-color
*/

/* 
  CSS custom properties for color animation
  These allow the browser to animate color transitions smoothly
*/
@property --color-1 {
  syntax: "<color>";
  inherits: false;
  initial-value: hsl(215 100% 60%);
}

@property --color-2 {
  syntax: "<color>";
  inherits: false;
  initial-value: hsl(260 100% 65%);
}

/* Keyframes that change the color variables */
@keyframes gradient-change {
  to {
    --color-1: hsl(210 100% 59%);
    --color-2: hsl(310 100% 59%);
  }
}

/* Base animated gradient text class */
.animated-gradient-text {
  /* Apply variable changes over time */
  animation: gradient-change 2s linear infinite alternate;
  
  background: linear-gradient(
    /* 
      Using oklch for more vibrant gradient results 
      More info: https://developer.chrome.com/docs/css-ui/access-colors-spaces#color_interpolation
    */
    to right in oklch, 
    /* Use the variables in a gradient */
    var(--color-1), 
    var(--color-2)
  );
  
  /* Old browser support */
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  
  /* Modern browser version */
  background-clip: text !important;
  color: transparent !important;
  
  /* Ensure the text remains visible during animation */
  position: relative !important;
  display: inline-block !important;
}

/* Regole specifiche per sovrascrivere gli stili esistenti - SOLO gradiente, NO interazioni */
html body .services-enterprise .services-highlight.blue-animated-gradient,
html body .about-enterprise .about-highlight.blue-animated-gradient,
html body .projects-enterprise .projects-highlight.blue-animated-gradient {
  /* Apply variable changes over time */
  animation: blue-gradient-change 3s ease-in-out infinite !important;
  
  background: linear-gradient(
    90deg,
    #3b82f6 0%,
    #8b5cf6 25%,
    #ec4899 50%,
    #8b5cf6 75%,
    #3b82f6 100%
  ) !important;
  background-size: 300% 100% !important;
  
  /* Old browser support */
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  
  /* Modern browser version */
  background-clip: text !important;
  color: transparent !important;
  
  /* Ensure the text remains visible during animation */
  position: relative !important;
  display: inline-block !important;
  
  /* Fix per lettere con discese come g, j, p, q, y */
  line-height: 1.2 !important;
  padding-bottom: 0.1em !important;
  box-decoration-break: clone !important;
  -webkit-box-decoration-break: clone !important;
  
  /* NO cursor pointer - l'interazione è solo sul titolo completo */
  cursor: inherit !important;
  user-select: inherit !important;
  
  /* NO transizioni interattive */
  transition: none !important;
}

/* Regola specifica per il testo normale del titolo testimonials (escluso lo span) */
html body .testimonials .section-header h2 {
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 25%, #ec4899 50%, #8b5cf6 75%, #3b82f6 100%) !important;
  background-size: 300% 100% !important;
  animation: debug-gradient-move 3s ease-in-out infinite !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  color: transparent !important;
  
  /* Fix specifico per lettere con discese */
  line-height: 1.3 !important;
  padding-bottom: 0.15em !important;
  vertical-align: baseline !important;
  overflow: visible !important;
}

/* Manteniamo lo span bianco senza effetto gradiente */
html body .testimonials .section-header h2 .testimonials-white {
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: initial !important;
  background-clip: initial !important;
  color: white !important;
  animation: none !important;
}

/* Blue-specific animated gradient with better keyframes */
@keyframes blue-gradient-change {
  0% {
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    background-position: 0% 50%;
  }
  25% {
    background: linear-gradient(90deg, #8b5cf6 0%, #ec4899 100%);
    background-position: 25% 50%;
  }
  50% {
    background: linear-gradient(90deg, #ec4899 0%, #06b6d4 100%);
    background-position: 50% 50%;
  }
  75% {
    background: linear-gradient(90deg, #06b6d4 0%, #8b5cf6 100%);
    background-position: 75% 50%;
  }
  100% {
    background: linear-gradient(90deg, #8b5cf6 0%, #3b82f6 100%);
    background-position: 100% 50%;
  }
}

/* Blue-specific animated gradient class */
.blue-animated-gradient {
  animation: blue-gradient-change 3s ease-in-out infinite;
  
  background: linear-gradient(
    to right in oklch,
    var(--color-1),
    var(--color-2)
  );
  
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  color: transparent !important;
  position: relative !important;
  display: inline-block !important;
}

/* Effetto gradient animato finale - con fix per discese */
.blue-animated-gradient {
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 25%, #ec4899 50%, #8b5cf6 75%, #3b82f6 100%) !important;
  background-size: 300% 100% !important;
  animation: debug-gradient-move 3s ease-in-out infinite !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  
  /* Fix specifico per lettere con discese come g, j, p, q, y */
  line-height: 1.3 !important;
  padding-bottom: 0.15em !important;
  vertical-align: baseline !important;
  overflow: visible !important;
}

@keyframes debug-gradient-move {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* RIMOSSI tutti gli effetti shimmer dalle parti blu per evitare interazioni separate */
/* Il shimmer ora è gestito solo tramite JavaScript sui titoli completi */

/* Fallback for browsers that don't support @property */
@supports not (color: oklch(0 0 0)) {
  .animated-gradient-text,
  .blue-animated-gradient {
    background: linear-gradient(
      90deg,
      #3b82f6 0%,
      #8b5cf6 25%,
      #ec4899 50%,
      #8b5cf6 75%,
      #3b82f6 100%
    ) !important;
    background-size: 200% 100% !important;
    animation: gradient-shift 2s ease-in-out infinite !important;
    
    /* Ensure text clipping works */
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
  }
  
  @keyframes gradient-shift {
    0%, 100% {
      background-position: 0% 50%;
    }
    50% {
      background-position: 100% 50%;
    }
  }
}

/* Enhanced shimmer effect for extra visual appeal */
.animated-gradient-text.with-shimmer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 3s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  50% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

/* Ensure text remains readable */
.animated-gradient-text.with-shimmer {
  overflow: hidden;
  position: relative;
}

/* Additional fallback for very old browsers */
@media (prefers-reduced-motion: no-preference) {
  .animated-gradient-text,
  .blue-animated-gradient {
    /* Ensure minimum contrast for accessibility */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
  }
}

/* Reduced motion fallback */
@media (prefers-reduced-motion: reduce) {
  .animated-gradient-text,
  .blue-animated-gradient {
    animation: none !important;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
  }
}

/* Ensure text remains visible during load */
.animated-gradient-text,
.blue-animated-gradient {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Effetti di hover SUPER SPECIFICI per forzare l'applicazione */
html body .services-enterprise .services-enterprise-title:hover,
html body .about-enterprise .about-enterprise-title:hover,
html body .projects-enterprise .projects-enterprise-title:hover,
html body .contact .section-header h2:hover,
html body .testimonials .section-header h2:hover,
.services-enterprise-title:hover,
.about-enterprise-title:hover,
.projects-enterprise-title:hover,
h2:hover {
  transform: scale(1.1) !important;
  filter: brightness(1.5) drop-shadow(0 0 20px rgba(59, 130, 246, 0.8)) !important;
  transition: all 0.2s ease !important;
}

/* Effetto ripple CSS rimosso per semplificare */
/* 
.title-ripple-effect:hover {
  position: relative !important;
  overflow: hidden !important;
}

.title-ripple-effect:hover::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  animation: ripple-animation 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
  pointer-events: none;
  z-index: 1;
}
*/

@keyframes ripple-animation {
  0% {
    width: 0;
    height: 0;
    opacity: 1;
  }
  100% {
    width: 200px;
    height: 200px;
    opacity: 0;
  }
}


