---
import Navbar from "../components/core/Navbar.astro";
import Footer from "../components/core/Footer.astro";
import InView from "../components/core/InView.astro";
---

<!doctype html>
<html lang="en" data-theme="dark" class="w-full h-full m-0 bg-ieee-black">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width" />
    <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
    <meta name="generator" content={Astro.generator} />
    <title>IEEEUCSD</title>
    <script
      src="https://code.iconify.design/iconify-icon/1.0.7/iconify-icon.min.js"
    ></script>
    <script is:inline>
      // Set default theme to dark if not already set
      if (!localStorage.getItem("theme")) {
        localStorage.setItem("theme", "dark");
        document.documentElement.setAttribute("data-theme", "dark");
      } else {
        // Apply saved theme
        const savedTheme = localStorage.getItem("theme");
        document.documentElement.setAttribute("data-theme", savedTheme);
      }
    </script>
  </head>
  <InView />
  <body class="w-full h-full m-0 bg-ieee-black">
    <div class="text-white min-h-screen">
      <header class="sticky top-0 w-full z-[999]">
        <Navbar />
      </header>
      <main class="w-[95%] mx-auto">
        <slot />
      </main>
      <Footer />
    </div>
  </body>
</html>
