<?php
// /elms/student/studentlayout_bottom.php
?>
    </section>
  </main>
</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>

<script>
  const mobileMenuBtn = document.getElementById('mobileMenuBtn');

  if (mobileMenuBtn) {
    mobileMenuBtn.addEventListener('click', () => {
      document.body.classList.toggle('sidebar-open');
    });
  }

  document.addEventListener('click', (e) => {
    if (window.innerWidth > 992) return;

    const sidebar = document.querySelector('.lms-sidebar');
    const btn = document.getElementById('mobileMenuBtn');

    if (
      document.body.classList.contains('sidebar-open') &&
      sidebar &&
      !sidebar.contains(e.target) &&
      btn &&
      !btn.contains(e.target)
    ) {
      document.body.classList.remove('sidebar-open');
    }
  });
</script>
</body>
</html>