/* ==========================================================================
   ELECTRIK SOLUCIONES - ANIMACIONES Y EFECTOS VISUALES
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. ENTARDA Y REVELADO AL HACER SCROLL (INTERACTION)
   -------------------------------------------------------------------------- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Revelado escalonado para tarjetas */
.reveal-card {
  opacity: 0;
  transform: translateY(40px) scale(0.96);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Delays para efecto cascada en cuadrículas */
.services-grid .reveal-card:nth-child(1) { transition-delay: 0.1s; }
.services-grid .reveal-card:nth-child(2) { transition-delay: 0.2s; }
.services-grid .reveal-card:nth-child(3) { transition-delay: 0.3s; }
.services-grid .reveal-card:nth-child(4) { transition-delay: 0.4s; }

.projects-grid .reveal-card:nth-child(1) { transition-delay: 0.15s; }
.projects-grid .reveal-card:nth-child(2) { transition-delay: 0.3s; }
.projects-grid .reveal-card:nth-child(3) { transition-delay: 0.45s; }

/* --------------------------------------------------------------------------
   2. FADE IN HERO (CARGA INICIAL)
   -------------------------------------------------------------------------- */
.fade-in {
  animation: fadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.hero-content .badge.fade-in { animation-delay: 0.2s; }
.hero-content .hero-title.fade-in { animation-delay: 0.4s; }
.hero-content .hero-subtitle.fade-in { animation-delay: 0.6s; }
.hero-content .hero-buttons.fade-in { animation-delay: 0.8s; }

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   3. EFECTOS GLOW Y SHIMMER (BOTONES Y ELEMENTOS DESTACADOS)
   -------------------------------------------------------------------------- */
/* Botón resplandeciente */
.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 30%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 70%
  );
  transform: rotate(30deg) translateY(-100%);
  transition: transform 0.8s ease;
}

.btn-glow:hover::after {
  transform: rotate(30deg) translateY(100%);
}

/* Pulse verde en badges y llamada a la acción */
.badge-pulse {
  position: relative;
}

.badge-pulse::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -12px;
  width: 8px;
  height: 8px;
  background-color: var(--accent-color);
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
  0% {
    transform: translateY(-50%) scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: translateY(-50%) scale(1);
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    transform: translateY(-50%) scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* --------------------------------------------------------------------------
   4. EFECTOS HOVER ELEVATION
   -------------------------------------------------------------------------- */
.service-card, .project-card, .stat-card {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.35s ease;
}

/* --------------------------------------------------------------------------
   5. OPTIMIZACIÓN DE ACCESIBILIDAD (PREFIERE REDUCCIÓN DE MOVIMIENTO)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll,
  .reveal-card,
  .fade-in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
  .client-track {
    animation-duration: 40s;
  }
}