if ($(window).width() > 991) {
    // // Tabs Animation Start
    // Function to preload an image
    function preloadImage(src) {
        const img = new Image();
        img.src = src;
    }

    document.addEventListener("DOMContentLoaded", function() {
        document.querySelectorAll('.img-cont img').forEach(function(image) {
            preloadImage(image.src);
        });
    });

    function animateContent(activeTabContent) {
        const img = activeTabContent.querySelector('.img-cont img');
        const rightCard = activeTabContent.querySelector('.right-card');
        const leftCard = activeTabContent.querySelector('.left-card');

        img.classList.remove('animated');

        gsap.fromTo(img, { scale: 0.6, opacity: 0 }, { scale: 1, opacity: 1, duration: 0.9, ease: 'power2.out' });

        img.classList.add('animated');

        gsap.fromTo(rightCard, { x: '100%', opacity: 0, scale: 0.6 }, { x: '0%', opacity: 1, scale: 1, duration: 0.6, ease: 'power2.out' });

        gsap.fromTo(leftCard, { x: '-100%', opacity: 0, scale: 0.6 }, { x: '0%', opacity: 1, scale: 1, duration: 0.6, ease: 'power2.out', delay: 0.3 });
    }

    document.querySelectorAll('a[data-bs-toggle="tab"]').forEach(function (tab) {
        tab.addEventListener('shown.bs.tab', function (event) {
            const activeTabId = event.target.getAttribute('href');
            const activeTabContent = document.querySelector(activeTabId);
            const currentTabContent = document.querySelector('.tab-pane.show.active');

            if (currentTabContent) {
                currentTabContent.classList.remove('show', 'active');
            }
            activeTabContent.classList.add('show', 'active');

            animateContent(activeTabContent);
        });
    });
    // // Tabs Animation end
}
