import { useTranslation } from "react-i18next";
import { ArrowRight, CheckCircle2 } from "lucide-react";
import { Layout } from "@/components/layout/Layout";
import { Section, SectionHeader } from "@/components/ui/Section";
import { RelatedCases } from "@/components/RelatedCases";
import { SEO } from "@/components/SEO";
import { useForceLanguage } from "@/hooks/useForceLanguage";
import holospinImage from "@/assets/solutions/holospin-display.png";
import holospinStandardImage from "@/assets/solutions/holospin-standard.jpg";
import holospinLargeImage from "@/assets/solutions/holospin-large.jpg";
import holospinModularImage from "@/assets/solutions/holospin-modular.jpg";
import holospinRetailImage from "@/assets/solutions/holospin-retail.jpg";
import holospinAngelAwardsImage from "@/assets/solutions/holospin-angel-awards.png";
import holospinWatchImage from "@/assets/solutions/holospin-hologram-watch.jpg";

interface SolutionHoloSpinProps { forceLang?: "sv" | "en"; seoOverride?: React.ReactNode; }

export default function SolutionHoloSpin({ forceLang, seoOverride }: SolutionHoloSpinProps) {
  const { t } = useTranslation();
  useForceLanguage(forceLang);

  const quickFacts = [
    t("holospin.quickFacts.diameters"), t("holospin.quickFacts.resolution"),
    t("holospin.quickFacts.brightness"), t("holospin.quickFacts.serial"),
    t("holospin.quickFacts.wifi"), t("holospin.quickFacts.portable"),
  ];

  const useCases = [
    { environment: t("holospin.useCases.tradeShows.title"), description: t("holospin.useCases.tradeShows.description") },
    { environment: t("holospin.useCases.retail.title"), description: t("holospin.useCases.retail.description") },
    { environment: t("holospin.useCases.brandActivations.title"), description: t("holospin.useCases.brandActivations.description") },
    { environment: t("holospin.useCases.productLaunches.title"), description: t("holospin.useCases.productLaunches.description") },
    { environment: t("holospin.useCases.showrooms.title"), description: t("holospin.useCases.showrooms.description") },
    { environment: t("holospin.useCases.publicSpaces.title"), description: t("holospin.useCases.publicSpaces.description") },
  ];

  const benefits = [
    { title: t("holospin.benefits.attention.title"), description: t("holospin.benefits.attention.description") },
    { title: t("holospin.benefits.portable.title"), description: t("holospin.benefits.portable.description") },
    { title: t("holospin.benefits.scalable.title"), description: t("holospin.benefits.scalable.description") },
    { title: t("holospin.benefits.visibility.title"), description: t("holospin.benefits.visibility.description") },
  ];

  const specifications = [
    { title: t("holospin.specs.standard.title"), image: holospinStandardImage, specs: t("holospin.specs.standard.specs", { returnObjects: true }) as string[] },
    { title: t("holospin.specs.large.title"), image: holospinLargeImage, specs: t("holospin.specs.large.specs", { returnObjects: true }) as string[] },
    { title: t("holospin.specs.modular.title"), image: holospinModularImage, specs: t("holospin.specs.modular.specs", { returnObjects: true }) as string[] },
  ];

  const faqs = [
    { question: t("holospin.faqs.howWorks.question"), answer: t("holospin.faqs.howWorks.answer") },
    { question: t("holospin.faqs.safety.question"), answer: t("holospin.faqs.safety.answer") },
    { question: t("holospin.faqs.connected.question"), answer: t("holospin.faqs.connected.answer") },
    { question: t("holospin.faqs.content.question"), answer: t("holospin.faqs.content.answer") },
    { question: t("holospin.faqs.continuous.question"), answer: t("holospin.faqs.continuous.answer") },
  ];

  const pageTitle = t("holospin.metaTitle", { defaultValue: `${t("holospin.title")} | Suteki Studios` });
  const pageDescription = t("holospin.metaDescription", { defaultValue: t("holospin.intro") });

  return (
    <Layout>
      {seoOverride || (
        <SEO
          title="HoloSpin – Roterande hologramdisplay | Suteki Studios"
          description="HoloSpin skapar svävande 3D-hologram med LED-fläktar. Fångande produktpresentationer för event, mässor och butiker."
          lang="sv"
          canonicalUrl="https://sutekistudios.com/holospin"
          alternateSv="https://sutekistudios.com/holospin"
          alternateEn="https://sutekistudios.com/en/holospin"
        />
      )}

      {/* ═══ HERO ═══ */}
      <section className="min-h-[85vh] flex items-end relative overflow-hidden" data-hero="true">
        <div className="absolute inset-0">
          <img src={holospinImage} alt="HoloSpin rotating hologram display" className="absolute inset-0 w-full h-full object-cover" />
        </div>
        <div className="absolute inset-0" style={{ background: 'linear-gradient(to top, rgba(8,12,20,0.95) 0%, rgba(8,12,20,0.50) 40%, rgba(8,12,20,0.25) 100%)' }} />
        <div className="container mx-auto px-6 lg:px-8 relative z-10 pb-20 pt-40">
          <div className="max-w-3xl">
            <p className="hero-eyebrow mb-5 animate-fade-up">{t("holospin.eyebrow")}</p>
            <h1 className="display mb-6 animate-fade-up" style={{ color: '#FFFFFF' }}>{t("holospin.title")}</h1>
            {t("holospin.productIntro") && t("holospin.productIntro") !== "holospin.productIntro" && (
              <p className="text-xl font-medium mb-4 animate-fade-up-delay-1" style={{ color: '#E2E8F0' }}>{t("holospin.productIntro")}</p>
            )}
            <p className="text-lg md:text-xl mb-10 leading-relaxed animate-fade-up-delay-1" style={{ color: '#CBD5E1' }}>{t("holospin.intro")}</p>
            <a href="https://calendly.com/sutekistudios/strategic-project-discussion" target="_blank" rel="noopener noreferrer" className="btn-white inline-flex items-center gap-2 animate-fade-up-delay-2">
              {t("holospin.cta")} <ArrowRight className="h-4 w-4" style={{ color: '#0B1220' }} />
            </a>
          </div>
        </div>
      </section>

      {/* ═══ QUICK FACTS ═══ */}
      <Section className="section-white">
        <SectionHeader eyebrow="Specifikationer" title={t("holospin.quickFacts.title")} />
        <ul className="grid md:grid-cols-2 gap-4 max-w-4xl">
          {quickFacts.map((fact, i) => (
            <li key={i} className="enterprise-card p-5 flex items-start gap-3">
              <CheckCircle2 className="h-5 w-5 flex-shrink-0 mt-0.5" style={{ color: '#2563EB' }} />
              <span className="text-muted-foreground leading-relaxed">{fact}</span>
            </li>
          ))}
        </ul>
      </Section>

      {/* ═══ IN ACTION — Visual proof ═══ */}
      <Section className="section-beige">
        <SectionHeader title={t("holospin.inAction.title")} subtitle={t("holospin.inAction.description")} />
        <div className="grid md:grid-cols-3 gap-6">
          <div className="aspect-video rounded-2xl overflow-hidden image-card">
            <img src={holospinRetailImage} alt="HoloSpin in retail window display" className="w-full h-full object-cover" loading="lazy" />
          </div>
          <div className="aspect-video rounded-2xl overflow-hidden border border-border/30">
            <iframe src="https://www.youtube.com/embed/CVJO6tky1Gg?autoplay=0&loop=1&muted=1&rel=0&modestbranding=1&playsinline=1" className="w-full h-full" allow="autoplay; fullscreen; picture-in-picture; encrypted-media" allowFullScreen title="HoloSpin demo" />
          </div>
          <div className="aspect-video rounded-2xl overflow-hidden border border-border/30">
            <iframe src="https://www.youtube.com/embed/NZFDXN9cvvQ?autoplay=0&loop=1&muted=1&rel=0&modestbranding=1&playsinline=1" className="w-full h-full" allow="autoplay; fullscreen; picture-in-picture; encrypted-media" allowFullScreen title="HoloSpin demo" />
          </div>
          <div className="aspect-video rounded-2xl overflow-hidden border border-border/30">
            <iframe src="https://www.youtube.com/embed/iLhs3mbfZKw?autoplay=0&mute=1&loop=1&playlist=iLhs3mbfZKw&rel=0&modestbranding=1&playsinline=1" className="w-full h-full" allow="autoplay; fullscreen; picture-in-picture; encrypted-media" allowFullScreen title="HoloSpin demo" />
          </div>
          <div className="aspect-video rounded-2xl overflow-hidden image-card">
            <img src={holospinAngelAwardsImage} alt="HoloSpin at Angel Awards Stockholm" className="w-full h-full object-cover" loading="lazy" />
          </div>
          <div className="aspect-video rounded-2xl overflow-hidden image-card">
            <img src={holospinWatchImage} alt="HoloSpin hologram display showing a luxury watch" className="w-full h-full object-cover" loading="lazy" width={1536} height={1024} />
          </div>
        </div>
      </Section>

      {/* ═══ SPECS — Product variants ═══ */}
      <Section className="section-white">
        <SectionHeader eyebrow="Produkter" title={t("holospin.specs.title")} />
        <div className="grid md:grid-cols-3 gap-6">
          {specifications.map((spec, i) => (
            <div key={i} className="enterprise-card overflow-hidden">
              <div className="aspect-video">
                <img src={spec.image} alt={`${spec.title} HoloSpin`} className="w-full h-full object-cover" loading="lazy" />
              </div>
              <div className="p-6">
                <h3 className="font-semibold mb-4 text-foreground">{spec.title}</h3>
                <ul className="space-y-2">
                  {spec.specs.map((item, idx) => (
                    <li key={idx} className="flex items-start gap-2">
                      <CheckCircle2 className="h-4 w-4 flex-shrink-0 mt-0.5" style={{ color: '#2563EB' }} />
                      <span className="text-muted-foreground text-sm leading-relaxed">{item}</span>
                    </li>
                  ))}
                </ul>
              </div>
            </div>
          ))}
        </div>
      </Section>

      {/* ═══ USE CASES ═══ */}
      <section className="relative overflow-hidden" data-theme="dark">
        <div className="absolute inset-0" style={{ background: 'hsl(222 57% 10%)' }} />
        <div className="container mx-auto px-6 lg:px-8 relative z-10 py-[var(--space-section)]">
          <SectionHeader title={t("holospin.useCases.title")} tone="dark" />
          <div className="grid md:grid-cols-3 gap-5">
            {useCases.map((uc, i) => (
              <div key={i} className="dark-card p-7">
                <h3 className="font-semibold mb-2">{uc.environment}</h3>
                <p className="text-[15px] leading-relaxed" style={{ color: 'rgba(226,232,240,0.75)' }}>{uc.description}</p>
              </div>
            ))}
          </div>
        </div>
      </section>

      {/* ═══ BENEFITS ═══ */}
      <Section className="section-beige">
        <SectionHeader title={t("holospin.benefits.title")} />
        <div className="grid md:grid-cols-2 gap-6">
          {benefits.map((b, i) => (
            <div key={i} className="enterprise-card p-7">
              <h3 className="font-semibold mb-2 text-foreground">{b.title}</h3>
              <p className="text-muted-foreground text-[15px] leading-relaxed">{b.description}</p>
            </div>
          ))}
        </div>
      </Section>

      {/* ═══ FAQ ═══ */}
      <Section className="section-white">
        <SectionHeader eyebrow="FAQ" title={t("holospin.faqs.title")} />
        <div className="space-y-4 max-w-4xl">
          {faqs.map((faq, i) => (
            <div key={i} className="enterprise-card p-7">
              <h3 className="font-semibold mb-2 text-foreground">{faq.question}</h3>
              <p className="text-muted-foreground text-[15px] leading-relaxed">{faq.answer}</p>
            </div>
          ))}
        </div>
      </Section>

      {/* Bottom Note */}
      {t("holospin.bottomNote") && t("holospin.bottomNote") !== "holospin.bottomNote" && (
        <Section className="section-beige" narrow>
          <p className="text-muted-foreground leading-relaxed">{t("holospin.bottomNote")}</p>
        </Section>
      )}

      <RelatedCases category="HoloSpin" maxCases={3} />

      {/* ═══ CTA ═══ */}
      <Section className="section-white">
        <div className="max-w-2xl mx-auto text-center">
          <h2 className="mb-4 text-foreground">{t("holospin.ctaSection.title")}</h2>
          <p className="text-muted-foreground mb-8 leading-relaxed">{t("holospin.ctaSection.description")}</p>
          <a href="https://calendly.com/sutekistudios/strategic-project-discussion" target="_blank" rel="noopener noreferrer" className="btn-primary inline-flex items-center gap-2">
            {t("holospin.ctaSection.button")}
          </a>
        </div>
      </Section>
    </Layout>
  );
}
