
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { ScrollText, Shield, AlertTriangle, Scale } from "lucide-react";
import { useTranslation } from "react-i18next";
import SEO from "@/components/SEO";

const Terms = () => {
  const { t } = useTranslation();

  // Get the current URL for Open Graph
  const currentUrl = typeof window !== 'undefined' ? window.location.href : 'https://shopcall.ai/terms';

  const sections = [
    {
      icon: ScrollText,
      title: t('terms.overview.acceptance.title'),
      content: t('terms.overview.acceptance.description')
    },
    {
      icon: Shield,
      title: t('terms.overview.license.title'),
      content: t('terms.overview.license.description')
    },
    {
      icon: AlertTriangle,
      title: t('terms.overview.disclaimer.title'),
      content: t('terms.overview.disclaimer.description')
    },
    {
      icon: Scale,
      title: t('terms.overview.limitations.title'),
      content: t('terms.overview.limitations.description')
    }
  ];

  return (
    <div className="min-h-screen bg-slate-900 text-white">
      <SEO
        title={t('terms.seo.title')}
        description={t('terms.seo.description')}
        keywords={t('terms.seo.keywords')}
        ogTitle={t('terms.seo.ogTitle')}
        ogDescription={t('terms.seo.ogDescription')}
        ogUrl={currentUrl}
        ogType="website"
      />
      {/* Header */}
      <header className="border-b border-slate-800">
        <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
          <div className="flex items-center justify-between h-16">
            <div className="flex items-center gap-3">
              <img src="/uploads/e0ddbf09-622c-426a-851f-149776e300c0.png" alt="ShopCall.ai" className="w-8 h-8" />
              <span className="text-xl font-bold text-white">ShopCall.ai</span>
            </div>
            <Button variant="outline" className="border-slate-600 text-slate-300 hover:bg-slate-800" asChild>
              <a href="/">{t('terms.backHome')}</a>
            </Button>
          </div>
        </div>
      </header>

      {/* Hero Section */}
      <section className="py-20">
        <div className="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8">
          <div className="text-center mb-12">
            <h1 className="text-5xl font-bold mb-6">{t('terms.title')}</h1>
            <p className="text-xl text-slate-300">
              {t('terms.lastUpdated')}
            </p>
          </div>

          {/* Overview Cards */}
          <div className="grid md:grid-cols-2 lg:grid-cols-4 gap-6 mb-16">
            {sections.map((section, index) => (
              <Card key={index} className="bg-slate-700/50 border-slate-600 text-center">
                <CardHeader>
                  <div className="w-12 h-12 bg-[#52b3d0]/20 rounded-lg flex items-center justify-center mb-4 mx-auto">
                    <section.icon className="h-6 w-6 text-[#52b3d0]" />
                  </div>
                  <CardTitle className="text-white text-lg">{section.title}</CardTitle>
                </CardHeader>
                <CardContent>
                  <p className="text-slate-300 text-sm">{section.content}</p>
                </CardContent>
              </Card>
            ))}
          </div>

          {/* Terms Content */}
          <div className="space-y-8">
            <Card className="bg-slate-800/50 border-slate-700">
              <CardHeader>
                <CardTitle className="text-white text-xl">{t('terms.sections.termsSection.title')}</CardTitle>
              </CardHeader>
              <CardContent className="text-slate-300 space-y-4">
                <p>{t('terms.sections.termsSection.paragraph1')}</p>
                <p>{t('terms.sections.termsSection.paragraph2')}</p>
              </CardContent>
            </Card>

            <Card className="bg-slate-800/50 border-slate-700">
              <CardHeader>
                <CardTitle className="text-white text-xl">{t('terms.sections.useLicense.title')}</CardTitle>
              </CardHeader>
              <CardContent className="text-slate-300 space-y-4">
                <p>{t('terms.sections.useLicense.intro')}</p>
                <ul className="list-disc list-inside space-y-2 ml-4">
                  <li>{t('terms.sections.useLicense.items.modify')}</li>
                  <li>{t('terms.sections.useLicense.items.commercial')}</li>
                  <li>{t('terms.sections.useLicense.items.decompile')}</li>
                  <li>{t('terms.sections.useLicense.items.remove')}</li>
                </ul>
                <p>{t('terms.sections.useLicense.termination')}</p>
              </CardContent>
            </Card>

            <Card className="bg-slate-800/50 border-slate-700">
              <CardHeader>
                <CardTitle className="text-white text-xl">{t('terms.sections.serviceTerms.title')}</CardTitle>
              </CardHeader>
              <CardContent className="text-slate-300 space-y-4">
                <p>{t('terms.sections.serviceTerms.intro')}</p>
                <ul className="list-disc list-inside space-y-2 ml-4">
                  <li>{t('terms.sections.serviceTerms.items.accurate')}</li>
                  <li>{t('terms.sections.serviceTerms.items.legitimate')}</li>
                  <li>{t('terms.sections.serviceTerms.items.comply')}</li>
                  <li>{t('terms.sections.serviceTerms.items.noHarass')}</li>
                  <li>{t('terms.sections.serviceTerms.items.pay')}</li>
                </ul>
              </CardContent>
            </Card>

            <Card className="bg-slate-800/50 border-slate-700">
              <CardHeader>
                <CardTitle className="text-white text-xl">{t('terms.sections.payment.title')}</CardTitle>
              </CardHeader>
              <CardContent className="text-slate-300 space-y-4">
                <p>{t('terms.sections.payment.intro')}</p>
                <ul className="list-disc list-inside space-y-2 ml-4">
                  <li>{t('terms.sections.payment.items.secure')}</li>
                  <li>{t('terms.sections.payment.items.advance')}</li>
                  <li>{t('terms.sections.payment.items.usage')}</li>
                  <li>{t('terms.sections.payment.items.nonRefundable')}</li>
                  <li>{t('terms.sections.payment.items.pricing')}</li>
                </ul>
              </CardContent>
            </Card>

            <Card className="bg-slate-800/50 border-slate-700">
              <CardHeader>
                <CardTitle className="text-white text-xl">{t('terms.sections.disclaimerSection.title')}</CardTitle>
              </CardHeader>
              <CardContent className="text-slate-300 space-y-4">
                <p>{t('terms.sections.disclaimerSection.paragraph1')}</p>
                <p>{t('terms.sections.disclaimerSection.paragraph2')}</p>
              </CardContent>
            </Card>

            <Card className="bg-slate-800/50 border-slate-700">
              <CardHeader>
                <CardTitle className="text-white text-xl">{t('terms.sections.limitationsSection.title')}</CardTitle>
              </CardHeader>
              <CardContent className="text-slate-300 space-y-4">
                <p>{t('terms.sections.limitationsSection.paragraph1')}</p>
                <p>{t('terms.sections.limitationsSection.paragraph2')}</p>
              </CardContent>
            </Card>

            <Card className="bg-slate-800/50 border-slate-700">
              <CardHeader>
                <CardTitle className="text-white text-xl">{t('terms.sections.governingLaw.title')}</CardTitle>
              </CardHeader>
              <CardContent className="text-slate-300 space-y-4">
                <p>{t('terms.sections.governingLaw.content')}</p>
              </CardContent>
            </Card>

            <Card className="bg-slate-800/50 border-slate-700">
              <CardHeader>
                <CardTitle className="text-white text-xl">{t('terms.sections.contactInfo.title')}</CardTitle>
              </CardHeader>
              <CardContent className="text-slate-300">
                <p>{t('terms.sections.contactInfo.intro')}</p>
                <div className="mt-4 space-y-2">
                  <p>{t('terms.sections.contactInfo.email')}</p>
                  <p>{t('terms.sections.contactInfo.company')}</p>
                  <p>{t('terms.sections.contactInfo.address')}</p>
                  <p>{t('terms.sections.contactInfo.phone')}</p>
                </div>
              </CardContent>
            </Card>
          </div>
        </div>
      </section>

      {/* Footer */}
      <footer className="bg-slate-900 border-t border-slate-800 py-8">
        <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
          <div className="flex justify-center items-center gap-4 text-sm text-slate-500">
            <span>{t('terms.footer.copyright')}</span>
            <span>•</span>
            <a href="/privacy" className="hover:text-slate-300">{t('terms.footer.privacy')}</a>
            <span>•</span>
            <a href="/contact" className="hover:text-slate-300">{t('terms.footer.contact')}</a>
          </div>
        </div>
      </footer>
    </div>
  );
};

export default Terms;
