ontent
        document.querySelectorAll('.tab-content').forEach(content => content.classList.remove('active'));
        document.getElementById(`${targetTab}-tab`).classList.add('active');
      });
    });

    // Run code
    function runCode() {
      try {
        const code = editor ? editor.getValue() : currentSample.code;

        // Create iframe for isolated execution
        const iframe = document.getElementById('previewFrame');
        const iframeDoc = iframe.contentDocument || iframe.contentW