import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import './globals.css';
import { SiteHeader } from '@/components/site-header';
import { SiteFooter } from '@/components/site-footer';

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

export const metadata: Metadata = {
  title: {
    default: 'Hampton, Brown & Associates, PC - Professional Tax Services in Corpus Christi',
    template: '%s | Hampton, Brown & Associates, PC',
  },
  description: 'Expert federal income and estate tax services, financial planning, and goal-oriented strategies in Corpus Christi, Texas. Helping clients achieve their economic goals through proactive planning.',
  keywords: ['CPA', 'tax preparation', 'tax planning', 'Corpus Christi', 'Texas', 'accounting', 'tax services', 'estate tax', 'federal tax', 'financial planning'],
  authors: [{ name: 'Hampton, Brown & Associates, PC' }],
  creator: 'Hampton, Brown & Associates, PC',
  publisher: 'Hampton, Brown & Associates, PC',
  formatDetection: {
    email: false,
    address: false,
    telephone: false,
  },
  metadataBase: new URL(process.env.SITE_URL || 'https://hamptonbrown.com'),
  alternates: {
    canonical: '/',
  },
  openGraph: {
    type: 'website',
    locale: 'en_US',
    url: '/',
    title: 'Hampton, Brown & Associates, PC - Professional Tax Services in Corpus Christi',
    description: 'Expert federal income and estate tax services, financial planning, and goal-oriented strategies in Corpus Christi, Texas.',
    siteName: 'Hampton, Brown & Associates, PC',
    images: [
      {
        url: '/images/home-hero.jpg',
        width: 1200,
        height: 630,
        alt: 'Hampton, Brown & Associates office in Corpus Christi',
      },
    ],
  },
  twitter: {
    card: 'summary_large_image',
    title: 'Hampton, Brown & Associates, PC - Professional Tax Services in Corpus Christi',
    description: 'Expert federal income and estate tax services, financial planning, and goal-oriented strategies in Corpus Christi, Texas.',
    images: ['/images/home-hero.jpg'],
  },
  robots: {
    index: true,
    follow: true,
    googleBot: {
      index: true,
      follow: true,
      'max-video-preview': -1,
      'max-image-preview': 'large',
      'max-snippet': -1,
    },
  },
  verification: {
    google: 'your-google-verification-code',
  },
};

const jsonLd = {
  '@context': 'https://schema.org',
  '@type': 'AccountingService',
  name: 'Hampton, Brown & Associates, PC',
  description: 'Expert federal income and estate tax services, financial planning, and goal-oriented strategies in Corpus Christi, Texas',
  url: 'https://hamptonbrown.com',
  telephone: '+1-361-888-7711',
  email: 'info@hamptonbrown.com',
  address: {
    '@type': 'PostalAddress',
    streetAddress: '711 N. Carancahua St, Suite 800',
    addressLocality: 'Corpus Christi',
    addressRegion: 'TX',
    postalCode: '78401-0545',
    addressCountry: 'US',
  },
  geo: {
    '@type': 'GeoCoordinates',
    latitude: 27.8006,
    longitude: -97.3964,
  },
  openingHours: 'Mo-Fr 09:00-17:00',
  priceRange: '$$',
  areaServed: {
    '@type': 'City',
    name: 'Corpus Christi',
  },
  serviceArea: {
    '@type': 'City',
    name: 'Corpus Christi',
  },
  hasOfferCatalog: {
    '@type': 'OfferCatalog',
    name: 'Tax Services',
    itemListElement: [
      {
        '@type': 'Offer',
        itemOffered: {
          '@type': 'Service',
          name: 'Tax Planning',
          description: 'Strategic year-round tax planning to minimize your tax burden',
        },
      },
      {
        '@type': 'Offer',
        itemOffered: {
          '@type': 'Service',
          name: 'Income Tax Preparation',
          description: 'Comprehensive individual and business tax return preparation',
        },
      },
      {
        '@type': 'Offer',
        itemOffered: {
          '@type': 'Service',
          name: 'Estate Tax Planning',
          description: 'Comprehensive estate planning to protect your legacy',
        },
      },
    ],
  },
};

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en" className="scroll-smooth">
      <head>
        <script
          type="application/ld+json"
          dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
        />
      </head>
      <body className={inter.className}>
        <a href="#main-content" className="skip-link">
          Skip to main content
        </a>
        <div className="min-h-screen flex flex-col">
          <SiteHeader />
          <main id="main-content" className="flex-1">
            {children}
          </main>
          <SiteFooter />
        </div>
      </body>
    </html>
  );
}
