import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import { Providers } from "@/components/Providers";

const inter = Inter({ subsets: ["latin"] });

const APP_URL = process.env.NEXTAUTH_URL ?? "https://dialpilot.com";

export const metadata: Metadata = {
  metadataBase: new URL(APP_URL),
  title: {
    default: "Dialpilot — Chatboti AI pentru afacerea ta",
    template: "%s | Dialpilot",
  },
  description: "Creeaza chatboti AI personalizati in 3 minute si integreaza-i pe site sau WhatsApp. Captureaza leaduri 24/7, raspunde automat clientilor. Powered by Claude AI.",
  keywords: ["chatbot AI", "chatbot Romania", "chatbot site web", "chatbot WhatsApp", "asistent virtual", "captare leaduri", "automatizare clienti", "Claude AI", "chatbot business"],
  authors: [{ name: "Dialpilot", url: APP_URL }],
  creator: "Dialpilot",
  publisher: "Dialpilot",
  robots: {
    index: true,
    follow: true,
    googleBot: { index: true, follow: true, "max-image-preview": "large" },
  },
  openGraph: {
    type: "website",
    locale: "ro_RO",
    url: APP_URL,
    siteName: "Dialpilot",
    title: "Dialpilot — Chatboti AI pentru afacerea ta",
    description: "Creeaza chatboti AI personalizati in 3 minute. Captureaza leaduri 24/7, raspunde automat clientilor pe site si WhatsApp. Powered by Claude AI.",
    images: [{ url: "/og-image.png", width: 1200, height: 630, alt: "Dialpilot — Chatboti AI" }],
  },
  twitter: {
    card: "summary_large_image",
    title: "Dialpilot — Chatboti AI pentru afacerea ta",
    description: "Creeaza chatboti AI in 3 minute. Captureaza leaduri 24/7 pe site si WhatsApp.",
    images: ["/og-image.png"],
  },
  alternates: {
    canonical: APP_URL,
  },
};

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="ro">
      <body className={`${inter.className} h-full`}>
        <Providers>{children}</Providers>
      </body>
    </html>
  );
}
