rget.classList.add('active');

      // Update editor
      if (editor) {
        editor.setValue(sample.code);
      }

      // Run the sample
      runCode();
    }

    // Tab switching
    document.querySelectorAll('.tab').forEach(tab => {
      tab.addEventListener('click', () => {
        const targetTab = tab.dataset.tab;

        // Update active tab
        document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
        tab.classList.add('active');

        // Update active c