<!-- ================= MOBILE BOTTOM NAV ================= -->
<?php 
if (
  !isset($_GET['page']) ||
  (
    $_GET['page'] != 'deposit' &&
    $_GET['page'] != 'withdraw' &&
    $_GET['page'] != 'riwayat' &&
    $_GET['page'] != 'daftar' &&
    $_GET['page'] != 'referral' &&
    $_GET['page'] != 'bahan-iklan' &&
    $_GET['page'] != 'profile' &&
    $_GET['page'] != 'promosi' &&
    $_GET['page'] != 'playgame' &&
    $_GET['page'] != 'roda'
  )
):
?>

<nav class="mbnav">
  <a href="?page=home" class="mbnav-item active">
    <i class="fas fa-home"></i>
    <span>Beranda</span>
  </a>

<?php if ($id_login == false) { ?>
  <a href="?pesan=23" class="mbnav-item">
    <i class="fas fa-gift"></i>
    <span>Bonus</span>
  </a>
<?php } else { ?>
  <a href="?page=riwayat&tab=bonus&start_date=2025-01-01" class="mbnav-item">
    <i class="fas fa-gift"></i>
    <span>Bonus</span>
  </a>
<?php } ?>

  <!-- CENTER BUTTON -->
  <?php if ($id_login == false) { ?>
    <a href="#" data-toggle="modal" data-target="#loginModal" class="mbnav-center">
      <div class="mbnav-center-inner">
        <i class="fas fa-user"></i>
        <em>Masuk</em>
      </div>
    </a>
  <?php } else { ?>
  <a href="javascript:void(0)" class="mbnav-center" id="walletToggle">
    <div class="mbnav-center-inner">
      <i class="fas fa-wallet"></i>
      <em>Wallet</em>
    </div>
  </a>
  <?php } ?>

  <a href="?page=promosi" class="mbnav-item">
    <i class="fas fa-tags"></i>
    <span>Promo</span>
  </a>
  
  <?php if ($id_login == false) { ?>
  <a href="?pesan=23" target="_blank" class="mbnav-item">
    <i class="fas fa-user"></i>
    <span>Akun</span>
  </a>
  <?php } else { ?>
    <a href="?page=profile" class="mbnav-item">
    <i class="fas fa-user"></i>
    <span>Akun</span>
  </a>
  <?php } ?>

</nav>
<?php endif; ?>


<div class="wallet-popup-overlay" id="walletOverlay"></div>
<div class="wallet-popup" id="walletPopup">
  <!-- Deposit -->
  <a href="?page=deposit" class="wallet-card deposit">
    <i class="fas fa-arrow-down"></i>
    <span>Deposit</span>
  </a>

  <!-- Riwayat (TENGAH) -->
  <a href="?page=riwayat&start_date=2025-01-01" class="wallet-card history">
    <i class="fas fa-history"></i>
    <span>Riwayat</span>
  </a>

  <!-- Withdraw -->
  <a href="?page=withdraw" class="wallet-card withdraw">
    <i class="fas fa-arrow-up"></i>
    <span>Withdraw</span>
  </a>
</div>

<!-- ================= NAV WALLET ================= -->
<script>
const walletBtn = document.getElementById("walletToggle");
const popup = document.getElementById("walletPopup");
const overlay = document.getElementById("walletOverlay");

walletBtn.addEventListener("click", () => {
  popup.classList.toggle("active");
  overlay.classList.toggle("active");
});

overlay.addEventListener("click", () => {
  popup.classList.remove("active");
  overlay.classList.remove("active");
});
</script>
<!-- ================= NAV WALLET ================= -->
