import Navbar from '@/components/Navbar'
import Hero from '@/components/Hero'
import Ticker from '@/components/Ticker'
import Features from '@/components/Features'
import BrownLeaf from '@/components/BrownLeaf'
import Intelligence from '@/components/Intelligence'
import HowItWorks from '@/components/HowItWorks'
import FAQ from '@/components/FAQ'
import CTA from '@/components/CTA'
import Footer from '@/components/Footer'

const howToSchema = {
  '@context': 'https://schema.org',
  '@type': 'HowTo',
  name: 'How to identify a plant with GreenLens',
  step: [
    {
      '@type': 'HowToStep',
      position: 1,
      name: 'Photograph your plant',
      text: 'Open the app, point the camera at your plant and tap Scan.',
    },
    {
      '@type': 'HowToStep',
      position: 2,
      name: 'AI identifies instantly',
      text: 'In under a second you get the exact name, species and all key details.',
    },
    {
      '@type': 'HowToStep',
      position: 3,
      name: 'Receive care plan',
      text: 'GreenLens automatically creates a personalized care plan for your plant and location.',
    },
    {
      '@type': 'HowToStep',
      position: 4,
      name: 'Track growth',
      text: 'Document photos, track watering and get reminded of important care dates.',
    },
  ],
}

const faqSchema = {
  '@context': 'https://schema.org',
  '@type': 'FAQPage',
  mainEntity: [
    {
      '@type': 'Question',
      name: 'How does GreenLens identify a plant?',
      acceptedAnswer: {
        '@type': 'Answer',
        text: 'GreenLens analyzes the plant photo and combines that with app-side care guidance so you can move from scan to next steps faster.',
      },
    },
    {
      '@type': 'Question',
      name: 'Is GreenLens free to use?',
      acceptedAnswer: {
        '@type': 'Answer',
        text: 'GreenLens includes free functionality plus paid options such as subscriptions and credit top-ups for advanced AI features.',
      },
    },
    {
      '@type': 'Question',
      name: 'Can I use GreenLens offline?',
      acceptedAnswer: {
        '@type': 'Answer',
        text: 'Plant identification and health checks require an internet connection. Your saved collection, care notes, and watering reminders are available offline.',
      },
    },
    {
      '@type': 'Question',
      name: 'What kind of plants can I use GreenLens for?',
      acceptedAnswer: {
        '@type': 'Answer',
        text: 'GreenLens covers 450+ plant species including houseplants, garden plants, and succulents. It is built for everyday plant owners who want identification and care guidance in one place.',
      },
    },
    {
      '@type': 'Question',
      name: 'How do I start my plant collection in GreenLens?',
      acceptedAnswer: {
        '@type': 'Answer',
        text: 'Start with a scan, review the result, and save the plant to your collection to keep notes, reminders, and follow-up care in one place.',
      },
    },
  ],
}

export default function Home() {
  return (
    <>
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{ __html: JSON.stringify(howToSchema) }}
      />
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{ __html: JSON.stringify(faqSchema) }}
      />
      <Navbar />
      <main>
        <Hero />
        <Ticker />
        <Features />
        <BrownLeaf />
        <Intelligence />
        <HowItWorks />
        <FAQ />
        <CTA />
      </main>
      <Footer />
    </>
  )
}
