import type { Metadata, Viewport } from "next";
import { Inter, Orbitron } from "next/font/google";
import { Analytics } from '@vercel/analytics/next';
import { LocaleProvider } from '@/context/LocaleContext';
import React from 'react';
import "./globals.css";

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

export const viewport: Viewport = {
  width: 'device-width',
  initialScale: 1,
  themeColor: '#00D4FF',
};

export const metadata: Metadata = {
  metadataBase: new URL('https://zerosixlab.com'),
  title: {
    default: "ZeroSixLab - Geleceği Kodlayan Laboratuvar",
    template: "%s | ZeroSixLab"
  },
  description: "Ankara merkezli, global vizyonlu yeni nesil yazılım ve Ar-Ge laboratuvarı. Web, mobil, yapay zeka ve blockchain çözümleri.",
  keywords: [
    "yazılım geliştirme",
    "web tasarım",
    "mobil uygulama",
    "yapay zeka",
    "blockchain",
    "Ankara yazılım",
    "ZeroSixLab",
    "dijital dönüşüm",
    "Ar-Ge",
    "Next.js",
    "React",
    "TypeScript"
  ],
  authors: [{ name: "ZeroSixLab", url: "https://zerosixlab.com" }],
  creator: "ZeroSixLab",
  publisher: "ZeroSixLab",
  robots: {
    index: true,
    follow: true,
    googleBot: {
      index: true,
      follow: true,
      'max-video-preview': -1,
      'max-image-preview': 'large',
      'max-snippet': -1,
    },
  },
  openGraph: {
    type: "website",
    locale: "tr_TR",
    url: "https://zerosixlab.com",
    siteName: "ZeroSixLab",
    title: "ZeroSixLab - Geleceği Kodlayan Laboratuvar",
    description: "Ankara merkezli, global vizyonlu yeni nesil yazılım ve Ar-Ge laboratuvarı.",
    images: [
      {
        url: "/og-image.png",
        width: 1200,
        height: 630,
        alt: "ZeroSixLab - Yazılım Laboratuvarı",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "ZeroSixLab - Geleceği Kodlayan Laboratuvar",
    description: "Ankara merkezli, global vizyonlu yeni nesil yazılım ve Ar-Ge laboratuvarı.",
    images: ["/og-image.png"],
    creator: "@zerosixlab",
  },
  icons: {
    icon: "/favicon.ico",
  },
  manifest: "/manifest.json",
  alternates: {
    canonical: "https://zerosixlab.com",
  },
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="tr">
      <head>
        <link rel="preconnect" href="https://fonts.googleapis.com" />
        <link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
      </head>
      <body className={`${inter.variable} ${orbitron.variable} font-sans bg-zsl-bg text-zsl-text`}>
        <LocaleProvider>
          <a href="#main-content" className="skip-link">
            Ana i\u00e7eri\u011fe atla
          </a>
          <main id="main-content">
            {children}
          </main>
          <Analytics />
          <div className="scanlines"></div>
        </LocaleProvider>
      </body>
    </html>
  );
}
