import type React from "react"
import type { Metadata } from "next"
import { Poppins } from "next/font/google"
import { AuthProvider } from "@/contexts/auth-context"
import { AppLayout } from "@/components/layout/app-layout"
import { ToastProvider } from "@/components/ui/toast"
import "./globals.css"
import "@tldraw/tldraw/tldraw.css"

const poppins = Poppins({
  subsets: ["latin"],
  weight: ["300", "400", "500", "600", "700"],
  variable: "--font-poppins",
})

export const metadata: Metadata = {
  title: "Codenuk - AI-Powered Project Builder",
  description: "Build scalable applications with AI-generated architecture and code",
  generator: "v0.dev",
}

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode
}>) {
  return (
    <html lang="en">
      <head>
        <style>{`
html {
  font-family: ${poppins.style.fontFamily};
  --font-sans: ${poppins.variable};
}
        `}</style>
      </head>
      <body className="font-sans antialiased dark bg-black text-white">
        <ToastProvider>
          <AuthProvider>
            <AppLayout>
              <main>{children}</main>
            </AppLayout>
          </AuthProvider>
        </ToastProvider>
      </body>
    </html>
  )
}
