onst apiKey = document.getElementById("apiKey").value;
        const submitButton = document.getElementById("submitButton");
        const errorElem = document.getElementById("errorMessage");

        // Show loading state
        submitButton.classList.add("loading");
        submitButton.disabled = true;
        errorElem.style.display = "none";

        try {
          // Simulate a slight delay for better UX
          await new Promise((resolve) => setTimeout(resolve, 800));

          // Set the API ke