<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Panduan Sistem - ASGARD</title>

    <script src="https://cdn.tailwindcss.com"></script>

    <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700;800&display=swap" rel="stylesheet">

    <style>
        body {
            font-family: 'Plus Jakarta Sans', sans-serif;
            background-color: #f8fafc;
        }
    </style>
</head>

<body class="flex flex-col min-h-screen">

    <!-- NAVBAR -->
    <nav class="bg-white border-b border-slate-100 px-6 py-4 mb-10 relative z-50">
        <div class="max-w-7xl mx-auto flex justify-between items-center">

            <!-- Logo ASGARD -->
            <a href="{{ url('/') }}" id="logo-link" class="flex items-center gap-4 group">
                <div class="w-10 h-10 bg-emerald-100 rounded-xl flex items-center justify-center text-emerald-600 font-bold transition-all duration-300 group-hover:bg-emerald-600 group-hover:text-white">
                    AS
                </div>

                <span class="font-black text-xl tracking-tighter text-emerald-950 uppercase italic">
                    ASGARD.
                </span>
            </a>

            <div class="flex items-center gap-4">

                <div class="hidden md:flex items-center gap-4 text-[11px] font-bold uppercase tracking-widest">

                    <!-- Tombol kembali ke landing page: putih, hover hijau -->
                    <a href="{{ url('/') }}" id="landing-menu" class="bg-white text-emerald-700 border border-emerald-600 px-6 py-3 rounded-xl hover:bg-emerald-600 hover:text-white hover:-translate-y-0.5 transition-all duration-300 shadow-md shadow-emerald-900/10">
                        Kembali ke Landing Page
                    </a>

                    <!-- Tombol beranda muncul jika pengguna sudah login -->
                    <a href="#" id="beranda-menu" class="hidden bg-white text-emerald-700 border border-emerald-600 px-6 py-3 rounded-xl hover:bg-emerald-600 hover:text-white hover:-translate-y-0.5 transition-all duration-300 shadow-md shadow-emerald-900/10">
                        Beranda
                    </a>

                    <!-- Menu aktif halaman panduan -->
                    <!-- <a href="{{ route('panduan') }}" class="text-emerald-600 px-2 py-3">
                        Panduan
                    </a> -->
                </div>

                <!-- Tombol masuk sistem: hijau, hover putih -->
                <a href="{{ route('login') }}" id="login-btn" class="bg-emerald-600 text-white border border-emerald-600 text-[11px] font-bold uppercase tracking-widest px-6 py-3 rounded-xl hover:bg-white hover:text-emerald-700 hover:-translate-y-0.5 transition-all duration-300 shadow-lg shadow-emerald-600/30">
                    Masuk Sistem →
                </a>
            </div>
        </div>
    </nav>

    <!-- CONTENT -->
    <div class="max-w-4xl mx-auto px-6 flex-grow mb-20 w-full relative z-10">

        <div class="mb-12 text-center md:text-left">
            <div class="inline-flex items-center gap-2 bg-slate-50 text-emerald-700 px-4 py-2 rounded-full font-bold text-xs uppercase tracking-widest mb-4 border border-slate-200">
                <span>📚</span> Informasi Terbuka
            </div>

            <h1 class="text-4xl md:text-5xl font-black text-slate-900 tracking-tight mb-4">
                Panduan Penggunaan ASGARD
            </h1>

            <p class="text-slate-500 text-lg leading-relaxed">
                ASGARD hadir untuk membantu memetakan karir masa depan siswa SMAN 4 Jember. Pelajari 9 langkah alur kerjanya di bawah ini.
            </p>
        </div>

        <div class="space-y-5">

            <!-- Langkah 1 -->
            <div class="group bg-white border border-slate-200 p-8 rounded-3xl flex flex-col md:flex-row gap-6 transition-all duration-300 hover:border-emerald-300 hover:shadow-xl hover:shadow-emerald-900/5 hover:-translate-y-1 cursor-default">
                <div class="flex-shrink-0">
                    <div class="w-14 h-14 bg-slate-50 border border-slate-100 text-slate-400 rounded-2xl flex items-center justify-center text-2xl font-black transition-all duration-300 group-hover:bg-emerald-600 group-hover:border-emerald-600 group-hover:text-white group-hover:shadow-lg group-hover:shadow-emerald-600/30">
                        1
                    </div>
                </div>

                <div>
                    <h3 class="text-xl font-bold text-slate-800 mb-2 transition-colors duration-300 group-hover:text-emerald-800">
                        Pendataan oleh Guru BK (Admin)
                    </h3>

                    <p class="text-slate-500 leading-relaxed transition-colors duration-300 group-hover:text-slate-600">
                        Siswa tidak perlu melakukan registrasi akun secara mandiri. Data dasar siswa dan pembuatan akun akan dilakukan sepenuhnya oleh Guru BK (Admin) ke dalam sistem untuk menjaga validitas data.
                    </p>
                </div>
            </div>

            <!-- Langkah 2 -->
            <div class="group bg-white border border-slate-200 p-8 rounded-3xl flex flex-col md:flex-row gap-6 transition-all duration-300 hover:border-emerald-300 hover:shadow-xl hover:shadow-emerald-900/5 hover:-translate-y-1 cursor-default">
                <div class="flex-shrink-0">
                    <div class="w-14 h-14 bg-slate-50 border border-slate-100 text-slate-400 rounded-2xl flex items-center justify-center text-2xl font-black transition-all duration-300 group-hover:bg-emerald-600 group-hover:border-emerald-600 group-hover:text-white group-hover:shadow-lg group-hover:shadow-emerald-600/30">
                        2
                    </div>
                </div>

                <div>
                    <h3 class="text-xl font-bold text-slate-800 mb-2 transition-colors duration-300 group-hover:text-emerald-800">
                        Akses & Login Akun Siswa
                    </h3>

                    <p class="text-slate-500 leading-relaxed transition-colors duration-300 group-hover:text-slate-600">
                        Siswa dapat masuk ke sistem melalui menu <strong>Login</strong> menggunakan email/NISN dan kata sandi yang telah diberikan oleh Guru BK.
                    </p>
                </div>
            </div>

            <!-- Langkah 3 -->
            <div class="group bg-white border border-slate-200 p-8 rounded-3xl flex flex-col md:flex-row gap-6 transition-all duration-300 hover:border-emerald-300 hover:shadow-xl hover:shadow-emerald-900/5 hover:-translate-y-1 cursor-default">
                <div class="flex-shrink-0">
                    <div class="w-14 h-14 bg-slate-50 border border-slate-100 text-slate-400 rounded-2xl flex items-center justify-center text-2xl font-black transition-all duration-300 group-hover:bg-emerald-600 group-hover:border-emerald-600 group-hover:text-white group-hover:shadow-lg group-hover:shadow-emerald-600/30">
                        3
                    </div>
                </div>

                <div>
                    <h3 class="text-xl font-bold text-slate-800 mb-2 transition-colors duration-300 group-hover:text-emerald-800">
                        Pengisian Data Ekonomi Keluarga
                    </h3>

                    <p class="text-slate-500 leading-relaxed transition-colors duration-300 group-hover:text-slate-600">
                        Langkah pertama setelah masuk adalah menginput rentang penghasilan orang tua. Sistem membutuhkan data ini untuk memetakan kelompok kemampuan ekonomi agar rekomendasi jurusan sesuai dengan kesiapan finansial.
                    </p>
                </div>
            </div>

            <!-- Langkah 4 -->
            <div class="group bg-white border border-slate-200 p-8 rounded-3xl flex flex-col md:flex-row gap-6 transition-all duration-300 hover:border-emerald-300 hover:shadow-xl hover:shadow-emerald-900/5 hover:-translate-y-1 cursor-default">
                <div class="flex-shrink-0">
                    <div class="w-14 h-14 bg-slate-50 border border-slate-100 text-slate-400 rounded-2xl flex items-center justify-center text-2xl font-black transition-all duration-300 group-hover:bg-emerald-600 group-hover:border-emerald-600 group-hover:text-white group-hover:shadow-lg group-hover:shadow-emerald-600/30">
                        4
                    </div>
                </div>

                <div>
                    <h3 class="text-xl font-bold text-slate-800 mb-2 transition-colors duration-300 group-hover:text-emerald-800">
                        Pengisian Kuesioner Minat & Bakat
                    </h3>

                    <p class="text-slate-500 leading-relaxed transition-colors duration-300 group-hover:text-slate-600">
                        Selanjutnya, siswa mengisi kuesioner minat dan bakat untuk membantu sistem mengetahui kecenderungan bidang yang sesuai dengan ketertarikan siswa.
                    </p>
                </div>
            </div>

            <!-- Langkah 5 -->
            <div class="group bg-white border border-slate-200 p-8 rounded-3xl flex flex-col md:flex-row gap-6 transition-all duration-300 hover:border-emerald-300 hover:shadow-xl hover:shadow-emerald-900/5 hover:-translate-y-1 cursor-default">
                <div class="flex-shrink-0">
                    <div class="w-14 h-14 bg-slate-50 border border-slate-100 text-slate-400 rounded-2xl flex items-center justify-center text-2xl font-black transition-all duration-300 group-hover:bg-emerald-600 group-hover:border-emerald-600 group-hover:text-white group-hover:shadow-lg group-hover:shadow-emerald-600/30">
                        5
                    </div>
                </div>

                <div>
                    <h3 class="text-xl font-bold text-slate-800 mb-2 transition-colors duration-300 group-hover:text-emerald-800">
                        Pengisian Form Nilai Rapor
                    </h3>

                    <p class="text-slate-500 leading-relaxed transition-colors duration-300 group-hover:text-slate-600">
                        Tahap input terakhir adalah mengisi rata-rata nilai dari 15 mata pelajaran selama semester 1 hingga semester 5 dengan akurat sebagai indikator kemampuan akademik siswa.
                    </p>
                </div>
            </div>

            <!-- Langkah 6 -->
            <div class="group bg-white border border-slate-200 p-8 rounded-3xl flex flex-col md:flex-row gap-6 transition-all duration-300 hover:border-emerald-300 hover:shadow-xl hover:shadow-emerald-900/5 hover:-translate-y-1 cursor-default">
                <div class="flex-shrink-0">
                    <div class="w-14 h-14 bg-slate-50 border border-slate-100 text-slate-400 rounded-2xl flex items-center justify-center text-2xl font-black transition-all duration-300 group-hover:bg-emerald-600 group-hover:border-emerald-600 group-hover:text-white group-hover:shadow-lg group-hover:shadow-emerald-600/30">
                        6
                    </div>
                </div>

                <div>
                    <h3 class="text-xl font-bold text-slate-800 mb-2 transition-colors duration-300 group-hover:text-emerald-800 flex items-center gap-2">
                        Pemrosesan Algoritma Random Forest <span class="text-xl group-hover:animate-pulse">🤖</span>
                    </h3>

                    <p class="text-slate-500 leading-relaxed transition-colors duration-300 group-hover:text-slate-600">
                        Sistem mulai menganalisis data ekonomi, minat dan bakat, serta nilai rapor siswa. Data tersebut kemudian diproses menggunakan algoritma Random Forest untuk menghasilkan rekomendasi jurusan.
                    </p>
                </div>
            </div>

            <!-- Langkah 7 -->
            <div class="group bg-white border border-slate-200 p-8 rounded-3xl flex flex-col md:flex-row gap-6 transition-all duration-300 hover:border-emerald-300 hover:shadow-xl hover:shadow-emerald-900/5 hover:-translate-y-1 cursor-default">
                <div class="flex-shrink-0">
                    <div class="w-14 h-14 bg-slate-50 border border-slate-100 text-slate-400 rounded-2xl flex items-center justify-center text-2xl font-black transition-all duration-300 group-hover:bg-emerald-600 group-hover:border-emerald-600 group-hover:text-white group-hover:shadow-lg group-hover:shadow-emerald-600/30">
                        7
                    </div>
                </div>

                <div>
                    <h3 class="text-xl font-bold text-slate-800 mb-2 transition-colors duration-300 group-hover:text-emerald-800">
                        Penerbitan Hasil Rekomendasi
                    </h3>

                    <p class="text-slate-500 leading-relaxed transition-colors duration-300 group-hover:text-slate-600">
                        Sistem akan menampilkan hasil berupa jurusan kuliah yang paling sesuai dengan profil siswa berdasarkan data yang telah diisi sebelumnya.
                    </p>
                </div>
            </div>

            <!-- Langkah 8 -->
            <div class="group bg-white border border-slate-200 p-8 rounded-3xl flex flex-col md:flex-row gap-6 transition-all duration-300 hover:border-emerald-300 hover:shadow-xl hover:shadow-emerald-900/5 hover:-translate-y-1 cursor-default">
                <div class="flex-shrink-0">
                    <div class="w-14 h-14 bg-slate-50 border border-slate-100 text-slate-400 rounded-2xl flex items-center justify-center text-2xl font-black transition-all duration-300 group-hover:bg-emerald-600 group-hover:border-emerald-600 group-hover:text-white group-hover:shadow-lg group-hover:shadow-emerald-600/30">
                        8
                    </div>
                </div>

                <div>
                    <h3 class="text-xl font-bold text-slate-800 mb-2 transition-colors duration-300 group-hover:text-emerald-800">
                        Eksplorasi Prospek Karir
                    </h3>

                    <p class="text-slate-500 leading-relaxed transition-colors duration-300 group-hover:text-slate-600">
                        Siswa tidak hanya mendapatkan nama jurusan, tetapi juga dapat melihat informasi mengenai peluang kerja dan prospek karir dari jurusan yang direkomendasikan.
                    </p>
                </div>
            </div>

            <!-- Langkah 9 -->
            <div class="group bg-white border border-slate-200 p-8 rounded-3xl flex flex-col md:flex-row gap-6 transition-all duration-300 hover:border-emerald-300 hover:shadow-xl hover:shadow-emerald-900/5 hover:-translate-y-1 cursor-default">
                <div class="flex-shrink-0">
                    <div class="w-14 h-14 bg-slate-50 border border-slate-100 text-slate-400 rounded-2xl flex items-center justify-center text-2xl font-black transition-all duration-300 group-hover:bg-emerald-600 group-hover:border-emerald-600 group-hover:text-white group-hover:shadow-lg group-hover:shadow-emerald-600/30">
                        9
                    </div>
                </div>

                <div>
                    <h3 class="text-xl font-bold text-slate-800 mb-2 transition-colors duration-300 group-hover:text-emerald-800">
                        Konseling & Tindak Lanjut
                    </h3>

                    <p class="text-slate-500 leading-relaxed transition-colors duration-300 group-hover:text-slate-600">
                        Hasil rekomendasi dapat digunakan sebagai bahan pertimbangan awal. Siswa tetap disarankan melakukan konsultasi dengan Guru BK untuk memantapkan pilihan jurusan kuliah.
                    </p>
                </div>
            </div>

        </div>
    </div>

    <!-- FOOTER -->
    <footer class="bg-[#062C22] text-white py-16 px-6 mt-auto w-full relative z-10">
        <div class="max-w-7xl mx-auto grid grid-cols-1 md:grid-cols-3 gap-12">

            <div class="space-y-6">
                <div class="flex items-center gap-4">
                    <span class="font-black text-2xl tracking-tighter uppercase italic">
                        ASGARD.
                    </span>
                </div>

                <p class="text-slate-300 text-sm leading-relaxed max-w-xs">
                    Sistem rekomendasi jurusan kuliah SMAN 4 Jember berbasis data.
                </p>
            </div>

            <div>
                <h5 class="font-bold text-xs uppercase tracking-widest text-emerald-400 mb-6">
                    Informasi
                </h5>

                <ul class="space-y-4 text-sm text-slate-300">
                    <li>
                        <a href="{{ route('panduan') }}" class="text-emerald-400 font-bold hover:text-white transition-colors">
                            Panduan Sistem
                        </a>
                    </li>

                    <!-- <li>
                        <a href="#" class="hover:text-white transition-colors">
                            Kebijakan Privasi
                        </a>
                    </li> -->
                </ul>
            </div>

            <div>
                <h5 class="font-bold text-xs uppercase tracking-widest text-emerald-400 mb-6">
                    Sekolah
                </h5>

                <ul class="space-y-4 text-sm text-slate-300">
                    <li>SMAN 4 Jember</li>
                    <li>Jl. Wolter Monginsidi No.24</li>
                    <li>Jember, Jawa Timur</li>
                </ul>
            </div>

        </div>

        <div class="max-w-7xl mx-auto mt-16 pt-8 border-t border-white/10 text-center">
            <p class="text-[10px] font-medium uppercase tracking-[0.5em] text-slate-400">
                © 2026 GALANG SEFIAN ADJI - POLITEKNIK NEGERI JEMBER
            </p>
        </div>
    </footer>

    <!-- SCRIPT NAVBAR LOGIN CHECK -->
    <script>
        document.addEventListener('DOMContentLoaded', function () {
            const token = localStorage.getItem('access_token');

            const role =
                localStorage.getItem('role') ||
                localStorage.getItem('user_role') ||
                getRoleFromUserObject();

            const logoLink = document.getElementById('logo-link');
            const landingMenu = document.getElementById('landing-menu');
            const berandaMenu = document.getElementById('beranda-menu');
            const loginBtn = document.getElementById('login-btn');

            const landingUrl = "{{ url('/') }}";
            const loginUrl = "{{ route('login') }}";

            // URL dashboard siswa
            const siswaDashboardUrl = "{{ route('student.profile') }}";

            // URL dashboard admin
            // Jika dashboard admin kamu berbeda, cukup ubah bagian ini saja.
            const adminDashboardUrl = "{{ url('/admin/dashboard') }}";

            let dashboardUrl = siswaDashboardUrl;

            if (role && role.toLowerCase() === 'admin') {
                dashboardUrl = adminDashboardUrl;
            }

            if (token) {
                // Jika sudah login:
                // tombol kembali ke landing page disembunyikan
                if (landingMenu) {
                    landingMenu.classList.add('hidden');
                }

                // menu beranda muncul dan menuju dashboard sesuai role
                if (berandaMenu) {
                    berandaMenu.classList.remove('hidden');
                    berandaMenu.href = dashboardUrl;
                }

                // logo menuju dashboard
                if (logoLink) {
                    logoLink.href = dashboardUrl;
                }

                // tombol masuk sistem berubah menjadi ke dashboard
                if (loginBtn) {
                    loginBtn.innerText = "Ke Dashboard →";
                    loginBtn.href = dashboardUrl;

                    loginBtn.className = "bg-emerald-600 text-white border border-emerald-600 text-[11px] font-bold uppercase tracking-widest px-6 py-3 rounded-xl hover:bg-white hover:text-emerald-700 hover:-translate-y-0.5 transition-all duration-300 shadow-lg shadow-emerald-600/30";
                }
            } else {
                // Jika belum login:
                // tombol kembali ke landing page ditampilkan
                if (landingMenu) {
                    landingMenu.classList.remove('hidden');
                    landingMenu.href = landingUrl;
                }

                // menu beranda disembunyikan
                if (berandaMenu) {
                    berandaMenu.classList.add('hidden');
                    berandaMenu.removeAttribute('href');
                }

                // logo menuju landing page
                if (logoLink) {
                    logoLink.href = landingUrl;
                }

                // tombol masuk sistem menuju login
                if (loginBtn) {
                    loginBtn.innerText = "Masuk Sistem →";
                    loginBtn.href = loginUrl;

                    loginBtn.className = "bg-emerald-600 text-white border border-emerald-600 text-[11px] font-bold uppercase tracking-widest px-6 py-3 rounded-xl hover:bg-white hover:text-emerald-700 hover:-translate-y-0.5 transition-all duration-300 shadow-lg shadow-emerald-600/30";
                }
            }

            function getRoleFromUserObject() {
                try {
                    const userData = localStorage.getItem('user');

                    if (!userData) {
                        return null;
                    }

                    const user = JSON.parse(userData);

                    return user.role || null;
                } catch (error) {
                    return null;
                }
            }
        });
    </script>

</body>
</html>