'use client';

import { useState } from 'react';
import Link from 'next/link';
import { Button } from '@/components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { QuoteModal } from '@/components/marketing/QuoteModal';
import { WhatsAppButton } from '@/components/marketing/WhatsAppButton';

export default function Home() {
  const [quoteModalOpen, setQuoteModalOpen] = useState(false);

  return (
    <div className="flex flex-col min-h-screen">
      {/* Hero Section */}
      <section className="relative py-20 px-4 bg-gradient-to-b from-blue-50 to-white">
        <div className="container mx-auto max-w-6xl">
          <div className="text-center space-y-6">
            <h1 className="text-5xl md:text-6xl font-bold tracking-tight">
              <span className="block text-blue-600">Free AI Translation</span>
              in 100+ Languages
            </h1>
            <p className="text-xl text-gray-600 max-w-2xl mx-auto">
              Translate any document instantly, for free. No credit card required.
              Powered by Express Translation Pte Ltd - trusted since 2013.
            </p>
            <div className="flex gap-4 justify-center flex-wrap">
              <Link href="/signup">
                <Button size="lg" className="text-lg px-8">
                  Start Free Translation
                </Button>
              </Link>
              <Button
                size="lg"
                variant="outline"
                className="text-lg px-8"
                onClick={() => setQuoteModalOpen(true)}
              >
                Get Instant Quote
              </Button>
            </div>
            <p className="text-sm text-gray-500 mt-4">
              ✨ Unlimited free translations • No credit card required • 100+ languages
            </p>
          </div>
        </div>
      </section>

      {/* Features Section */}
      <section className="py-20 px-4">
        <div className="container mx-auto max-w-6xl">
          <h2 className="text-3xl md:text-4xl font-bold text-center mb-12">
            Why 10,000+ Users Choose TransLynx
          </h2>
          <div className="grid md:grid-cols-3 gap-8">
            <Card>
              <CardHeader>
                <CardTitle>100% Free</CardTitle>
                <CardDescription>Unlimited AI translations at no cost</CardDescription>
              </CardHeader>
              <CardContent>
                <p className="text-gray-600">
                  Translate unlimited documents for free using our advanced AI.
                  No credit card required, no hidden fees, no tricks.
                </p>
              </CardContent>
            </Card>

            <Card>
              <CardHeader>
                <CardTitle>Lightning Fast</CardTitle>
                <CardDescription>Get translations in seconds, not days</CardDescription>
              </CardHeader>
              <CardContent>
                <p className="text-gray-600">
                  AI-powered translation processes your documents instantly.
                  Upload, translate, download - all in under 60 seconds.
                </p>
              </CardContent>
            </Card>

            <Card>
              <CardHeader>
                <CardTitle>Trusted Quality</CardTitle>
                <CardDescription>Backed by 20+ years of expertise</CardDescription>
              </CardHeader>
              <CardContent>
                <p className="text-gray-600">
                  Powered by Express Translation Pte Ltd, serving Singapore
                  businesses since 2013. Premium services available when you need them.
                </p>
              </CardContent>
            </Card>
          </div>
        </div>
      </section>

      {/* How It Works */}
      <section className="py-20 px-4 bg-gray-50">
        <div className="container mx-auto max-w-6xl">
          <h2 className="text-3xl md:text-4xl font-bold text-center mb-12">
            How It Works
          </h2>
          <div className="grid md:grid-cols-4 gap-8">
            {[
              { step: '1', title: 'Upload', desc: 'Upload your document (PDF, JPG, DOCX)' },
              { step: '2', title: 'Select', desc: 'Choose languages and service tier' },
              { step: '3', title: 'Translate', desc: 'AI translates with optional human review' },
              { step: '4', title: 'Download', desc: 'Get your translated document instantly' },
            ].map((item) => (
              <div key={item.step} className="text-center">
                <div className="w-16 h-16 bg-blue-600 text-white rounded-full flex items-center justify-center text-2xl font-bold mx-auto mb-4">
                  {item.step}
                </div>
                <h3 className="font-semibold text-lg mb-2">{item.title}</h3>
                <p className="text-gray-600">{item.desc}</p>
              </div>
            ))}
          </div>
        </div>
      </section>

      {/* CTA Section */}
      <section className="py-20 px-4 bg-blue-600 text-white">
        <div className="container mx-auto max-w-4xl text-center">
          <h2 className="text-3xl md:text-4xl font-bold mb-6">
            Start Translating for Free Today
          </h2>
          <p className="text-xl mb-8 opacity-90">
            Join 10,000+ users translating documents for free. No credit card required.
          </p>
          <Link href="/signup">
            <Button size="lg" variant="secondary" className="text-lg px-8">
              Start Free Translation Now
            </Button>
          </Link>
          <p className="text-sm mt-4 opacity-75">
            Need certified translations? Premium services available in 2-4 weeks.
          </p>
        </div>
      </section>

      {/* Footer */}
      <footer className="py-8 px-4 border-t bg-gray-50">
        <div className="container mx-auto max-w-6xl">
          <div className="flex flex-col md:flex-row justify-between items-center gap-4 mb-4">
            <div className="text-gray-600 text-center md:text-left">
              <div className="font-semibold">TransLynx.ai</div>
              <div className="text-sm">
                Powered by{' '}
                <a
                  href="https://express-translation.com.sg"
                  target="_blank"
                  rel="noopener noreferrer"
                  className="text-blue-600 hover:underline"
                >
                  Express Translation Pte Ltd
                </a>
              </div>
              <div className="text-sm text-gray-500">Trusted since 2013 • Singapore</div>
            </div>
            <div className="flex gap-6">
              <Link href="/about" className="text-gray-600 hover:text-blue-600">
                About
              </Link>
              <Link href="/contact" className="text-gray-600 hover:text-blue-600">
                Contact
              </Link>
              <Link href="/login" className="text-gray-600 hover:text-blue-600">
                Login
              </Link>
            </div>
          </div>
          <div className="text-center text-sm text-gray-500 pt-4 border-t">
            © 2025 TransLynx. All rights reserved. | Free unlimited AI translation in 100+ languages
          </div>
        </div>
      </footer>

      {/* Marketing Components */}
      <QuoteModal open={quoteModalOpen} onOpenChange={setQuoteModalOpen} />
      <WhatsAppButton />
    </div>
  );
}
