import type { Metadata, Viewport } from 'next'
import { Inter } from 'next/font/google'
import './globals.css'
import { Navbar } from '@/components/layout/Navbar'
import { Footer } from '@/components/layout/Footer'
import { DaliBotLauncher } from '@/components/dalibot/DaliBotLauncher'
import { ServiceWorkerRegister } from '@/components/pwa/ServiceWorkerRegister'

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

export const metadata: Metadata = {
  title: 'DaliTek Consulting Services | Custom Business Systems for Central Florida',
  description:
    'DaliTek builds custom web apps, workflow automation, booking systems, and data tools for Central Florida businesses. Save time, eliminate manual work, and operate with clarity.',
  manifest: '/manifest.webmanifest',
  keywords: [
    'business systems',
    'workflow automation',
    'custom web apps',
    'Central Florida',
    'Orlando',
    'Winter Garden',
    'small business technology',
  ],
  openGraph: {
    title: 'DaliTek - Artisan Business Systems',
    description: 'Custom digital systems for Central Florida businesses.',
    url: 'https://www.dalitek.us',
    siteName: 'DaliTek',
    type: 'website',
  },
  twitter: {
    card: 'summary_large_image',
    title: 'DaliTek - Artisan Business Systems',
    description: 'Custom digital systems for Central Florida businesses.',
  },
  appleWebApp: {
    capable: true,
    statusBarStyle: 'black-translucent',
    title: 'DaliTek',
  },
  metadataBase: new URL('https://www.dalitek.us'),
}

export const viewport: Viewport = {
  width: 'device-width',
  initialScale: 1,
  themeColor: '#0a0a0f',
  colorScheme: 'dark',
}

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode
}>) {
  return (
    <html lang="en" className={`${inter.variable} h-full`}>
      <body
        className="min-h-full flex flex-col antialiased"
        style={{
          backgroundColor: 'var(--dt-bg-base)',
          color: 'var(--dt-text-primary)',
        }}
      >
        <ServiceWorkerRegister />
        <Navbar />
        <main className="flex-1">{children}</main>
        <Footer />
        <DaliBotLauncher />
      </body>
    </html>
  )
}
