<!DOCTYPE html>
<html lang="en">
    
    <head>
      
      <?php include "elements/head.php"; ?>
    
    </head>

    <body>

        <!-- ***** Preloader Start ***** -->
        <!--
        <div id="js-preloader" class="js-preloader">
            <div class="preloader-inner">
                <span class="dot"></span>
                <div class="dots">
                    <span></span>
                    <span></span>
                    <span></span>
                </div>
            </div>
        </div>
        -->
        <!-- ***** Preloader End ***** -->

        <!-- ***** Header Area Start ***** -->
  
        <?php include "elements/header.php"; ?>
  
        <!-- ***** Header Area End ***** -->

        <!-- Contents Start -->
            <?php
            if($segment[1] == '')
            {
                include __DIR__ . "/contents/home.php";
            }
            else
            {
                if(file_exists(__DIR__ . "/contents/".$segment[1].".php"))
                {
                    if($segment[2] != '' AND $segment[1] != 'search')
                    {
                        if($segment[1] == 'games')
                        {
                            include __DIR__ . "/contents/play.php";
                        }
                        else
                        {
                            include __DIR__ . "/contents/" .$segment[1]. ".php";
                        }
                    }
                    else
                    {
                        include __DIR__ . "/contents/".$segment[1].".php";
                    }
                }
                else
                {
                    include __DIR__ . "/contents/404.php";
                }
            }
            ?>
        <!-- Contents End -->
    
        <!-- Maps footer Start -->
        <?php include "elements/footer.php"; ?>
        <!-- Maps footer End -->

        <!-- Scripts -->
        <!-- Bootstrap core JavaScript 
        <script src="<?php echo THEME_PATH; ?>/vendor/jquery/jquery.min.js"></script>
        <script src="<?php echo THEME_PATH; ?>/vendor/bootstrap/js/bootstrap.min.js"></script>

        <script src="<?php echo THEME_PATH; ?>/assets/js/isotope.min.js"></script>
        <script src="<?php echo THEME_PATH; ?>/assets/js/owl-carousel.js"></script>
        <script src="<?php echo THEME_PATH; ?>/assets/js/tabs.js"></script>
        <script src="<?php echo THEME_PATH; ?>/assets/js/popup.js"></script>
        <script src="<?php echo THEME_PATH; ?>/assets/js/custom.js"></script>-->
        
        <script>
  // Toggle mobile menu open/close
  const hamburger = document.querySelector('.hamburger');
  const mobileMenu = document.getElementById('mobile-menu');

  hamburger.addEventListener('click', () => {
    const expanded = hamburger.getAttribute('aria-expanded') === 'true';
    hamburger.setAttribute('aria-expanded', String(!expanded));
    mobileMenu.classList.toggle('open');
  });

  // Accordion toggle for Categories in mobile menu
  document.addEventListener('DOMContentLoaded', () => {
    const dropdownToggle = mobileMenu.querySelector('.dropdown-toggle');
    const dropdownParent = dropdownToggle.closest('.has-dropdown');

    dropdownToggle.addEventListener('click', () => {
      const isOpen = dropdownParent.classList.toggle('open');
      dropdownToggle.setAttribute('aria-expanded', isOpen);
    });
  });
</script>
        
    </body>

</html>
