/* ============================================
   MR VENTILATIE - ANIMATIONS & MICRO-INTERACTIONS
   Smooth, professional animations for better UX
   ============================================ */

/* === SMOOTH SCROLL BEHAVIOR === */
html {
  scroll-behavior: smooth;
}

/* Respect user preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* === BUTTON HOVER & ACTIVE STATES === */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before {
  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.5s ease, height 0.5s ease;
  pointer-events: none;
}

.btn:hover::before {
  width: 300%;
  height: 300%;
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(13, 134, 247, 0.35);
}

.btn-primary:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 4px 15px rgba(13, 134, 247, 0.25);
}

.btn-secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(13, 134, 247, 0.35);
}

.btn-secondary:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 4px 15px rgba(13, 134, 247, 0.25);
}

.btn-outline:hover {
  transform: translateY(-3px);
  background: var(--primary);
  color: white;
  box-shadow: 0 8px 25px rgba(13, 134, 247, 0.25);
}

.btn-outline:active {
  transform: translateY(-1px) scale(0.98);
}

/* === FOCUS STATES FOR ACCESSIBILITY === */
.btn:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

.btn-primary:focus-visible {
  outline-color: var(--primary-dark);
}

.btn-secondary:focus-visible {
  outline-color: var(--primary-mid);
}

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 134, 247, 0.15);
}

/* === LINK HOVER ANIMATIONS === */
.nav-list a,
.footer-about a,
.site-footer a {
  position: relative;
  transition: color 0.25s ease;
}

/* Underline hover effect - exclude dropdown parent links which use ::after for chevron */
.nav-list > li:not(.has-dropdown) > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease, left 0.3s ease;
}

.nav-list > li:not(.has-dropdown) > a:hover::after {
  width: 100%;
  left: 0;
}

/* === CARD ANIMATIONS === */
@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered card entrance */
.service-card,
.service-card-home,
.benefit-item,
.stat-item,
.testimonial-card,
.faq-item {
  animation: cardEnter 0.5s ease backwards;
}

.service-card:nth-child(1), .service-card-home:nth-child(1),
.benefit-item:nth-child(1), .stat-item:nth-child(1),
.testimonial-card:nth-child(1) { animation-delay: 0.1s; }

.service-card:nth-child(2), .service-card-home:nth-child(2),
.benefit-item:nth-child(2), .stat-item:nth-child(2),
.testimonial-card:nth-child(2) { animation-delay: 0.15s; }

.service-card:nth-child(3), .service-card-home:nth-child(3),
.benefit-item:nth-child(3), .stat-item:nth-child(3),
.testimonial-card:nth-child(3) { animation-delay: 0.2s; }

.service-card:nth-child(4), .service-card-home:nth-child(4),
.benefit-item:nth-child(4), .stat-item:nth-child(4) { animation-delay: 0.25s; }

/* === ICON ANIMATIONS === */
.benefit-icon,
.usp-check,
.process-number {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.3s ease,
              color 0.3s ease;
}

.benefit-item:hover .benefit-icon {
  transform: scale(1.1);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deepest) 100%);
  color: white;
}

.usp-item:hover .usp-check {
  transform: scale(1.15) rotate(5deg);
}

/* === FAQ ACCORDION ANIMATION === */
.faq-item summary::after {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.3s ease,
              color 0.3s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-answer {
  animation: faqOpen 0.3s ease;
}

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

/* === SCROLL-TRIGGERED ANIMATIONS === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

/* Utility classes for scroll animations */
.animate-fade-in-up {
  animation: fadeInUp 0.6s ease backwards;
}

.animate-fade-in {
  animation: fadeIn 0.6s ease backwards;
}

.animate-slide-left {
  animation: slideInLeft 0.6s ease backwards;
}

.animate-slide-right {
  animation: slideInRight 0.6s ease backwards;
}

/* Delay utilities */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* === LOADING STATES === */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* === PRICE BADGE PULSE === */
@keyframes pricePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
  }
}

.price-badge:hover {
  animation: pricePulse 1.5s ease infinite;
}

/* === HEADER SCROLL EFFECT === */
.site-header {
  transition: background 0.3s ease,
              box-shadow 0.3s ease,
              padding 0.3s ease;
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

/* === MOBILE MENU ANIMATION === */
.mobile-menu-toggle span {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* === FLOATING ELEMENTS === */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

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

/* === CTA SECTION ANIMATION === */
.cta-section .btn-primary {
  position: relative;
  overflow: hidden;
}

.cta-section .btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transform: rotate(45deg);
  transition: left 0.5s ease;
}

.cta-section .btn-primary:hover::after {
  left: 100%;
}

/* === TESTIMONIAL QUOTE ANIMATION === */
.testimonial-card::before {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.testimonial-card:hover::before {
  transform: scale(1.2);
  opacity: 0.25;
}

/* === PROCESS STEP CONNECTOR === */
.process-grid::before {
  content: '';
  position: absolute;
  top: 36px;
  left: 15%;
  right: 15%;
  height: 2px;
  background: linear-gradient(90deg, var(--border), var(--primary), var(--border));
  z-index: 0;
}

@media (max-width: 768px) {
  .process-grid::before {
    display: none;
  }
}

/* === CITY LINK HOVER === */
.city-link {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.city-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(13, 134, 247, 0.2);
}

/* === SMOOTH IMAGE LOADING === */
img {
  transition: opacity 0.3s ease;
}

img[loading="lazy"] {
  opacity: 0;
}

img[loading="lazy"].loaded,
img:not([loading="lazy"]) {
  opacity: 1;
}
