document.addEventListener("DOMContentLoaded",()=>{const t=document.getElementById("categoryFilter"),a=document.getElementById("searchFilter"),l=document.querySelectorAll(".template-row"),d=document.querySelectorAll(".category-header");function o(){const n=t.value.toLowerCase(),c=a.value.toLowerCase(),s=new Set;l.forEach(e=>{const r=e.dataset.category,y=e.dataset.name,i=!n||r===n,g=!c||y.includes(c);i&&g?(e.style.display="",s.add(r)):e.style.display="none"}),d.forEach(e=>{e.style.display=s.has(e.dataset.category)?"":"none"})}t.addEventListener("change",o),a.addEventListener("input",o)});
