import SmoothScrollProvider from "@/providers/SmoothScrollProvider";
import type { Metadata } from "next";
import localFont from "next/font/local";

import Actions from "@/components/molecules/Actions";
import LottieLoader from "@/components/LottieLoader";
import ToastProvider from "@/components/ToastProvider";
import Footer from "@/layouts/Footer";
import Navigation from "@/sections/home/Navigation";
import "./globals.css";
import "yet-another-react-lightbox/styles.css";
import "react-toastify/dist/ReactToastify.css";

// Local font configurations
const creatoDisplay = localFont({
  src: [
    {
      path: "../assets/fonts/CreatoDisplay-Thin.woff2",
      weight: "100",
      style: "normal",
    },
    {
      path: "../assets/fonts/CreatoDisplay-Light.woff2",
      weight: "300",
      style: "normal",
    },
    {
      path: "../assets/fonts/CreatoDisplay-Regular.woff2",
      weight: "400",
      style: "normal",
    },
    {
      path: "../assets/fonts/CreatoDisplay-Medium.woff2",
      weight: "500",
      style: "normal",
    },
  ],
  variable: "--font-creato-display",
  display: "swap",
});

const timesSansSerif = localFont({
  src: "../assets/fonts/times_sans_serif_regular.woff2",
  weight: "400",
  style: "normal",
  variable: "--font-times-sans-serif",
  display: "swap",
});

export const metadata: Metadata = {
  title: "Navana Real Estate Ltd. | Leading Real Estate Company in Bangladesh",
  description:
    "Navana Real Estate Ltd. has been trailblazing the real estate industry for the last 28 years. Delivering iconic residential, commercial, condominium and land properties across Dhaka and Chittagong.",
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en">
      <body
        className={`${creatoDisplay.variable} ${timesSansSerif.variable} antialiased`}
      >
        <LottieLoader />
        <Navigation />
        <main className="relative w-full max-w-full overflow-x-hidden">
          <SmoothScrollProvider>{children}</SmoothScrollProvider>
        </main>
        <Actions />
        <Footer />
        <ToastProvider />
      </body>
    </html>
  );
}
