/**
 * INTERACTIVE LAB FACILITY VIEWER JAVASCRIPT
 */

document.addEventListener('DOMContentLoaded', () => {
  const labTabs = document.querySelectorAll('.lab-tab-btn');
  const labContainers = document.querySelectorAll('.lab-detail-container');

  if (labTabs.length > 0) {
    labTabs.forEach(btn => {
      btn.addEventListener('click', () => {
        const targetLabId = btn.getAttribute('data-lab');

        // Update active tab buttons
        labTabs.forEach(b => b.classList.remove('active'));
        btn.classList.add('active');

        // Toggle lab display containers
        labContainers.forEach(container => {
          if (targetLabId === 'all' || container.id === targetLabId) {
            container.style.display = 'grid';
          } else {
            container.style.display = 'none';
          }
        });
      });
    });
  }
});
