const puppeteer = require('puppeteer');
(async () => {
    const browser = await puppeteer.launch({ headless: "new" });
    const page = await browser.newPage();
    await page.setViewport({ width: 1400, height: 900 });
    await page.goto('http://127.0.0.1:8000/conference/business-management-economics-spain-2026/call-for-papers', { waitUntil: 'networkidle0' });
    
    const navDetails = await page.evaluate(() => {
        const nav = document.querySelector('nav');
        if (!nav) return 'Nav not found';
        const rect = nav.getBoundingClientRect();
        const styles = window.getComputedStyle(nav);
        return {
            rect: { top: rect.top, left: rect.left, width: rect.width, height: rect.height },
            classes: nav.className,
            opacity: styles.opacity,
            display: styles.display,
            visibility: styles.visibility,
            zIndex: styles.zIndex,
            html: nav.outerHTML.substring(0, 500)
        };
    });
    console.log("Nav details:", JSON.stringify(navDetails, null, 2));

    const alpineErrors = await page.evaluate(() => {
        return window.Alpine ? 'Alpine loaded' : 'Alpine NOT loaded';
    });
    console.log(alpineErrors);

    await browser.close();
})();
