document.addEventListener('DOMContentLoaded', function() { // Mobile menu toggle functionality const mobileMenuButton = document.querySelector('[data-menu-toggle]'); const mobileMenu = document.querySelector('[data-menu]'); if(mobileMenuButton && mobileMenu) { mobileMenuButton.addEventListener('click', () => { mobileMenu.classList.toggle('hidden'); }); } // Smooth scrolling for anchor links document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); document.querySelector(this.getAttribute('href')).scrollIntoView({ behavior: 'smooth' }); }); }); // Testimonial slider const testimonials = document.querySelectorAll('.testimonial-item'); let currentTestimonial = 0; if(testimonials.length > 0) { function showTestimonial(index) { testimonials.forEach(testimonial => { testimonial.classList.add('hidden'); }); testimonials[index].classList.remove('hidden'); } setInterval(() => { currentTestimonial = (currentTestimonial + 1) % testimonials.length; showTestimonial(currentTestimonial); }, 5000); } });