/* SisPen Snesaka - Main JavaScript */

document.addEventListener('DOMContentLoaded', function () {

  // ============ AUTO-DISMISS ALERTS ============
  const alerts = document.querySelectorAll('.alert');
  alerts.forEach(a => {
    setTimeout(() => {
      a.style.transition = 'opacity .4s';
      a.style.opacity = '0';
      setTimeout(() => a.remove(), 400);
    }, 4000);
  });

  // ============ ACTIVE LINK HIGHLIGHT ============
  const menuItems = document.querySelectorAll('.menu-item');
  menuItems.forEach(item => {
    if (item.href && item.href === window.location.href) {
      item.classList.add('active');
    }
  });

});
