import type { Metadata } from "next";
import { Manrope, Poppins } from "next/font/google";
import "./globals.css";

const manrope = Manrope({
  subsets: ["latin"],
  display: "swap",
  variable: "--font-heading",
});

const poppins = Poppins({
  subsets: ["latin"],
  weight: ["100", "200", "300", "400", "500", "600", "700", "800", "900"],
  display: "swap",
  variable: "--font-body",
});

export const metadata: Metadata = {
  metadataBase: new URL("https://iroof.lk"),
  title: {
    default: "iRoof | Premium ASA Roofing Sheets in Sri Lanka",
    template: "%s | iRoof"
  },
  description: "Sri Lanka's leading manufacturer of polymer roofing sheets. Durable, heat-resistant, and eco-friendly Spanish-style ASA roofing solutions.",
  keywords: ["iroof", "roofing sheets sri lanka", "asa roofing", "spanish tile roof", "construction sri lanka", "sivilima"],
  manifest: "/images/favicon_io/site.webmanifest",
  icons: {
    icon: [
      { url: "/images/favicon_io/favicon-16x16.png", sizes: "16x16", type: "image/png" },
      { url: "/images/favicon_io/favicon-32x32.png", sizes: "32x32", type: "image/png" },
      { url: "/images/favicon_io/favicon.ico", type: "image/x-icon" },
    ],
    apple: "/images/favicon_io/apple-touch-icon.png",
    other: [
      { rel: "icon", url: "/images/favicon_io/android-chrome-192x192.png", sizes: "192x192", type: "image/png" },
      { rel: "icon", url: "/images/favicon_io/android-chrome-512x512.png", sizes: "512x512", type: "image/png" },
    ],
  },
  openGraph: {
    title: "iRoof | Premium ASA Roofing Sheets",
    description: "Modern, durable, and beautiful roofing solutions for your dream home.",
    url: "https://iroof.lk",
    siteName: "iRoof",
    images: [
      {
        url: "/images/logo-new.png",
        width: 1200,
        height: 630,
      },
    ],
    locale: "en_LK",
    type: "website",
  },
};

import CustomCursor from "@/components/CustomCursor";
import ScrollToTop from "@/components/ScrollToTop";
import WhatsAppChat from "@/components/WhatsAppChat";

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  const jsonLd = {
    "@context": "https://schema.org",
    "@type": "Organization",
    name: "iRoof by Idea Group",
    url: "https://iroof.lk",
    logo: "https://iroof.lk/images/logo-new.png",
    description: "Sri Lanka's leading manufacturer of premium ASA roofing sheets.",
    address: {
      "@type": "PostalAddress",
      "addressCountry": "LK"
    },
    contactPoint: {
      "@type": "ContactPoint",
      "telephone": "+94762200200",
      "contactType": "customer service"
    }
  };

  return (
    <html lang="en" suppressHydrationWarning>
      <body suppressHydrationWarning className={`${manrope.variable} ${poppins.variable} font-heading antialiased text-foreground bg-background`}>
        <script
          type="application/ld+json"
          dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
        />
        <CustomCursor />
        <ScrollToTop />
        <WhatsAppChat />
        {children}
      </body>
    </html>
  );
}
