// plugins/keyboard-shortcuts.client.ts
export default defineNuxtPlugin(() => {
  const router = useRouter();

  const handleKeyPress = (event: KeyboardEvent) => {
    // Alt + Shift + H
    if (event.altKey && event.shiftKey && event.key.toLowerCase() === 'h') {
      event.preventDefault();
      
      console.log('🎯 Alt+Shift+H detected - setting bypass flag');
      
      // Set a temporary flag to bypass middleware
      sessionStorage.setItem('bypassRootRedirect', 'true');
      
      // Navigate to root
      router.push('/');
    }
  };

  window.addEventListener('keydown', handleKeyPress);
  console.log('✅ Keyboard shortcuts loaded - Press Alt+Shift+H to access root');
});