const CACHE_NAME = 'wellflow-v1';
const urlsToCache = [
  '/',
  '/index.html',
  '/css/styles.min.css',
  '/js/main.min.js',
  '/js/components.min.js',
  '/js/data.min.js',
  // Add more static assets
];

self.addEventListener('install', event => {
  event.waitUntil(
    caches.open(CACHE_NAME)
      .then(cache => cache.addAll(urlsToCache))
  );
});

self.addEventListener('fetch', event => {
  event.respondWith(
    caches.match(event.request)
      .then(response => response || fetch(event.request))
  );
});