@extends('layouts.appNew')
@section('title',@$title)
@section('content')
   <section id="beranda" class="relative h-[95vh] flex items-center overflow-hidden pt-20">
        <img src="{{ asset('img2.png') }}" alt="Green School Jakarta" class="absolute inset-0 w-full h-full object-cover" style="">
        <div class="absolute inset-0 hero-overlay"></div>
        <div class="relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 z-10">
            <div class="max-w-3xl animate-fade-up">
                {{-- <div class="inline-flex items-center gap-2 bg-emerald-500/20 backdrop-blur-md border border-emerald-400/30 px-4 py-2 rounded-full mb-6">
                    <span class="w-2 h-2 rounded-full bg-emerald-400 animate-pulse"></span>
                    <span class="text-xs font-bold text-emerald-100 uppercase tracking-widest">Program Adiwiyata 2025</span>
                </div> --}}
                <h1 class="text-5xl md:text-7xl font-extrabold text-white leading-tight mb-6">
                    Mewujudkan Sekolah <span class="text-emerald-400">Hijau &amp; Berkelanjutan</span> di Jakarta
                </h1>
                <p class="text-lg text-emerald-50/80 mb-10 leading-relaxed">
                    Mendorong transformasi budaya peduli lingkungan di satuan pendidikan DKI Jakarta melalui Gerakan Peduli dan Berbudaya Lingkungan Hidup di Sekolah (PBLHS).
                </p>
            </div>
        </div>
        
        <!-- Statistics Quick View -->
        <div class="absolute bottom-0 left-0 right-0 bg-white/5 backdrop-blur-xl border-t border-white/10 hidden lg:block">
            <div class="max-w-7xl mx-auto px-8 py-8 grid grid-cols-5 gap-8">
                <div class="text-white border-r border-white/10">
                    <p class="text-3xl font-bold">481</p>
                    <p class="text-xs font-medium text-emerald-300 uppercase">Sekolah Adiwiyata</p>
                </div>
                <div class="text-white border-r border-white/10">
                    <p class="text-3xl font-bold">37</p>
                    <p class="text-xs font-medium text-emerald-300 uppercase">Adiwiyata Mandiri</p>
                </div>
                <div class="text-white border-r border-white/10">
                    <p class="text-3xl font-bold">89</p>
                    <p class="text-xs font-medium text-emerald-300 uppercase">Adiwiyata Nasional</p>
                </div>
                <div class="text-white border-r border-white/10">
                    <p class="text-3xl font-bold">107</p>
                    <p class="text-xs font-medium text-emerald-300 uppercase">Adiwiyata Provinsi</p>
                </div>
                <div class="text-white">
                    <p class="text-3xl font-bold">248</p>
                    <p class="text-xs font-medium text-emerald-300 uppercase">Adiwiyata Kota</p>
                </div>
            </div>
        </div>
    </section>
    <section class="py-24 bg-white">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="text-center mb-16">
                <h2 class="text-sm font-bold text-emerald-600 uppercase tracking-[0.2em] mb-4">Gerakan PBLHS</h2>
                <h3 class="text-4xl font-extrabold text-slate-900 mb-6">5 Aspek Teknis Kualitas Lingkungan Hidup</h3>
                <p class="text-slate-500 max-w-2xl mx-auto">berdasarkan Permen LH/BPLH Nomor 5 Tahun 2025 tentang Penyelenggaraan Program Adiwiyata.</p>
            </div>

            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
                <!-- Waste Management -->
                <div class="p-8 rounded-3xl bg-emerald-50 border border-emerald-100 group hover:bg-emerald-600 hover:text-white transition-all duration-300">
                    <div class="w-14 h-14 rounded-2xl bg-white flex items-center justify-center text-emerald-600 mb-6 shadow-sm group-hover:bg-emerald-500 group-hover:text-white">
                        <span class="material-symbols-outlined text-3xl">recycling</span>
                    </div>
                    <h4 class="text-xl font-bold mb-3">Pengelolaan Sampah</h4>
                    <p class="text-sm text-slate-600 group-hover:text-emerald-50">Pengelolaan sampah dengan prinsip 3R (Reduce, Reuse, Recycle) dan pengurangan penggunaan plastik sekali pakai.</p>
                </div>
                <!-- Energy -->
                <div class="p-8 rounded-3xl bg-blue-50 border border-blue-100 group hover:bg-blue-600 hover:text-white transition-all duration-300">
                    <div class="w-14 h-14 rounded-2xl bg-white flex items-center justify-center text-blue-600 mb-6 shadow-sm group-hover:bg-blue-500 group-hover:text-white">
                        <span class="material-symbols-outlined text-3xl">bolt</span>
                    </div>
                    <h4 class="text-xl font-bold mb-3">Penghematan dan Konservasi Energi</h4>
                    <p class="text-sm text-slate-600 group-hover:text-blue-50">Efisiensi penggunaan listrik melalui kampanye 'Hemat Energi' dan pemanfaatan sumber energi terbarukan di sekolah.</p>
                </div>
                <!-- Water -->
                <div class="p-8 rounded-3xl bg-sky-50 border border-sky-100 group hover:bg-sky-600 hover:text-white transition-all duration-300">
                    <div class="w-14 h-14 rounded-2xl bg-white flex items-center justify-center text-sky-600 mb-6 shadow-sm group-hover:bg-sky-500 group-hover:text-white">
                        <span class="material-symbols-outlined text-3xl">water_drop</span>
                    </div>
                    <h4 class="text-xl font-bold mb-3">Penghematan dan Konservasi Air</h4>
                    <p class="text-sm text-slate-600 group-hover:text-sky-50">Penghematan air bersih, pemanenan air hujan, dan penggunaan kembali air limbah domestik untuk menyiram tanaman.</p>
                </div>
                <!-- Greening -->
                <div class="p-8 rounded-3xl bg-lime-50 border border-lime-100 group hover:bg-lime-600 hover:text-white transition-all duration-300">
                    <div class="w-14 h-14 rounded-2xl bg-white flex items-center justify-center text-lime-600 mb-6 shadow-sm group-hover:bg-lime-500 group-hover:text-white">
                        <span class="material-symbols-outlined text-3xl">park</span>
                    </div>
                    <h4 class="text-xl font-bold mb-3">Keanekaragaman Hayati</h4>
                    <p class="text-sm text-slate-600 group-hover:text-lime-50">Penanaman dan pemeliharaan pohon/tanaman di lingkungan sekolah untuk meningkatkan kualitas udara dan estetika.</p>
                </div>
                <!-- Canteen -->
                {{-- <div class="p-8 rounded-3xl bg-orange-50 border border-orange-100 group hover:bg-orange-600 hover:text-white transition-all duration-300">
                    <div class="w-14 h-14 rounded-2xl bg-white flex items-center justify-center text-orange-600 mb-6 shadow-sm group-hover:bg-orange-500 group-hover:text-white">
                        <span class="material-symbols-outlined text-3xl">restaurant</span>
                    </div>
                    <h4 class="text-xl font-bold mb-3">Kantin Sehat</h4>
                    <p class="text-sm text-slate-600 group-hover:text-orange-50">Penyediaan makanan sehat tanpa 5P (Pengawet, Pemanis, Pewarna, Perasa sintetik, dan Pengenyal) di kantin sekolah.</p>
                </div> --}}
                <!-- Drainage -->
                <div class="p-8 rounded-3xl bg-indigo-50 border border-indigo-100 group hover:bg-indigo-600 hover:text-white transition-all duration-300">
                    <div class="w-14 h-14 rounded-2xl bg-white flex items-center justify-center text-indigo-600 mb-6 shadow-sm group-hover:bg-indigo-500 group-hover:text-white">
                        <span class="material-symbols-outlined text-3xl">filter_list</span>
                    </div>
                    <h4 class="text-xl font-bold mb-3">Kebersihan dan Sanitasi</h4>
                    <p class="text-sm text-slate-600 group-hover:text-indigo-50">Pemeliharaan saluran drainase, biopori, dan sumur resapan untuk mencegah banjir dan menjaga sanitasi sekolah.</p>
                </div>
            </div>
        </div>
    </section>
    <section id="tahapan" class="py-24 bg-slate-900 text-white overflow-hidden">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex flex-col md:flex-row justify-between items-end mb-20 gap-8">
                <div class="max-w-xl">
                    <h2 class="text-emerald-400 font-bold tracking-widest mb-4">ROADMAP PRESTASI</h2>
                    <h3 class="text-4xl md:text-5xl font-extrabold leading-tight">Jenjang Penghargaan <br> Sekolah Adiwiyata</h3>
                </div>
                <div class="flex gap-2">
                    <button class="w-12 h-12 rounded-full border border-white/20 flex items-center justify-center hover:bg-white hover:text-slate-900 transition"><span class="material-symbols-outlined">chevron_left</span></button>
                    <button class="w-12 h-12 rounded-full border border-white/20 flex items-center justify-center hover:bg-white hover:text-slate-900 transition"><span class="material-symbols-outlined">chevron_right</span></button>
                </div>
            </div>

            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 relative">
                <!-- Connector Line (Visual only) -->
                <div class="hidden lg:block absolute top-1/2 left-0 right-0 h-[2px] bg-white/10 -translate-y-1/2"></div>
                
                <!-- Stage 1 -->
                <div class="relative z-10 p-8 rounded-3xl bg-white/5 border border-white/10 step-card" style="opacity: 0;">
                    <div class="text-6xl font-black text-white/5 absolute top-4 right-8">01</div>
                    <span class="px-3 py-1 rounded-full bg-emerald-500 text-[10px] font-bold uppercase mb-6 inline-block">Kabupaten/Kota</span>
                    <h4 class="text-2xl font-bold mb-4">Adiwiyata Kota</h4>
                    <p class="text-sm text-slate-400 leading-relaxed mb-6">Penghargaan di tingkat wilayah administratif (Jakarta Pusat, Barat, Timur, Selatan, Utara, dan Kepulauan Seribu) yang diberikan oleh bupati/walikota.</p>
                    {{-- <div class="pt-6 border-t border-white/10 text-xs font-semibold text-emerald-400">Target Skor: ≥ 70%</div> --}}
                </div>

                <!-- Stage 2 -->
                <div class="relative z-10 p-8 rounded-3xl bg-white/10 border border-emerald-500/30 step-card" style="opacity: 0;">
                    <div class="text-6xl font-black text-white/5 absolute top-4 right-8">02</div>
                    <span class="px-3 py-1 rounded-full bg-blue-500 text-[10px] font-bold uppercase mb-6 inline-block">Provinsi</span>
                    <h4 class="text-2xl font-bold mb-4">Adiwiyata Provinsi</h4>
                    <p class="text-sm text-slate-400 leading-relaxed mb-6">Penghargaan di tingkat provinsi yang diberikan oleh Gubernur DKI Jakarta.</p>
                    {{-- <div class="pt-6 border-t border-white/10 text-xs font-semibold text-blue-400">Target Skor: ≥ 80%</div> --}}
                </div>

                <!-- Stage 3 -->
                <div class="relative z-10 p-8 rounded-3xl bg-white/5 border border-white/10 step-card" style="opacity: 0;">
                    <div class="text-6xl font-black text-white/5 absolute top-4 right-8">03</div>
                    <span class="px-3 py-1 rounded-full bg-orange-500 text-[10px] font-bold uppercase mb-6 inline-block">Nasional</span>
                    <h4 class="text-2xl font-bold mb-4">Adiwiyata Nasional</h4>
                    <p class="text-sm text-slate-400 leading-relaxed mb-6">Penghargaan di tingkat nasional yang diberikan oleh Menteri Lingkungan Hidup.</p>
                    {{-- <div class="pt-6 border-t border-white/10 text-xs font-semibold text-orange-400">Target Skor: ≥ 90%</div> --}}
                </div>

                <!-- Stage 4 -->
                <div class="relative z-10 p-8 rounded-3xl bg-emerald-600 step-card shadow-2xl shadow-emerald-500/20" style="opacity: 0;">
                    <div class="text-6xl font-black text-white/10 absolute top-4 right-8">04</div>
                    <span class="px-3 py-1 rounded-full bg-yellow-400 text-emerald-900 text-[10px] font-bold uppercase mb-6 inline-block">Mandiri</span>
                    <h4 class="text-2xl font-bold mb-4">Adiwiyata Mandiri</h4>
                    <p class="text-sm text-emerald-100 leading-relaxed mb-6">Penghargaan tertinggi dari Kementerian Lingkungan Hidup bagi sekolah yang berhasil membina minimal 2 sekolah</p>
                    {{-- <div class="pt-6 border-t border-white/20 text-xs font-semibold text-yellow-300">Target: Membina 2-10 Sekolah</div> --}}
                </div>
            </div>
        </div>
    </section>
    <section class="py-20 bg-slate-50">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="grid lg:grid-cols-3 gap-12 items-center">
                <div class="lg:col-span-1">
                    <h3 class="text-3xl font-extrabold text-slate-900 mb-6">Sebaran Sekolah Adiwiyata</h3>
                    <p class="text-slate-600 mb-8">Peta interaktif distribusi sekolah peraih penghargaan Adiwiyata di 5 Wilayah Kota Administrasi dan 1 Kabupaten Administrasi DKI Jakarta.</p>
                    <div class="space-y-4">
                        <div class="flex justify-between items-center p-4 bg-white rounded-2xl shadow-sm">
                            <span class="text-sm font-semibold text-slate-700">Jakarta Timur</span>
                            <span class="bg-emerald-100 text-emerald-700 px-3 py-1 rounded-full text-xs font-bold">118 Sekolah</span>
                        </div>
                        <div class="flex justify-between items-center p-4 bg-white rounded-2xl shadow-sm">
                            <span class="text-sm font-semibold text-slate-700">Jakarta Selatan</span>
                            <span class="bg-emerald-100 text-emerald-700 px-3 py-1 rounded-full text-xs font-bold">87 Sekolah</span>
                        </div>
                        <div class="flex justify-between items-center p-4 bg-white rounded-2xl shadow-sm">
                            <span class="text-sm font-semibold text-slate-700">Jakarta Pusat</span>
                            <span class="bg-emerald-100 text-emerald-700 px-3 py-1 rounded-full text-xs font-bold">122 Sekolah</span>
                        </div>
                        <div class="flex justify-between items-center p-4 bg-white rounded-2xl shadow-sm">
                            <span class="text-sm font-semibold text-slate-700">Jakarta Barat</span>
                            <span class="bg-emerald-100 text-emerald-700 px-3 py-1 rounded-full text-xs font-bold">100 Sekolah</span>
                        </div>
                        <div class="flex justify-between items-center p-4 bg-white rounded-2xl shadow-sm">
                            <span class="text-sm font-semibold text-slate-700">Jakarta Utara</span>
                            <span class="bg-emerald-100 text-emerald-700 px-3 py-1 rounded-full text-xs font-bold">51 Sekolah</span>
                        </div>
                        <div class="flex justify-between items-center p-4 bg-white rounded-2xl shadow-sm">
                            <span class="text-sm font-semibold text-slate-700">Kepulauan Seribu</span>
                            <span class="bg-emerald-100 text-emerald-700 px-3 py-1 rounded-full text-xs font-bold">3 Sekolah</span>
                        </div>
                    </div>
                </div>
                <div class="lg:col-span-2">
                    <div class="relative">
                        <div class="absolute -inset-4 bg-emerald-200/50 rounded-[40px] blur-2xl"></div>
                        <div class="relative bg-white p-4 rounded-[32px] shadow-2xl overflow-hidden">
                            <img src="{{asset('img1.png')}}" alt="Visual Achievement" class="w-full rounded-2xl" style="">
                            <div class="absolute bottom-10 left-10 p-6 glass rounded-2xl max-w-xs border-emerald-100">
                                <div class="flex items-center gap-2 mb-2">
                                    <span class="material-symbols-outlined text-emerald-600">verified</span>
                                    <span class="text-xs font-bold text-emerald-800">PRESTASI TERBARU</span>
                                </div>
                                <p class="text-sm font-semibold text-slate-700">MAN 4 Jakarta Raih Penghargaan Sekolah Adiwiyata Tingkat Provinsi DKI Jakarta 2025.</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <section id="berita" class="py-24 bg-white">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between items-end mb-12">
                <div>
                    <h2 class="text-sm font-bold text-emerald-600 uppercase tracking-widest mb-4">KEGIATAN ADIWIYATA</h2>
                    <h3 class="text-4xl font-extrabold text-slate-900">Kabar Terbaru &amp; Inspirasi</h3>
                </div>
                <a href="{{ url('kegiatan') }}" class="text-emerald-600 font-bold hover:underline flex items-center gap-1">Lihat Semua <span class="material-symbols-outlined">arrow_right_alt</span></a>
            </div>

            <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
                @foreach($side_kegiatan as $dataKeg)
                <?php
				$images = json_decode($dataKeg->image);
				?>
                <div class="group cursor-pointer">
                    <div class="relative h-64 rounded-3xl overflow-hidden mb-6">
                        <img src="{{ asset(@$images[0]) }}" alt="" class="w-full h-full object-cover group-hover:scale-110 transition duration-500" style="">
                        <div class="absolute top-4 left-4 px-3 py-1 bg-white/90 backdrop-blur rounded-full text-[10px] font-bold text-emerald-800">SEKOLAH ADIWIYATA</div>
                    </div>
                    <p class="text-xs font-bold text-slate-400 mb-2 uppercase tracking-widest">{{ date('D',strtotime($dataKeg->created_at)) }}, {{ date('d M Y',strtotime($dataKeg->created_at)) }}</p>
                    <h4 class="text-xl font-bold text-slate-900 group-hover:text-emerald-600 transition mb-3"><a href="{{ url('kegiatan/'.$dataKeg->slug) }}">{{ $dataKeg->judul }}</a></h4>
                    <p class="text-sm text-slate-500 line-clamp-2">{!! substr(strip_tags(@$dataKeg->body),0,1000) !!}</p>
                </div>
                @endforeach
            </div>
        </div>
    </section>
    <section class="py-20 bg-emerald-600">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="bg-white/10 backdrop-blur-md rounded-[40px] p-8 md:p-16 flex flex-col md:flex-row items-center justify-between border border-white/20 gap-12">
                <div class="max-w-xl text-center md:text-left">
                    <h3 class="text-3xl md:text-4xl font-extrabold text-white mb-6 leading-tight">Helpdesk</h3>
                    <p class="text-emerald-100 text-lg mb-8">Butuh bantuan teknis atau konsultasi mengenai pengisian SIDIA? Tim helpdesk kami siap membantu Anda.</p>
                    
                </div>
                <div class="bg-white p-10 rounded-3xl shadow-2xl w-full max-w-sm">
                    <div class="flex flex-col gap-6">
                        <div class="flex items-center gap-4">
                            <div class="w-12 h-12 rounded-full bg-black/20 flex items-center justify-center text-white">
                                <span class="material-symbols-outlined">call</span>
                            </div>
                            <div>
                                <p class="text-[10px] font-bold text-emerald-600 uppercase tracking-widest">Phone</p>
                                <p class="text-lg font-bold"> 
                                    <a target="_blank" href="https://api.whatsapp.com/send/?phone=6285212436339">
                                    0852-1243-6339
                                    </a>
                                </p>
                            </div>
                        </div>
                        <div class="flex items-center gap-4">
                            <div class="w-12 h-12 rounded-full bg-black/20 flex items-center justify-center text-white">
                                <span class="material-symbols-outlined">mail</span>
                            </div>
                            <div>
                                <p class="text-[10px] font-bold text-emerald-600 uppercase tracking-widest">Email Resmi</p>
                                <a target="_blank" href="mailto:dinaslh@jakarta.go.id" class="">
                                    <p class="text-lg font-bold">dinaslh@jakarta.go.id</p>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
@endsection
@section('js')
<script>

        const schoolsData = [
            { name: "SMAN 62 JAKARTA", city: "Jakarta Timur", year: 2025, level: "Nasional", score: 89.9 },
            { name: "SMAN 9 JAKARTA", city: "Jakarta Timur", year: 2025, level: "Provinsi", score: 84.5 },
            { name: "SDS Merpati", city: "Jakarta Pusat", year: 2026, level: "Kota", score: 78.2 },
            { name: "MAN 4 JAKARTA", city: "Jakarta Selatan", year: 2025, level: "Nasional", score: 91.2 },
            { name: "SDN Rambutan 03 Pagi", city: "Jakarta Timur", year: 2024, level: "Mandiri", score: 95.0 },
            { name: "SMPN 23 JAKARTA", city: "Jakarta Utara", year: 2023, level: "Provinsi", score: 82.1 },
            { name: "SMAN 42 JAKARTA", city: "Jakarta Timur", year: 2025, level: "Nasional", score: 88.4 },
            { name: "SDN 01 Grogol", city: "Jakarta Barat", year: 2025, level: "Kota", score: 75.6 },
            { name: "SMAN 1 JAKARTA", city: "Jakarta Pusat", year: 2024, level: "Provinsi", score: 83.9 }
        ];

        function getLevelColor(level) {
            switch(level) {
                case 'Mandiri': return 'bg-indigo-100 text-indigo-700';
                case 'Nasional': return 'bg-amber-100 text-amber-700';
                case 'Provinsi': return 'bg-blue-100 text-blue-700';
                default: return 'bg-emerald-100 text-emerald-700';
            }
        }

        function renderSchools(filter = { name: '', city: 'All', level: 'All' }) {
            const grid = document.getElementById('schoolGrid');
            grid.innerHTML = '';

            const filtered = schoolsData.filter(s => {
                const nameMatch = s.name.toLowerCase().includes(filter.name.toLowerCase());
                const cityMatch = filter.city === 'All' || s.city === filter.city;
                const levelMatch = filter.level === 'All' || s.level === filter.level;
                return nameMatch && cityMatch && levelMatch;
            });

            if (filtered.length === 0) {
                grid.innerHTML = `<div class="col-span-full py-20 text-center text-slate-400">Tidak ada sekolah yang ditemukan.</div>`;
                return;
            }

            filtered.forEach(s => {
                const card = document.createElement('div');
                card.className = 'school-card bg-white p-6 rounded-3xl border border-slate-100 shadow-sm hover:shadow-xl';
                card.innerHTML = `
                    <div class="flex justify-between items-start mb-4">
                        <span class="inline-block px-3 py-1 rounded-full text-[10px] font-black uppercase tracking-widest ${getLevelColor(s.level)}">
                            ${s.level}
                        </span>
                        <span class="text-slate-300 material-symbols-outlined">more_vert</span>
                    </div>
                    <h4 class="font-bold text-lg text-slate-800 mb-1">${s.name}</h4>
                    <p class="text-sm text-slate-500 flex items-center gap-1 mb-4">
                        <span class="material-symbols-outlined text-sm">location_on</span> ${s.city}
                    </p>
                    <div class="pt-4 border-t border-slate-50">
                        <div class="flex justify-between text-xs font-bold mb-2">
                            <span class="text-slate-400">Skor Terakhir</span>
                            <span class="text-emerald-600">${s.score}%</span>
                        </div>
                        <div class="w-full bg-slate-100 h-2 rounded-full overflow-hidden">
                            <div class="bg-emerald-500 h-full adiwiyata-level-bar" style="width: ${s.score}%"></div>
                        </div>
                        <div class="mt-4 flex justify-between items-center">
                            <span class="text-[10px] text-slate-400 font-medium">Update: Des 2025</span>
                            <button class="text-xs font-bold text-emerald-600 hover:underline">Lihat Detail</button>
                        </div>
                    </div>
                `;
                grid.appendChild(card);
            });
        }

        async function initMap() {
            const { Map, InfoWindow } = await google.maps.importLibrary("maps");
            const { AdvancedMarkerElement, PinElement } = await google.maps.importLibrary("marker");

            const map = new Map(document.getElementById("map"), {
                center: { lat: -6.2146, lng: 106.8451 }, // Jakarta Center
                zoom: 11,
                mapId: 'DEMO_MAP_ID',
                gestureHandling: 'greedy',
                clickableIcons: false,
                disableDefaultUI: true
            });

            // Sample Markers for distribution
            const locations = [
                { name: "SMAN 62 Jakarta", pos: { lat: -6.3243, lng: 106.8654 }, level: "Nasional" },
                { name: "MAN 4 Jakarta", pos: { lat: -6.2862, lng: 106.7725 }, level: "Nasional" },
                { name: "SDS Merpati", pos: { lat: -6.1823, lng: 106.8322 }, level: "Kota" },
                { name: "SDN Rambutan 03", pos: { lat: -6.3012, lng: 106.8821 }, level: "Mandiri" }
            ];

            locations.forEach(loc => {
                const glyph = document.createElement("span");
                glyph.className = "material-symbols-outlined";
                glyph.textContent = 'school';
                glyph.style.color = 'white';

                const pin = new PinElement({
                    glyph: glyph,
                    scale: 1.5,
                    background: loc.level === 'Mandiri' ? "#4f46e5" : "#10b981",
                    borderColor: "#ffffff",
                });

                const marker = new AdvancedMarkerElement({
                    map,
                    position: loc.pos,
                    content: pin.element
                });

                const header = document.createElement('span');
                header.className = 'font-bold text-slate-800 p-2';
                header.textContent = loc.name;

                const content = document.createElement('div');
                content.className = 'p-3 text-xs leading-relaxed';
                content.innerHTML = `<p>Status: <b>${loc.level}</b></p><p>Lokasi: DKI Jakarta</p>`;

                const infoWindow = new InfoWindow({ headerContent: header, content: content });
                marker.addListener('click', () => infoWindow.open(map, marker));
            });
        }

        document.addEventListener('DOMContentLoaded', () => {
            renderSchools();
            initMap();

            const searchInput = document.getElementById('schoolSearch');
            const cityFilter = document.getElementById('filterCity');
            const levelFilter = document.getElementById('filterLevel');

            const handleFilterChange = () => {
                renderSchools({
                    name: searchInput.value,
                    city: cityFilter.value,
                    level: levelFilter.value
                });
            };

            searchInput.addEventListener('input', handleFilterChange);
            cityFilter.addEventListener('change', handleFilterChange);
            levelFilter.addEventListener('change', handleFilterChange);
        });
    
</script>
@endsection