const mockDoc = {
  getElementById: (id) => ({ addEventListener: ()=>{}, classList: {add:()=>{},remove:()=>{},toggle:()=>{}}, style: {}, appendChild:()=>{} }),
  querySelectorAll: () => [],
  addEventListener: () => {},
  createElement: () => ({ style: {}, classList: {add:()=>{},remove:()=>{},toggle:()=>{}}, appendChild:()=>{} }),
  head: { appendChild: ()=>{} },
  body: { appendChild: ()=>{} }
};
global.document = mockDoc;
global.window = { addEventListener: () => {} };
global.chrome = { storage: { local: { get: async ()=>({}), set: ()=>{} } }, runtime: { onMessage: { addListener: ()=>{} } }, storage: { local: { get: ()=>{}, set: ()=>{} } } };
global.alert = () => {};
global.prompt = () => {};
global.confirm = () => {};

(async () => {
    try {
        await import('./sidepanel.js');
        console.log("IMPORTED SUCCESSFULLY!");
    } catch(e) {
        console.error("IMPORT ERROR:", e.stack);
    }
})();

global.MutationObserver = class { observe(){} disconnect(){} };
