estoreFocus() {
  if (lastFocusedElementId) {
    const elementToFocus = document.getElementById(lastFocusedElementId);
    if (elementToFocus) {
      setTimeout(() => {
        elementToFocus.focus();
      }, 0);
    }
  }
}

// Setup event listeners
function setupEventListeners() {
  // Track focus events
  document.addEventListener('focusin', (e) => {
    if (e.target.closest('.filter-badge') || e.target.closest('.add-filter-badge')) {
      const element = e.target.closest('[id]');
      if (element) 