       selectedAvatar = avatarSrc;
            }
        }

        function saveProfile() {
            const newName = document.getElementById("nameInput").value.trim();
            const newEmail = document.getElementById("emailInput").value.trim();
            const newPhone = document.getElementById("phoneInput").value.trim();
            const newBio = document.getElementById("bioInput").value.trim();

            // Check if all fields are valid before proceeding
            if (!nameInput.checkValid