import type { Metadata } from "next";
import { Geist, Geist_Mono, Merriweather, Chivo_Mono } from "next/font/google";
import { Toaster } from 'sonner';
import { ThemeProvider } from "@/lib/theme-provider";
import { CustomFooter } from "@/components/custom-footer";
import "./globals.css";

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

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

const merriweather = Merriweather({
    variable: "--font-merriweather",
    subsets: ["latin"],
    weight: ["300", "400", "700", "900"],
});

const chivoMono = Chivo_Mono({
    variable: "--font-chivo-mono",
    subsets: ["latin"],
});

export const metadata: Metadata = {
    title: {
        default: "BiohazardVFX Minecraft Server | Join Our SMP Community",
        template: "%s | BiohazardVFX Minecraft Server"
    },
    description: "Join BiohazardVFX, a 1.21.x Survival Minecraft server for VFX artists and creatives. Experience vanilla-first gameplay with community and whitelist access.",
    keywords: ["Minecraft", "SMP", "Survival", "VFX", "Creative", "Community", "Server", "Minecraft Server", "Whitelist", "Discord", "1.21.x", "BiohazardVFX"],
    authors: [{ name: "BiohazardVFX Team" }],
    creator: "BiohazardVFX Team",
    publisher: "BiohazardVFX Team",
    metadataBase: new URL('https://minecraft.biohazardvfx.com'),
    alternates: {
        canonical: '/',
    },
    openGraph: {
        type: 'website',
        locale: 'en_US',
        url: 'https://minecraft.biohazardvfx.com',
        title: 'BiohazardVFX Minecraft Server | Join Our SMP Community',
        description: 'Join BiohazardVFX, a 1.21.x Survival Minecraft server for VFX artists and creatives. Experience vanilla-first gameplay with community and whitelist access.',
        siteName: 'BiohazardVFX Minecraft Server',
        images: [
            {
                url: '/backgroundimg.avif',
                width: 1200,
                height: 630,
                alt: 'BiohazardVFX Minecraft Server',
            },
        ],
    },
    twitter: {
        card: 'summary_large_image',
        title: 'BiohazardVFX Minecraft Server | Join Our SMP Community',
        description: 'Join BiohazardVFX, a 1.21.x Survival Minecraft server for VFX artists and creatives. Experience vanilla-first gameplay with community and whitelist access.',
        images: ['/backgroundimg.avif'],
    },
    robots: {
        index: true,
        follow: true,
        googleBot: {
            index: true,
            follow: true,
            'max-video-preview': -1,
            'max-image-preview': 'large',
            'max-snippet': -1,
        }
    },
    verification: {
        // Add any verification meta tags here if needed
    }
};

export default function RootLayout({
    children,
}: Readonly<{
    children: React.ReactNode;
}>) {
    return (
        <html lang="en" suppressHydrationWarning>
            <body
                className={`${geistSans.variable} ${geistMono.variable} ${merriweather.variable} ${chivoMono.variable} antialiased`}
            >
                <ThemeProvider
                    attribute="class"
                    defaultTheme="system"
                    enableSystem
                    disableTransitionOnChange
                >
                    {children}
                    <CustomFooter />
                    <Toaster position="bottom-right" />
                </ThemeProvider>
            </body>
        </html>
    );
}
