import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import './globals.css'
import { Providers } from '@/components/providers/Providers'
import { PUBLIC_APP_URL } from '@/lib/api/config'

const inter = Inter({ subsets: ['latin'], variable: '--font-inter' })

const APP_URL = PUBLIC_APP_URL

export const metadata: Metadata = {
  metadataBase: APP_URL ? new URL(APP_URL) : undefined,
  title: {
    default: 'IMBARAGA — AI-Powered Business Operations',
    template: '%s | IMBARAGA',
  },
  description: 'Autonomous order-to-fulfillment agent platform',
  alternates: {
    canonical: '/',
  },
  openGraph: {
    type: 'website',
    url: APP_URL,
    siteName: 'IMBARAGA',
    title: 'IMBARAGA — AI-Powered Business Operations',
    description: 'Autonomous order-to-fulfillment agent platform',
  },
  twitter: {
    card: 'summary',
    title: 'IMBARAGA — AI-Powered Business Operations',
    description: 'Autonomous order-to-fulfillment agent platform',
  },
}

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <html lang="en" className={`${inter.variable} antialiased`} suppressHydrationWarning>
      <body className="min-h-screen bg-gray-50 dark:bg-gray-950 font-sans">
        <Providers>{children}</Providers>
      </body>
    </html>
  )
}