import type { Metadata, Viewport } from "next";
import { Inter, Playfair_Display, Poppins, Roboto } from "next/font/google";
import "./globals.css";
import { Header } from "@/components/layout/Header";
import { Navbar } from "@/components/layout/Navbar";
import { Footer } from "@/components/layout/Footer";

const inter = Inter({
  subsets: ["latin"],
  variable: "--font-inter",
  display: "swap",
});

const playfair = Playfair_Display({
  subsets: ["latin"],
  variable: "--font-playfair",
  display: "swap",
});

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

const roboto = Roboto({
  subsets: ["latin"],
  weight: ["300", "400", "500", "700"],
  variable: "--font-roboto",
  display: "swap",
});

export const viewport: Viewport = {
  themeColor: "#0284C7",
  width: "device-width",
  initialScale: 1,
};

export const metadata: Metadata = {
  title: "bioWORLD | Molecular Tools and Laboratory Essentials",
  description:
    "Global leader in high-quality molecular life science tools. bioWORLD offers affinity matrices, lectins, chemicals, biological media, enzymes, buffers, reagents, and kits for life sciences research.",
  keywords: [
    "molecular tools",
    "laboratory essentials",
    "affinity matrices",
    "lectins",
    "proteins",
    "enzymes",
    "buffers",
    "reagents",
    "plant media",
    "laboratory chemicals",
    "bioWORLD",
  ],
  authors: [{ name: "bioWORLD" }],
  creator: "bioWORLD",
  publisher: "bioWORLD",
  metadataBase: new URL("https://www.bio-world.com"),
  alternates: {
    canonical: "/",
  },
  openGraph: {
    title: "bioWORLD | Molecular Tools and Laboratory Essentials",
    description:
      "Global leader in high-quality molecular life science tools, buffers, reagents, and laboratory essentials.",
    url: "https://www.bio-world.com",
    siteName: "bioWORLD",
    images: [
      {
        url: "/images/hero/hero-cells.png",
        width: 1200,
        height: 630,
        alt: "bioWORLD Molecular Tools and Laboratory Essentials",
      },
    ],
    locale: "en_US",
    type: "website",
  },
  twitter: {
    card: "summary_large_image",
    title: "bioWORLD | Molecular Tools and Laboratory Essentials",
    description:
      "Global leader in high-quality molecular life science tools, buffers, reagents, and laboratory essentials.",
    images: ["/images/hero/hero-cells.png"],
  },
  robots: {
    index: true,
    follow: true,
    googleBot: {
      index: true,
      follow: true,
      "max-video-preview": -1,
      "max-image-preview": "large",
      "max-snippet": -1,
    },
  },
};

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en" className={`${inter.variable} ${playfair.variable} ${poppins.variable} ${roboto.variable} h-full scroll-smooth`}>
      <head>
        <link rel="icon" href="/images/logo/bioworld-logo.svg" type="image/svg+xml" />
      </head>
      <body className="min-h-full flex flex-col font-sans bg-white text-slate-800 antialiased selection:bg-sky-100 selection:text-sky-900 overflow-x-hidden">
        <Header />
        <Navbar />
        <main className="flex-1">{children}</main>
        <Footer />
      </body>
    </html>
  );
}
