import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import { LiveChat } from "./components/live-chat";
import { JsonLd, organizationSchema, websiteSchema } from "./lib/seo";

const geist = Geist({ variable: "--font-sans", subsets: ["latin"] });
const mono = Geist_Mono({ variable: "--font-mono", subsets: ["latin"] });

export const metadata: Metadata = {
  metadataBase: new URL("https://niosus-digital.itsbetr.chatgpt.site"),
  title: { default: "NIOSUS | Complexity, made powerful.", template: "%s" },
  description: "NIOSUS connects strategy, technology and human insight to build systems that move organisations forward.",
  applicationName: "NIOSUS",
  keywords: ["NIOSUS", "artificial intelligence", "software development", "cybersecurity", "telecommunications", "business automation"],
  icons: { icon: "/favicon.svg" },
  openGraph: {
    title: "NIOSUS | Complexity, made powerful.",
    description: "Technology, engineered for impact.",
    siteName: "NIOSUS",
    type: "website",
    images: [{ url: "/og.jpg", width: 1200, height: 630, alt: "NIOSUS | Complexity, made powerful." }],
  },
  twitter: { card: "summary_large_image", images: ["/og.jpg"] },
  robots: { index: true, follow: true },
  verification: {
    google: process.env.NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION || undefined,
    other: process.env.NEXT_PUBLIC_BING_SITE_VERIFICATION ? { "msvalidate.01": process.env.NEXT_PUBLIC_BING_SITE_VERIFICATION } : undefined,
  },
};

export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
  return <html lang="en"><body className={`${geist.variable} ${mono.variable}`}><JsonLd data={[organizationSchema, websiteSchema]}/>{children}<LiveChat websiteId={process.env.NEXT_PUBLIC_CRISP_WEBSITE_ID || ""}/></body></html>;
}
