document.addEventListener('DOMContentLoaded', function() { // Tab switching functionality for multi-modal content demo const tabButtons = document.querySelectorAll('.tab-button'); const tabContents = document.querySelectorAll('.tab-content'); tabButtons.forEach(button => { button.addEventListener('click', function() { const targetTab = this.getAttribute('data-tab'); // Remove active class from all buttons and content tabButtons.forEach(btn => btn.classList.remove('active')); tabContents.forEach(content => content.classList.remove('active')); // Add active class to clicked button and corresponding content this.classList.add('active'); const targetContent = document.getElementById(targetTab + '-tab'); if (targetContent) { targetContent.classList.add('active'); } }); }); // Smooth scroll for anchor links document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { const href = this.getAttribute('href'); if (href !== '#' && href !== '#contact') { e.preventDefault(); const target = document.querySelector(href); if (target) { target.scrollIntoView({ behavior: 'smooth', block: 'start' }); } } }); }); });