<!DOCTYPE html>
    <html lang="en" class="light-style layout-menu-fixed" dir="ltr" data-theme="theme-default"
    data-assets-path="../assets/" data-template="vertical-menu-template-free">
    
    <head>
        <meta charset="utf-8" />
        <meta name="viewport"
        content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
        <title>Dashboard - AMetative HLE</title>
        <meta name="description" content="" />

        <!-- Favicon -->
        <link rel="icon" type="image/x-icon" href="{{ asset('publicc/backend/assets/img/logo/logo_ametative.png') }}" />

        <!-- Fonts -->
        <link rel="preconnect" href="https://fonts.googleapis.com" />
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
        <link
        href="https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap"
        rel="stylesheet" />

        <!-- Icons -->
        <link rel="stylesheet" href="{{ asset('publicc/backend/assets/vendor/fonts/boxicons.css') }}" />
        <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css" rel="stylesheet">

        <!-- Core CSS -->
        <link rel="stylesheet" href="{{ asset('publicc/backend/assets/vendor/css/core.css') }}"
        class="template-customizer-core-css" />
        <link rel="stylesheet" href="{{ asset('publicc/backend/assets/vendor/css/theme-default.css') }}"
        class="template-customizer-theme-css" />
        <link rel="stylesheet" href="{{ asset('publicc/backend/assets/css/demo.css') }}" />

        <!-- Vendors CSS -->
        <link rel="stylesheet"
        href="{{ asset('publicc/backend/assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.css') }}" />
        <link rel="stylesheet" href="{{ asset('publicc/backend/assets/vendor/libs/apex-charts/apex-charts.css') }}" />

        <!-- Helpers -->
        <script src="{{ asset('publicc/backend/assets/vendor/js/helpers.js') }}"></script>
        <script src="{{ asset('publicc/backend/assets/js/config.js') }}"></script>
    </head>

    <body>
        <!-- Layout wrapper -->
        <div class="layout-wrapper layout-content-navbar">
        <div class="layout-container">
            <!-- Sidebar Menu -->
            <aside id="layout-menu" class="layout-menu menu-vertical menu bg-menu-theme">
            <div class="app-brand demo">
                <a href="dashboard" class="app-brand-link">
                <span class="app-brand-logo demo">
                    <img src="{{ asset('publicc/backend/assets/img/logo/logo_ametative.png') }}" alt="AMetative HLE"
                    style="width: 65px; height: auto;">
                </span>
                <span class="app-brand-text demo menu-text fw-bolder ms-2"
                    style="text-transform: none; font-size: 20px;">AMetative HLE</span>
                </a>
                <a href="javascript:void(0);" class="layout-menu-toggle menu-link text-large ms-auto d-block d-xl-none">
                <i class="bx bx-chevron-left bx-sm align-middle"></i>
                </a>
            </div>

            <!-- Profil -->
            <div class="text-center p-3">
            <div style="width: 100px; height: 100px; background: #D9D9D9; display: flex; justify-content: center; align-items: center; border-radius: 50%; margin: auto;">
            <img src="{{ asset('storage/' . Auth::user()->foto)}}" alt="Profile" class="rounded-circle" style="width: 100px; height: 100px;">
            </div>
            <div class="mt-2" style="color: #666; font-size: 16px; font-weight: 500;">
                {{ Auth::user()->nama_lengkap }}
            </div>
            <div style="color: #666; font-size: 14px;">
                Admin
            </div>
            </div>

          <ul class="menu-inner py-1">
            <!-- Dashboard -->
            <li class="menu-item">
              <a href="/admin" class="menu-link">
                <i class="menu-icon tf-icons bx bx-home-circle"></i>
                <div data-i18n="Analytics">Dashboard</div>
              </a>
            </li>

            <li class="menu-item  active">
              <a href="" class="menu-link">
                <i class="menu-icon tf-icons bx bx-pencil"></i>
                <div data-i18n="Analytics">Kuesioner</div>
              </a>
            </li>

            <li class="menu-item">
              <a href="" class="menu-link">
                <i class="menu-icon tf-icons bx bx-calendar"></i>
                <div data-i18n="Analytics">Periode</div>
              </a>
            </li>

            <li class="menu-item">
              <a href="" class="menu-link">
                <i class="menu-icon tf-icons bx bx-chart"></i>
                <div data-i18n="Analytics">Hasil</div>
              </a>
            </li>

            <li class="menu-item">
              <a href="javascript:void(0)" class="menu-link menu-toggle">
                <i class="menu-icon tf-icons bx bx-book"></i>
                <div data-i18n="Extended UI">Learning Style</div>
              </a>
              <ul class="menu-sub">
                <li class="menu-item">
                  <a href="#" class="menu-link">
                    <div data-i18n="Perfect Scrollbar">Visual</div>
                  </a>
                </li>
                <li class="menu-item">
                  <a href="#" class="menu-link">
                    <div data-i18n="Text Divider">Auditory</div>
                  </a>
                </li>
                <li class="menu-item">
                  <a href="#" class="menu-link">
                    <div data-i18n="Perfect Scrollbar">Read / Write</div>
                  </a>
                </li>
                <li class="menu-item">
                  <a href="#" class="menu-link">
                    <div data-i18n="Perfect Scrollbar">Kinesthetic</div>
                  </a>
                </li>
              </ul>
            </li>

            <li class="menu-item">
              <a href="javascript:void(0)" class="menu-link menu-toggle">
                <i class="menu-icon tf-icons bx bx-copy"></i>
                <div data-i18n="Extended UI">Data Pengguna</div>
              </a>
              <ul class="menu-sub">
                <li class="menu-item">
                  <a href="" class="menu-link">
                    <div data-i18n="Perfect Scrollbar">User</div>
                  </a>
                </li>
                <li class="menu-item">
                  <a href="" class="menu-link">
                    <div data-i18n="Text Divider">Admin</div>
                  </a>
                </li>
              </ul>
            </li>

           
          </ul>
        </aside>
        <!-- / Menu -->

        <!-- Layout container -->
        <div class="layout-page">
          <!-- Navbar -->

          <nav
            class="layout-navbar container-xxl navbar navbar-expand-xl navbar-detached align-items-center bg-navbar-theme"
            id="layout-navbar"
          >
            <div class="layout-menu-toggle navbar-nav align-items-xl-center me-3 me-xl-0 d-xl-none">
              <a class="nav-item nav-link px-0 me-xl-4" href="javascript:void(0)">
                <i class="bx bx-menu bx-sm"></i>
              </a>
            </div>

            <div class="navbar-nav-right d-flex align-items-center" id="navbar-collapse">
              <!-- Search -->
              <div class="navbar-nav align-items-center">
                <div class="nav-item d-flex align-items-center">
                  <i class="bx bx-search fs-4 lh-0"></i>
                  <input
                    type="text"
                    class="form-control border-0 shadow-none"
                    placeholder="Search..."
                    aria-label="Search..."
                  />
                </div>
              </div>
              <!-- /Search -->

              <ul class="navbar-nav flex-row align-items-center ms-auto">
                
                
                <li class="nav-item dropdown lh-1 me-3">
                    <a class="nav-link" href="#" id="notificationDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                        <i class="bx bx-bell" style="font-size: 24px;"></i>
                        <span class="badge bg-danger rounded-pill" id="notificationCount">3</span> <!-- Jumlah notifikasi -->
                    </a>
                </li>

                <!-- User -->
                <li class="nav-item navbar-dropdown dropdown-user dropdown">
                  <a class="nav-link dropdown-toggle hide-arrow" href="javascript:void(0);" data-bs-toggle="dropdown">
                    <div class="avatar avatar-online">
                      <img src="../assets/assetss/img/avatars/1.png" alt class="w-px-40 h-auto rounded-circle" />
                    </div>
                  </a>
                  <ul class="dropdown-menu dropdown-menu-end">
                    <li>
                      <a class="dropdown-item" href="">
                        <div class="d-flex">
                          <div class="flex-shrink-0 me-3">
                            <div class="avatar avatar-online">
                              <img src="../assets/assetss/img/avatars/1.png" alt class="w-px-40 h-auto rounded-circle" />
                            </div>
                          </div>
                          <div class="flex-grow-1">
                            <span class="fw-semibold d-block">Smith</span>
                            <small class="text-muted">Student</small>
                          </div>
                        </div>
                      </a>
                    </li>
                    <li>
                      <div class="dropdown-divider"></div>
                    </li>
                    <li>
                      <a class="dropdown-item" href="">
                        <i class="bx bx-user me-2"></i>
                        <span class="align-middle">My Profile</span>
                      </a>
                    </li>
                    <li>
                      <a class="dropdown-item" href="#">
                        <i class="bx bx-cog me-2"></i>
                        <span class="align-middle">Settings</span>
                      </a>
                    </li>
                    <!-- <li>
                      <a class="dropdown-item" href="#">
                        <span class="d-flex align-items-center align-middle">
                          <i class="flex-shrink-0 bx bx-credit-card me-2"></i>
                          <span class="flex-grow-1 align-middle">Billing</span>
                          <span class="flex-shrink-0 badge badge-center rounded-pill bg-danger w-px-20 h-px-20">4</span>
                        </span>
                      </a>
                    </li> -->
                    <li>
                      <div class="dropdown-divider"></div>
                    </li>
                    <li>
                      <a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#confirmlogout">
                          <i class="bx bx-power-off me-2"></i>
                          <span class="align-middle">Log Out</span>
                      </a>
                  </li>
                  </ul>
                </li>
                <!--/ User -->
              </ul>
            </div>
          </nav>

          <!-- Modal Konfirmasi -->
          <div class="modal fade" id="confirmlogout" tabindex="-1" aria-labelledby="confirmlogoutLabel" aria-hidden="true">
              <div class="modal-dialog">
                  <div class="modal-content">
                      <div class="modal-header">
                          <h5 class="modal-title" id="confirmlogoutLabel">Konfirmasi Logout</h5>
                          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                      </div>
                      <div class="modal-body">
                          Apakah Anda yakin ingin logout?
                      </div>
                      <div class="modal-footer">
                          <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Tidak</button>
                          <a href="" class="btn btn-primary">Ya</a> <!-- Ubah 'auth-login-basic.html' ke route yang sesuai -->
                      </div>
                  </div>
              </div>
          </div>

          <!-- / Navbar -->

            <div class="content-wrapper">
            <div class="container-xxl flex-grow-1 container-p-y">
                <!-- <div class="row">
                <div class="col-lg-12 mx-auto mb-4 order-1">
                    <div class="card">
                    <div class="d-flex align-items-start row">
                        <div class="col-md-7">
                        <div class="card-body">
                            <h5 class="card-title text-primary">Hai, Mahasiswa 🎉</h5>
                            <p class="mb-4">Selamat Datang di Ametative HLE</p>
                        </div>
                        </div>
                        <div class="col-md-3 ms-auto text-end">
                        <div class="card-body pb-0 px-0 px-md-4">
                        <img src="https://raw.githubusercontent.com/Sangga123/asset/refs/heads/main/welcome.jpg" 
                          class="img-fluid" 
                          alt="Welcome Illustration" />

                        </div>
                        </div>
                    </div>
                    </div>
                </div>
                </div> -->

                <main id="main" class="main">
                    <div class="bg-white p-3">
                        {{--! Start Header --}}
                        <div class="row">
                            <div class="col-12 col-md-9 col-lg-10">
                                <h3 class="fw-bold">Materi VARK</h3>
                                <p class="text-secondary">Tambahkan Materi Vark Pada Menu Yang Tersedia</p>
                            </div>
                            <div class="col-12 col-md-3 col-lg-2 text-md-end text-center">
                                <button class="btn btn-primary btn-sm ellipsis" data-bs-toggle="modal" data-bs-target="#exampleModal">
                                    + Tambah Materi
                                </button>
                            </div>
                        </div>
                        {{--! End Header --}}

                        {{--! Start Table --}}
                        <div class="my-3 table-responsive">
                            <table class="table">
                                <thead class="table-light">
                                    <tr>
                                        <th>ID Style</th>
                                        <th>ID Materi</th>
                                        <th>Konten</th>
                                        <th>Audio</th>
                                        <th>Teks</th>
                                        <th>Coding</th>
                                        <th>Output</th>
                                        <th>Aksi</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    @forelse($materi as $item)
                                        <tr>
                                            <td>{{ $item->id_style }}</td>
                                            <td>{{ $item->id_materi }}</td>
                                            <td>
                                                @if($item->konten)
                                                    @if(Str::endsWith($item->konten, ['.jpg', '.jpeg', '.png']))
                                                        <img src="{{ asset('storage/' . $item->konten) }}" alt="Konten" style="max-width: 100px;">
                                                    @elseif(Str::endsWith($item->konten, ['.mp4', '.mov']))
                                                        <video src="{{ asset('storage/' . $item->konten) }}" style="max-width: 150px;" controls></video>
                                                    @else
                                                        <a href="{{ asset('storage/' . $item->konten) }}" target="_blank">Lihat File</a>
                                                    @endif
                                                @else
                                                    -
                                                @endif
                                            </td>
                                            <td>
                                                @if($item->audio)
                                                    <audio controls style="width: 100px;">
                                                        <source src="{{ asset('storage/' . $item->audio) }}" type="audio/mpeg">
                                                        Browser Anda tidak mendukung tag audio.
                                                    </audio>
                                                @else
                                                    -
                                                @endif
                                            </td>
                                            <td>
                                                @if($item->teks)
                                                    <div>
                                                        <span class="short-text d-block" style="max-height: 3.5em; overflow: hidden;">
                                                            {{ Str::limit($item->teks, 100) }}
                                                        </span>
                                                        <a class="text-primary" data-bs-toggle="collapse" href="#collapseTeks{{ $item->id_style }}{{ $item->id_materi }}" role="button" aria-expanded="false" aria-controls="collapseTeks{{ $item->id_style }}{{ $item->id_materi }}">
                                                            Lihat Selengkapnya
                                                        </a>
                                                        <div class="collapse mt-2" id="collapseTeks{{ $item->id_style }}{{ $item->id_materi }}">
                                                            <div class="card card-body">
                                                                {{ $item->teks }}
                                                            </div>
                                                        </div>
                                                    </div>
                                                @else
                                                    -
                                                @endif
                                            </td>
                                            <td>
                                                @if($item->kodesoal)
                                                    <div>
                                                        <span class="short-text d-block" style="max-height: 3.5em; overflow: hidden;">
                                                            {{ Str::limit($item->kodesoal, 100) }}
                                                        </span>
                                                        <a class="text-primary" data-bs-toggle="collapse" href="#collapseKode{{ $item->id_style }}{{ $item->id_materi }}">
                                                            Lihat Selengkapnya
                                                        </a>
                                                        <div class="collapse mt-2" id="collapseKode{{ $item->id_style }}{{ $item->id_materi }}">
                                                            <div class="card card-body">
                                                                <pre class="mb-0">{{ $item->kodesoal }}</pre>
                                                            </div>
                                                        </div>
                                                    </div>
                                                @else
                                                    -
                                                @endif
                                            </td>
                                            <td>{{ $item->outputkode }}</td>
                                            <td>
                                                <button class="btn btn-sm btn-outline-primary"
                                                        data-bs-toggle="modal"
                                                        data-bs-target="#editModal"
                                                        data-id_materi="{{ $item->id_materi }}"
                                                        data-id_style="{{ $item->id_style }}"
                                                        data-konten="{{ $item->konten }}"
                                                        data-audio="{{ $item->audio }}"
                                                        data-teks="{{ $item->teks }}"
                                                        data-kodesoal="{{ $item->kodesoal }}"
                                                        data-outputkode="{{ $item->outputkode }}">
                                                    <i class="bi bi-pencil"></i> Edit
                                                </button>

                                                <button class="btn btn-sm btn-outline-danger mt-1"
                                                        data-bs-toggle="modal"
                                                        data-bs-target="#deleteModal"
                                                        data-id_style="{{ $item->id_style }}"
                                                        data-id_materi="{{ $item->id_materi }}">
                                                    <i class="bi bi-trash"></i> Hapus
                                                </button>
                                            </td>
                                        </tr>
                                    @empty
                                        <tr>
                                            <td colspan="6" class="text-center">Tidak ada data.</td>
                                        </tr>
                                    @endforelse
                                </tbody>
                            </table>
                        </div>
                        {{--! End Table --}}

                        {{--! start modal create --}}
                        <form method="POST" action="{{ route('adminmateri.index') }}" enctype="multipart/form-data" class="needs-validation" novalidate>
                            @csrf
                            <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
                                <div class="modal-dialog modal-dialog-centered">
                                    <div class="modal-content">
                                        <div class="modal-header">
                                            <h5 class="modal-title" id="exampleModalLabel">Tambah Materi</h5>
                                            <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Tutup"></button>
                                        </div>
                                        <div class="modal-body">
                                            <div class="mb-3">
                                                <label for="id_style" class="form-label">Pilih Gaya Belajar</label>
                                                <select class="form-select" name="id_style" id="id_style" required>
                                                    <option value="" selected disabled>-- Pilih Style --</option>
                                                    <option value="1">1. Visual</option>
                                                    <option value="2">2. Auditory</option>
                                                    <option value="3">3. Read/Write</option>
                                                    <option value="4">4. Kinesthetic</option>
                                                </select>
                                                <div class="invalid-feedback">Wajib pilih gaya belajar.</div>
                                            </div>


                                            <div class="mb-3 d-none" id="input-teks">
                                                <label for="teks" class="form-label">Teks Materi</label>
                                                <textarea name="teks" class="form-control" rows="3"></textarea>
                                            </div>

                                            <div class="mb-3">
                                                <label for="konten" class="form-label">Upload Gambar / Video</label>
                                                <input type="file" name="konten" class="form-control" accept="image/*,video/*">
                                            </div>
                                            <div class="mb-3">
                                                <label for="audio" class="form-label">Upload Audio (opsional)</label>
                                                <input type="file" name="audio" class="form-control" accept="audio/*">
                                            </div>
                                            <div class="mb-3">
                                                <label for="teks" class="form-label">Teks Materi</label>
                                                <textarea name="teks" class="form-control" rows="3"></textarea>
                                            </div>
                                            <div class="mb-3">
                                                <label for="kodesoal" class="form-label">Kode Soal</label>
                                                <textarea name="kodesoal" class="form-control" rows="3"></textarea>
                                            </div>
                                            <div class="mb-3">
                                                <label for="outputkode" class="form-label">Output Kode</label>
                                                <textarea name="outputkode" class="form-control" rows="3"></textarea>
                                            </div>
                                        </div>
                                        <div class="modal-footer">
                                            <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Tutup</button>
                                            <button type="submit" class="btn btn-primary">Simpan</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>

                        {{--! end modal create --}}

                        <!-- Edit Modal -->
                        <div class="modal fade" id="editModal" tabindex="-1" aria-hidden="true">
                        <div class="modal-dialog modal-dialog-centered">
                            <form id="form-edit" method="POST" enctype="multipart/form-data" class="needs-validation" novalidate>
                                @csrf
                                @method('PUT')
                                <input type="hidden" id="edit-id_materi" name="id_materi">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <h5 class="modal-title">Edit Materi</h5>
                                        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Tutup"></button>
                                    </div>
                                    <div class="modal-body">
                                        <!-- Gaya Belajar -->
                                        <div class="mb-3">
                                            <label for="id_style" class="form-label">Pilih Gaya Belajar</label>
                                            <select class="form-select" name="id_style" id="id_style" required>
                                                <option value="" selected disabled>-- Pilih Style --</option>
                                                <option value="1">1. Visual</option>
                                                <option value="2">2. Auditory</option>
                                                <option value="3">3. Read/Write</option>
                                                <option value="4">4. Kinesthetic</option>
                                            </select>
                                            <div class="invalid-feedback">Wajib pilih gaya belajar.</div>
                                        </div>

                                        <!-- Teks Materi -->
                                        <div class="mb-3 d-none" id="input-teks">
                                            <label for="teks" class="form-label">Teks Materi</label>
                                            <textarea name="teks" id="edit-teks" class="form-control" rows="3"></textarea>
                                        </div>

                                        <!-- Upload Gambar / Video -->
                                        <div class="mb-3">
                                            <label for="konten" class="form-label">Upload Gambar / Video</label>
                                            <input type="file" name="konten" class="form-control" accept="image/*,video/*">
                                        </div>
                                        <div class="mb-3">
                                            <label for="audio" class="form-label">Upload Audio (opsional)</label>
                                            <input type="file" name="audio" class="form-control" accept="audio/*">
                                        </div>

                                        <!-- Teks Materi -->
                                        <div class="mb-3">
                                            <label for="teks" class="form-label">Teks Materi</label>
                                            <textarea name="teks" id="edit-teks" class="form-control" rows="3"></textarea>
                                        </div>
                                        <div class="mb-3">
                                            <label for="kodesoal" class="form-label">Kode Soal</label>
                                            <textarea name="kodesoal" id="edit-kodesoal" class="form-control" rows="3"></textarea>
                                        </div>
                                        <div class="mb-3">
                                            <label for="outputkode" class="form-label">Output Kode</label>
                                            <textarea name="outputkode" id="edit-outputkode" class="form-control" rows="3"></textarea>
                                        </div>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Tutup</button>
                                        <button type="submit" class="btn btn-primary">Simpan Perubahan</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>


                <!-- Delete Modal -->
                <div class="modal fade" id="deleteModal" tabindex="-1" aria-hidden="true">
                <div class="modal-dialog">
                    <form id="form-delete" method="POST">
                    @csrf
                    @method('DELETE')
                    <input type="hidden" id="delete-id_materi" name="id_materi">
                    <div class="modal-content">
                        <div class="modal-header">
                        <h5 class="modal-title">Hapus Materi</h5>
                        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
                        </div>
                        <div class="modal-body">
                        <p>Yakin ingin menghapus data ini?</p>
                        </div>
                        <div class="modal-footer">
                        <button type="submit" class="btn btn-danger">Hapus</button>
                        </div>
                    </div>
                    </form>
                </div>
                </div>

                @push('scripts')
                <script>
                document.addEventListener('DOMContentLoaded', function () {
                    // Edit
                    var editModal = document.getElementById('editModal')
                    editModal.addEventListener('show.bs.modal', function (e) {
                        var btn = e.relatedTarget
                        var id_materi = btn.getAttribute('data-id_materi')
                        var id_style  = btn.getAttribute('data-id_style')
                        var konten    = btn.getAttribute('data-konten')
                        var teks      = btn.getAttribute('data-teks')
                        var kodesoal  = btn.getAttribute('data-kodesoal') || ''
                        var outputkode = btn.getAttribute('data-outputkode') || ''
                        var form      = document.getElementById('form-edit')

                        form.action = `/admin-materi/${id_style}/${id_materi}`;
                        document.getElementById('edit-id_materi').value = id_materi
                        document.getElementById('edit-teks').value = teks
                        document.getElementById('edit-kodesoal').value = kodesoal
                        document.getElementById('edit-outputkode').value = outputkode
                    });


                    // Delete
                    var deleteModal = document.getElementById('deleteModal')
                    var deleteModal = document.getElementById('deleteModal')
                    deleteModal.addEventListener('show.bs.modal', function (e) {
                        var btn = e.relatedTarget
                        var id_materi = btn.getAttribute('data-id_materi');
                        var id_style  = btn.getAttribute('data-id_style');
                        var form = document.getElementById('form-delete')
                        form.action = `/admin-materi/${id_style}/${id_materi}`;
                        document.getElementById('delete-id_materi').value = id_materi
                    })

                });
                </script>

                <script>
                document.addEventListener('DOMContentLoaded', function () {
                    const fileRadio = document.getElementById('konten-file');
                    const teksRadio = document.getElementById('konten-teks');
                    const inputFile = document.getElementById('input-file');
                    const inputTeks = document.getElementById('input-teks');

                    function toggleInput() {
                        if (fileRadio.checked) {
                            inputFile.classList.remove('d-none');
                            inputTeks.classList.add('d-none');
                        } else {
                            inputTeks.classList.remove('d-none');
                            inputFile.classList.add('d-none');
                        }
                    }

                    fileRadio.addEventListener('change', toggleInput);
                    teksRadio.addEventListener('change', toggleInput);
                });
                </script>





            <div class="content-backdrop fade"></div>
          </div>
          <!-- Content wrapper -->
        </div>
        <!-- / Layout page -->
      </div>

      <!-- Overlay -->
      <div class="layout-overlay layout-menu-toggle"></div>
    </div>
    <!-- / Layout wrapper -->

    <div class="bantuan">
      <a href="https://wa.me/6281515612414"
        target="_blank">
        <img src="https://raw.githubusercontent.com/Sangga123/asset/refs/heads/main/3f11c161-28c5-4cc7-be53-61f6e90d9230.jfif-removebg-preview%203.png" alt="Pusat Bantuan" 
            style="width: 60px; height: auto; position: fixed; bottom: 20px; right: 20px; z-index: 999;">
      </a>
    </div>




    <!-- Core JS -->
    <!-- build:js assets/assetss/vendor/js/core.js -->
    <script src="{{ asset('admin_backend/assets/assetss/vendor/libs/jquery/jquery.js') }}"></script>
    <script src="{{ asset('admin_backend/assets/assetss/vendor/libs/popper/popper.js') }}"></script>
    <script src="{{ asset('admin_backend/assets/assetss/vendor/js/bootstrap.js') }}"></script>
    <script src="{{ asset('admin_backend/assets/assetss/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') }}"></script>

    <script src="{{ asset('admin_backend/assets/assetss/vendor/js/menu.js') }}"></script>
    <!-- endbuild -->

    <!-- Vendors JS -->
    <script src="{{ asset('admin_backend/assets/assetss/vendor/libs/apex-charts/apexcharts.js') }}"></script>

    <!-- Main JS -->
    <script src="{{ asset('admin_backend/assets/assetss/js/main.js') }}"></script>

    <!-- Page JS -->
    <script src="{{ asset('admin_backend/assets/assetss/js/dashboards-analytics.js') }}"></script>

    <!-- Place this tag in your head or just before your close body tag. -->
    <script async defer src="https://buttons.github.io/buttons.js"></script>
  </body>
</html>