/* ===========================
   ELECTROMONTAZH - ANIMATIONS
   =========================== */

/* ===== KEYFRAMES ===== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 166, 35, 0.4);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(245, 166, 35, 0);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(245, 166, 35, 0.2), 0 4px 20px rgba(245, 166, 35, 0.2);
  }
  50% {
    box-shadow: 0 0 20px rgba(245, 166, 35, 0.5), 0 4px 30px rgba(245, 166, 35, 0.4);
  }
}

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

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes numberCount {
  from { opacity: 0; transform: scale(0.5) rotate(-10deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes borderDraw {
  from { stroke-dashoffset: 1000; }
  to { stroke-dashoffset: 0; }
}

@keyframes progressFill {
  from { width: 0; }
  to { width: var(--target-width); }
}

/* ===== HERO ANIMATIONS ===== */

.hero-badge {
  animation: fadeInDown 0.6s ease forwards;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h1 {
  animation: fadeInUp 0.7s ease 0.2s both;
}

.hero-desc {
  animation: fadeInUp 0.7s ease 0.35s both;
}

.hero-actions {
  animation: fadeInUp 0.7s ease 0.5s both;
}

.hero-badges {
  animation: fadeInUp 0.7s ease 0.65s both;
}

/* ===== SCROLL REVEAL ===== */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Staggered children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.12s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.19s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.26s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.33s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.40s; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.47s; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.54s; }

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ===== BUTTON ANIMATIONS ===== */

.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease, opacity 0.6s ease;
  opacity: 0;
}

.btn-primary:hover::after {
  width: 300px;
  height: 300px;
  opacity: 0;
}

.btn-primary:active::after {
  width: 0;
  height: 0;
  opacity: 1;
  transition: 0s;
}

/* CTA pulse effect */
.btn-pulse {
  animation: pulse 2s infinite;
}

/* ===== FLOATING BUTTON ANIMATIONS ===== */

.floating-btn {
  animation: float 4s ease-in-out infinite;
}

.floating-whatsapp {
  animation-delay: 0s;
}

.floating-phone {
  animation-delay: 0.7s;
}

/* ===== CARD HOVER EFFECTS ===== */

.service-card,
.advantage-card,
.portfolio-card,
.process-card,
.contact-card {
  will-change: transform;
}

/* Icon spin on hover */
.service-card:hover .service-icon svg {
  animation: spin 0.5s ease;
}

/* ===== NUMBER CIRCLE ANIMATION ===== */

.process-number {
  animation: scaleIn 0.4s ease both;
}

/* ===== FAQ ANIMATION ===== */

.faq-answer {
  animation: none;
}

.faq-item.active .faq-answer {
  animation: fadeInUp 0.3s ease;
}

/* ===== SHIMMER / LOADING ===== */

.shimmer {
  background: linear-gradient(
    90deg,
    var(--light) 25%,
    var(--light2) 50%,
    var(--light) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ===== HEADER SCROLL ANIMATION ===== */

.header {
  transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

/* ===== PAGE TRANSITION ===== */

.page-transition {
  animation: fadeIn 0.4s ease;
}

/* ===== DECORATIVE ELEMENTS ===== */

/* Lightning bolt decoration */
.hero-decoration {
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.04;
  pointer-events: none;
  animation: float 6s ease-in-out infinite;
}

/* ===== SECTION DIVIDER ANIMATION ===== */

.section-divider {
  transform-origin: left;
  animation: progressFill 0.8s ease;
}

@keyframes widthExpand {
  from { width: 0; }
  to { width: 60px; }
}

/* ===== COUNTER ANIMATION ===== */

.counter-value {
  display: inline-block;
  transition: all 0.3s ease;
}

/* ===== LOGO HOVER ===== */

.logo:hover .logo-icon {
  animation: pulse 0.6s ease;
}

/* ===== FORM FOCUS ANIMATION ===== */

.form-group input:focus,
.form-group textarea:focus {
  animation: glow 2s ease infinite;
}

/* ===== DROPDOWN ENTER ANIMATION ===== */

.dropdown {
  transform-origin: top left;
}

.nav-item:hover .dropdown {
  animation: slideInDown 0.2s ease;
}

/* ===== MOBILE NAV ANIMATION ===== */

.mobile-nav.open .mobile-nav-list li {
  animation: fadeInLeft 0.3s ease both;
}

.mobile-nav.open .mobile-nav-list li:nth-child(1) { animation-delay: 0.05s; }
.mobile-nav.open .mobile-nav-list li:nth-child(2) { animation-delay: 0.10s; }
.mobile-nav.open .mobile-nav-list li:nth-child(3) { animation-delay: 0.15s; }
.mobile-nav.open .mobile-nav-list li:nth-child(4) { animation-delay: 0.20s; }
.mobile-nav.open .mobile-nav-list li:nth-child(5) { animation-delay: 0.25s; }

/* ===== RESPONSIVE - REDUCE MOTION ===== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
