$(document).ready(function () {
  // WOW.js Init
  new WOW({
    boxClass: "wow",
    animateClass: "animated",
    offset: 200,
    mobile: false,
    live: false,
  }).init();

  // Add/remove 'nav-scroll' class to header on scroll
  window.onscroll = function () {
    const header = document.querySelector("header");
    if (header) {
      if (window.scrollY > 50) {
        header.classList.add("nav-scroll");
      } else {
        header.classList.remove("nav-scroll");
      }
    }
  };

  // Scroll to top button
  $(".to-top").click(function () {
    $("html, body").animate({ scrollTop: 0 }, 1000);
    return false;
  });
  // ------------- swiper services -------------//
  var services_slider = new Swiper(".services_slider .swiper-container", {
    slidesPerView: 2,
    spaceBetween: 0,
    speed: 1000,
    pagination: {
      el: ".swiper-pagination",
      clickable: true,
    },
    navigation: {
      nextEl: ".services_slider .swiper-button-next",
      prevEl: ".services_slider .swiper-button-prev",
    },
    mousewheel: false,
    keyboard: true,
    autoplay: {
      delay: 2000,
    },
    loop: false,
    breakpoints: {
      0: {
        slidesPerView: 1,
      },
      480: {
        slidesPerView: 1,
      },
      787: {
        slidesPerView: 1,
      },
      991: {
        slidesPerView: 2,
      },
      1200: {
        slidesPerView: 2,
      },
    },
  });
  document.querySelectorAll(".accordion-button").forEach((button) => {
    const text = button.textContent.trim();
    const words = text.split(" ");
    if (words.length > 1) {
      const first = words.shift();
      button.innerHTML = `<span class="first-word">${first}</span> ${words.join(
        " "
      )}`;
    }
  });
});


// -----------------
var swiper = new Swiper(".testimonials-section .testi-slider", {
  slidesPerView: 2,
  spaceBetween: 50,
  centeredSlides: true,
  speed: 1000,
  pagination: {
    el: ".swiper-pagination",
    clickable: true,
  },
  navigation: {
    nextEl: ".swiper-button-next",
    prevEl: ".swiper-button-prev",
  },
  mousewheel: false,
  keyboard: true,
  autoplay: {
    delay: 5000,
  },
  loop: true,
  breakpoints: {
    0: {
      slidesPerView: 1,
    },
    480: {
      slidesPerView: 2,
    },
    787: {
      slidesPerView: 2,
    },
    991: {
      slidesPerView: 2,
    },
    1200: {
      slidesPerView: 2.2,
    },
  },
});




// -----------------
var swiper = new Swiper(".apps-section .apps-slider", {
  slidesPerView: 2,
  spaceBetween: 50,
  centeredSlides: true,
  speed: 1000,
  pagination: {
    el: ".swiper-pagination",
    clickable: true,
  },
  navigation: {
    nextEl: ".swiper-button-next",
    prevEl: ".swiper-button-prev",
  },
  mousewheel: false,
  keyboard: true,
  autoplay: {
    delay: 5000,
  },
  loop: true,
  breakpoints: {
    0: {
      slidesPerView: 1,
    },
    480: {
      slidesPerView: 2,
    },
    787: {
      slidesPerView: 2,
    },
    991: {
      slidesPerView: 2,
    },
    1200: {
      slidesPerView: 2.6,
    },
  },
});
