con.classList.toggle('rotated');
        });

        form.addEventListener('submit', async (e) => {
            e.preventDefault();
            const text = textInput.value.trim();

            if (!text) {
                showError('Please enter some text to convert.');
                audioContainer.style.display = 'none';
                return;
            }

            clearError();
            submitBtn.disabled = true;
            btnText.textContent = 'Generating...';
            loadingSpinner.st