rect to the profile page
            window.location.href = "profile.html";  // Change made here
        }

        function validateEmail(email) {
            const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
            return re.test(email);
        }

        document.addEventListener("DOMContentLoaded", () => {
            const savedAvatar = localStorage.getItem("selectedAvatar");
            if (savedAvatar) {
                const selectedImg = Array.from(document.querySelectorAll('.ava