// Main Slider Js
jQuery(document).ready(function(){
  var owl = jQuery('.owl-carousel');
    owl.owlCarousel({
    margin: 30,
    nav: true,
    navText: ["<span class='dashicons dashicons-arrow-left-alt2'></span>", "<span class='dashicons dashicons-arrow-right-alt2'></span>"],
    autoplay: true,
    lazyLoad: true,
    autoplayTimeout: 3000,
    loop: true,
    dots: false,
    items: 1
  });
});

// Progress Bar
document.addEventListener("DOMContentLoaded", function () {
  const startup_consultant_barBoxes = document.querySelectorAll(".bar-box");

  startup_consultant_barBoxes.forEach((startup_consultant_box) => {
    const startup_consultant_percentText = startup_consultant_box.querySelector(".percent")?.innerText || "0%";
    const startup_consultant_bar = startup_consultant_box.querySelector(".bar");

    const startup_consultant_value = parseInt(startup_consultant_percentText, 10);
    startup_consultant_bar.style.width = startup_consultant_value + "%";
  });
});

// Scroll to Top
document.addEventListener('DOMContentLoaded', () => {
  const startup_consultant_btn = document.body.appendChild(document.createElement('button'));
  startup_consultant_btn.className = 'return-to-top-btn';
  startup_consultant_btn.innerHTML = '<span class="dashicons dashicons-arrow-up-alt"></span>';

  window.addEventListener('scroll', () =>
    startup_consultant_btn.classList.toggle('show', window.scrollY > 300)
  );

  startup_consultant_btn.onclick = () => window.scrollTo({ top: 0, behavior: 'smooth' });
});