e = card
            .querySelector("h2")
            .textContent.trim()
            .toLowerCase();
          const matchesTitle = title.includes(query); // 'includes' is better than 'startsWith' for search
          if (matchesTitle) {
            card.style.display = "";
            visibleCount++;
          } else {
            card.style.display = "none";
          }
        });

        if (noResultsMsg) {

          noResultsMsg.style.display = visibleCount === 0 ? 'block' : 'none';
        }
     
