(function ($) {
  "use strict";

  $(window).on("scroll", function () {
    if ($(this).scrollTop() > 100) {
      $(".navbar-area").addClass("is-sticky");
    } else {
      $(".navbar-area").removeClass("is-sticky");
    }
  });

  jQuery(".mean-menu").meanmenu({
    meanScreenWidth: "1199",
  }); 

  $(".others-option-for-responsive .dot-menu").on("click", function () {
    $(".others-option-for-responsive .container .container").toggleClass(
      "active"
    );
  });
  $(".others-options .search-box").on("click", function () {
    $(".search-overlay").toggleClass("search-overlay-active");
  });
  $(".search-overlay-close").on("click", function () {
    $(".search-overlay").removeClass("search-overlay-active");
  });

  // testimonial Slider
  $(".testimonial-slider-wrapper").owlCarousel({
    loop: true,
    autoplayHoverPause: true,
  autoplay: true,
    margin: 100,
    smartSpeed: 1000,
    dots: false,
    nav: true,
    responsiveClass: true,
    navText: [
      "<i class='fas fa-arrow-left'></i>",
      "<i class='fas fa-arrow-right'></i>",
    ],
    responsive: {
      0: {
        items: 1,
      },
      600: {
        items: 1,
      },
      1000: {
        items: 1,
      },
    },
  });

  $(".instagram-slider-wrapper").owlCarousel({
    loop: true,
    dots: false,
    autoplayHoverPause: true,
    autoplay: true,
    smartSpeed: 1000,
    margin: 0,
    nav: false,
    responsive: {
      0: {
        items: 1,
      },
      570: {
        items: 2,
      },
      768: {
        items: 3,
      },
      1200: {
        items: 5,
      },
    },
  });
  
$(".partner-slider-wrapper").owlCarousel({
    loop: true,
    dots: false,
    autoplay: true, // Enable autoplay
    autoplayHoverPause: true,
    autoplayTimeout: 500, // Delay between transitions in milliseconds (0.5 seconds)
    smartSpeed: 300, // Speed of the animations in milliseconds (0.3 seconds)
    margin: 100,
    nav: false,
    responsive: {
        0: {
            items: 3,
            margin: 10,
        },
        768: {
            items: 3,
        },
        992: {
            items: 4,
        },
        1200: {
            items: 6,
        },
    },
});
  $(".news-details-slide-wrapper").owlCarousel({
    loop: true,
    autoplayHoverPause: true,
    autoplay: true,
    smartSpeed: 1000,
    margin: 50,
    dots: false,
    nav: true,
    responsiveClass: true,

    responsive: {
      0: {
        items: 1,
      },
      600: {
        items: 1,
      },
      1000: {
        items: 2,
      },
    },
  });

  // home two testi slider 
  $(".home_two_testi_slider").owlCarousel({
    loop: true,
    autoplayHoverPause: true,
    autoplay: true,
    margin: 100,
    smartSpeed: 1000,
    dots: false,
    nav: false,
    responsiveClass: true,
    responsive: {
      0: {
        items: 1,
      },
      600: {
        items: 1,
      },
      1000: {
        items: 1,
      },
    },
  });

  // home two testi slider 
  $(".testi_slider_two").owlCarousel({
    loop: true,
    autoplayHoverPause: true,
    autoplay: true,
    margin: 30,
    smartSpeed: 1000,
    dots: true,
    nav: false,
    responsiveClass: true,
    responsive: {
      0: {
        items: 1,
      },
      767: {
        items: 2,
      },
      1200: {
        items: 3,
      },
    },
  });

  // counter
  jQuery(document).ready(function ($) {
    $(".counter").counterUp({
      delay: 10,
      time: 1000,
    });
  });

  // Preeloader
  $(window).on("load", function () {
    $("#status").fadeOut();
    $("#preloader").delay(350).fadeOut("slow");
  });

// Go to top
  $(function () {
    $(window).on('scroll', function () {
        var scrolled = $(window).scrollTop();
        if (scrolled > 600) $('.go-top').addClass('active'); if (scrolled < 600) $('.go-top').removeClass('active');
    });

    $('.go-top').on('click', function () { $("html, body").animate({ scrollTop: "0" }, 500); });
});
})(jQuery);
