<!-- PWA Meta Tags & Registration -->
<link rel="manifest" href="/manifest.json">
<meta name="theme-color" content="#2563EB">
<link rel="apple-touch-icon" href="/icons/logo-192x192.png">

<script>
    if ('serviceWorker' in navigator) {
        window.addEventListener('load', function() {
            navigator.serviceWorker.register('/sw.js').then(function(registration) {
                // Registration was successful
                // console.log('ServiceWorker registration successful with scope: ', registration.scope);
            }, function(err) {
                // registration failed
                console.log('ServiceWorker registration failed: ', err);
            });
        });
    }

    // Instalasi PWA Helper
    let deferredPrompt;
    window.addEventListener('beforeinstallprompt', (e) => {
        e.preventDefault();
        deferredPrompt = e;
        
        // Custom logic kalau mau bikin banner custom
        // Tampilkan tombol Install, dsb
    });
</script>
