<nav class="navbar navbar-light navbar-glass navbar-top sticky-kit navbar-expand-lg">
  <a class="navbar-brand mr-1 mr-sm-3" href="../index.html">
    <div class="d-flex align-items-center">
      <!-- <img class="mr-2" src="https://diskominfo.tobakab.go.id/themes/admin/assets/img/logos/logo.png" alt="" height="40" /> -->
    </div>
  </a>
  <div class="collapse navbar-collapse" id="navbarStandard">
    <ul class="navbar-nav">
      <!-- <li class="nav-item<?php if (current_url() === site_url('admin/dashboard')) { ?> active<?php } ?>"><a
          class="nav-link" href="<?php echo site_url('admin/dashboard') ?>" class="nav-link"
          id="navbarDropdownHome"
          href="<?= base_url('admin/dashboard/') ?>"
          role="button"
          aria-haspopup="true"
          aria-expanded="false">
          Dashboard
        </a>
      </li>


      <li class="nav-item<?php if (current_url() === site_url('admin/page')) { ?> active<?php } ?>"><a
          class="nav-link" href="<?php echo site_url('admin/page') ?>" class="nav-link"
          id="navbarDropdownHome"
          href="<?= base_url('admin/page/') ?>"
          role="button"
          aria-haspopup="true"
          aria-expanded="false">
          Page
        </a>
      </li>
      <li class="nav-item<?php if (current_url() === site_url('admin/news')) { ?> active<?php } ?>"><a
          class="nav-link" href="<?php echo site_url('admin/news') ?>" class="nav-link"
          id="navbarDropdownHome"
          href="<?= base_url('admin/news/') ?>"
          role="button"
          aria-haspopup="true"
          aria-expanded="false">
          News and Media
        </a>
      </li>
      <li class="nav-item<?php if (current_url() === site_url('admin/banner')) { ?> active<?php } ?>"><a
          class="nav-link" href="<?php echo site_url('admin/banner') ?>" class="nav-link"
          id="navbarDropdownHome"
          href="<?= base_url('admin/banner/') ?>"
          role="button"
          aria-haspopup="true"
          aria-expanded="false">
          Banner
        </a>
      </li>
      <li class="nav-item<?php if (current_url() === site_url('admin/gallery')) { ?> active<?php } ?>"><a
          class="nav-link" href="<?php echo site_url('admin/gallery') ?>" class="nav-link"
          id="navbarDropdownHome"
          href="<?= base_url('admin/gallery/') ?>"
          role="button"
          aria-haspopup="true"
          aria-expanded="false">
          Album
        </a>
      </li>
      <li class="nav-item<?php if (current_url() === site_url('admin/archive')) { ?> active<?php } ?>"><a
          class="nav-link" href="<?php echo site_url('admin/archive') ?>" class="nav-link"
          id="navbarDropdownHome"
          href="<?= base_url('admin/archive/') ?>"
          role="button"
          aria-haspopup="true"
          aria-expanded="false">
          File Manager
        </a>
      </li>
      <li class="nav-item<?php if (current_url() === site_url('admin/message')) { ?> active<?php } ?>"><a
          class="nav-link" href="<?php echo site_url('admin/message') ?>" class="nav-link"
          id="navbarDropdownHome"
          href="<?= base_url('admin/message/') ?>"
          role="button"
          aria-haspopup="true"
          aria-expanded="false">
          Message
        </a>
      </li>
      <li class="nav-item<?php if (current_url() === site_url('admin/trash')) { ?> active<?php } ?>"><a
          class="nav-link" href="<?php echo site_url('admin/trash') ?>" class="nav-link"
          id="navbarDropdownHome"
          href="<?= base_url('admin/trash/') ?>"
          role="button"
          aria-haspopup="true"
          aria-expanded="false">
          Trash
        </a>
      </li> -->


    </ul>
  </div>
  <ul class="navbar-nav navbar-nav-icons ml-auto flex-row align-items-center">

    <div id="google_language_change"></div>

    <li class="nav-item dropdown dropdown-on-hover">
      <a
        class="nav-link notification-indicator notification-indicator-primary px-0 icon-indicator"
        id="navbarDropdownNotification"
        href="#"
        role="button"
        data-toggle="dropdown"
        aria-haspopup="true"
        aria-expanded="false"><span class="fas fa-bell fs-4" data-fa-transform="shrink-6"></span></a>
      <div
        class="dropdown-menu dropdown-menu-right dropdown-menu-card"
        aria-labelledby="navbarDropdownNotification">
        <div
          class="card card-notification shadow-none"
          style="max-width: 20rem">
          <div class="card-header">
            <div class="row justify-content-between align-items-center">
              <div class="col-auto">
                <h6 class="card-header-title mb-0">Notifications</h6>
              </div>
            </div>
          </div>


          <div class="card-footer text-center border-top">
            <a class="card-link d-block" href="../pages/notifications.html">View all</a>
          </div>
        </div>
      </div>
    </li>
    <li class="nav-item dropdown dropdown-on-hover">
      <a
        class="nav-link pr-0"
        id="navbarDropdownUser"
        href="#"
        role="button"
        data-toggle="dropdown"
        aria-haspopup="true"
        aria-expanded="false">
        <div class="avatar avatar-xl">
          <img class="rounded-circle"
            src="<?= base_url(getenv('dir.upload.profile') . '/' . (session()->get('admin_picture') ?? 'avatar.png')) ?>"
            alt="Foto Admin"
            onerror="this.onerror=null;this.src='<?= base_url('assets/img/team/avatar.png') ?>';" />
        </div>


      </a>
      <div
        class="dropdown-menu dropdown-menu-right py-0"
        aria-labelledby="navbarDropdownUser">
        <div class="bg-white rounded-soft py-2">
          <a class="dropdown-item">Hello, <?= session()->get('admin_username') ?>
            (<?= session()->get('admin_role') ?>)</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="<?= base_url() ?>admin/admin">List Administrator</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="<?= base_url() ?>admin/profile">Change Password</a>
          <a class="dropdown-item" href="<?= base_url() ?>admin/logout">Logout</a>
        </div>
      </div>
    </li>
  </ul>
</nav>

<script>
  document.addEventListener("DOMContentLoaded", function() {
    const themeToggle = document.getElementById("theme-toggle");
    const themeIcon = document.getElementById("theme-icon");

    // Cek apakah user sebelumnya memilih dark mode
    if (localStorage.getItem("theme") === "dark") {
      document.body.classList.add("dark-mode");
      themeIcon.classList.remove("fa-moon");
      themeIcon.classList.add("fa-sun"); // Ubah ikon jadi matahari
    }

    // Toggle dark mode ketika tombol diklik
    themeToggle.addEventListener("click", function() {
      document.body.classList.toggle("dark-mode");

      // Simpan preferensi di localStorage
      if (document.body.classList.contains("dark-mode")) {
        localStorage.setItem("theme", "dark");
        themeIcon.classList.remove("fa-moon");
        themeIcon.classList.add("fa-sun");
      } else {
        localStorage.setItem("theme", "light");
        themeIcon.classList.remove("fa-sun");
        themeIcon.classList.add("fa-moon");
      }
    });
  });
</script>
<script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=loadGoogleTranslate"></script>

<script type="text/javascript">
  function loadGoogleTranslate() {
    new google.translate.TranslateElement({
      pageLanguage: 'en', // Bahasa default halaman Anda (ganti dengan bahasa Anda)
      includedLanguages: 'en,id,es,fr,de,bbc', // Daftar bahasa yang disertakan, sesuaikan dengan kebutuhan
      layout: google.translate.TranslateElement.InlineLayout.SIMPLE, // Layout elemen (default bisa digunakan)
      autoDisplay: false // Agar tidak tampil otomatis saat dimuat
    }, 'google_language_change'); // Menentukan elemen untuk menampilkan Google Translate
  }
</script>