﻿import type { Metadata } from "next";
import { Geist, Geist_Mono, Space_Grotesk } from "next/font/google";
import "./globals.css";
import Navbar from "@/components/Navbar";
import Footer from "@/components/Footer";
import CustomCursor from "@/components/CustomCursor";
import ScrollProgress from "@/components/ScrollProgress";
import LoadingScreen from "@/components/LoadingScreen";
import GlobalTerminal from "@/components/GlobalTerminal";
import AIAssistant from "@/components/AIAssistant";

const geistSans = Geist({ variable: "--font-geist-sans", subsets: ["latin"], display: "swap" });
const geistMono = Geist_Mono({ variable: "--font-geist-mono", subsets: ["latin"], display: "swap" });
const spaceGrotesk = Space_Grotesk({ variable: "--font-space-grotesk", subsets: ["latin"], display: "swap" });

const siteUrl = "https://ravneetbrar.in";
const title = "Ravneet Brar â€” Founder, Developer & Entrepreneur";
const description = "Ravneet Brar is a developer and entrepreneur building technology, cloud infrastructure, digital products and Zyphron Cloud.";

export const metadata: Metadata = {
  metadataBase: new URL(siteUrl),
  title: { default: title, template: "%s â€” Ravneet Brar" },
  description,
  keywords: ["Ravneet Brar","Zyphron Cloud","developer","entrepreneur","cloud infrastructure","hosting","Next.js","Punjab"],
  authors: [{ name: "Ravneet Brar", url: siteUrl }],
  creator: "Ravneet Brar",
  alternates: { canonical: siteUrl },
  openGraph: { type: "website", url: siteUrl, title, description, siteName: "Ravneet Brar", locale: "en_IN", images: [{ url: "/og.png", width: 1200, height: 630, alt: title }] },
  twitter: { card: "summary_large_image", title, description, images: ["/og.png"] },
  robots: { index: true, follow: true },
  icons: { icon: "/favicon.ico" },
};

export default function RootLayout({ children }: { children: React.ReactNode }) {
  const personSchema = {
    "@context": "https://schema.org",
    "@type": "Person",
    name: "Ravneet Brar",
    url: siteUrl,
    jobTitle: "Founder, Developer & Entrepreneur",
    worksFor: { "@type": "Organization", name: "Zyphron Cloud", url: "https://zyphron.cloud" },
    sameAs: [] as string[],
    description,
  };
  return (
    <html lang="en" className={`${geistSans.variable} ${geistMono.variable} ${spaceGrotesk.variable} h-full antialiased`}>
      <body className="min-h-full flex flex-col bg-[#07080c]">
        <script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(personSchema) }} />
        <ScrollProgress />
        <LoadingScreen />
        <CustomCursor />
        <GlobalTerminal />
        <AIAssistant />
        <Navbar />
        <main className="flex-1 flex flex-col">{children}</main>
        <Footer />
      </body>
    </html>
  );
}
