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 holonetSharkImage from "@/assets/solutions/holomesh-shark.jpg";
import holonetVideo from "@/assets/solutions/holonet-suteki-studios.mp4";
import holoboxHolonetVideo from "@/assets/solutions/holobox-holonet.mp4";
import holonetInstallation from "@/assets/solutions/holonet-installation.webp";
import holonetInstallation2 from "@/assets/solutions/holonet-installation2.jpeg";

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

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

  const quickFacts = [
    t("holonet.quickFacts.largeScale"), t("holonet.quickFacts.floating"),
    t("holonet.quickFacts.flexible"), t("holonet.quickFacts.visibility"),
    t("holonet.quickFacts.transparent"), t("holonet.quickFacts.custom"),
  ];

  const useCases = [
    { environment: t("holonet.useCases.productLaunches.title"), description: t("holonet.useCases.productLaunches.description") },
    { environment: t("holonet.useCases.liveEvents.title"), description: t("holonet.useCases.liveEvents.description") },
    { environment: t("holonet.useCases.cultural.title"), description: t("holonet.useCases.cultural.description") },
    { environment: t("holonet.useCases.publicSpaces.title"), description: t("holonet.useCases.publicSpaces.description") },
  ];

  const benefits = [
    { title: t("holonet.benefits.scale.title"), description: t("holonet.benefits.scale.description") },
    { title: t("holonet.benefits.invisible.title"), description: t("holonet.benefits.invisible.description") },
    { title: t("holonet.benefits.flexible.title"), description: t("holonet.benefits.flexible.description") },
    { title: t("holonet.benefits.multiAngle.title"), description: t("holonet.benefits.multiAngle.description") },
  ];

  const faqs = [
    { question: t("holonet.faqs.howWorks.question"), answer: t("holonet.faqs.howWorks.answer") },
    { question: t("holonet.faqs.outdoor.question"), answer: t("holonet.faqs.outdoor.answer") },
    { question: t("holonet.faqs.content.question"), answer: t("holonet.faqs.content.answer") },
    { question: t("holonet.faqs.size.question"), answer: t("holonet.faqs.size.answer") },
    { question: t("holonet.faqs.permanent.question"), answer: t("holonet.faqs.permanent.answer") },
  ];

  return (
    <Layout>
      {seoOverride || (
        <SEO
          title="HoloNet™ – Holografiskt nät för arenor och scener | Suteki Studios"
          description="HoloNet™ ersätter traditionella skyddsnät med ett holografiskt nät som visar reklam och spektakulära visuella effekter under live-event."
          lang="sv"
          canonicalUrl="https://sutekistudios.com/holonet"
          alternateSv="https://sutekistudios.com/holonet"
          alternateEn="https://sutekistudios.com/en/holonet"
        />
      )}

      {/* ═══ HERO ═══ */}
      <section className="min-h-[85vh] flex items-end relative overflow-hidden" data-hero="true">
        <div className="absolute inset-0">
          <img src={holonetSharkImage} alt="Floating hologram shark with HoloNet technology" 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("holonet.eyebrow")}</p>
            <h1 className="display mb-6 animate-fade-up" style={{ color: '#FFFFFF' }}>{t("holonet.title")}</h1>
            <p className="text-lg md:text-xl mb-10 leading-relaxed animate-fade-up-delay-1" style={{ color: '#CBD5E1' }}>{t("holonet.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("holonet.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("holonet.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 ═══ */}
      <Section className="section-beige">
        <SectionHeader title={t("holonet.inAction.title")} subtitle={t("holonet.inAction.intro")} />
        <p className="text-muted-foreground leading-relaxed mb-8 max-w-2xl">{t("holonet.inAction.description")}</p>
        <div className="grid md:grid-cols-3 gap-6">
          <div className="aspect-video rounded-2xl overflow-hidden image-card">
            <img src={holonetSharkImage} alt="HoloNet shark hologram" className="w-full h-full object-cover" loading="lazy" />
          </div>
          <div className="aspect-video rounded-2xl overflow-hidden image-card">
            <video src={holonetVideo} autoPlay loop muted playsInline className="w-full h-full object-cover" />
          </div>
          <div className="aspect-video rounded-2xl overflow-hidden image-card">
            <video src={holoboxHolonetVideo} autoPlay loop muted playsInline className="w-full h-full object-cover" />
          </div>
          <div className="aspect-video rounded-2xl overflow-hidden border border-border/30">
            <iframe src="https://www.youtube.com/embed/84qEL2UQNiM?autoplay=0&loop=1&muted=1&rel=0&modestbranding=1&playsinline=1" className="w-full h-full" allow="autoplay; fullscreen; encrypted-media" title="HoloNet demonstration" />
          </div>
          <div className="aspect-video rounded-2xl overflow-hidden image-card">
            <img src={holonetInstallation} alt="HoloNet large-scale installation" className="w-full h-full object-cover" loading="lazy" />
          </div>
          <div className="aspect-video rounded-2xl overflow-hidden image-card">
            <img src={holonetInstallation2} alt="HoloNet transparent mesh on stage" className="w-full h-full object-cover" loading="lazy" />
          </div>
        </div>
      </Section>

      {/* ═══ MESH TECHNOLOGY ═══ */}
      <Section className="section-white" narrow>
        <SectionHeader eyebrow="Teknologi" title={t("holonet.mesh.title")} />
        <div className="space-y-4">
          <p className="text-muted-foreground leading-relaxed">{t("holonet.mesh.p1")}</p>
          <p className="text-muted-foreground leading-relaxed">{t("holonet.mesh.p2")}</p>
          <p className="text-muted-foreground leading-relaxed">{t("holonet.mesh.contentNote")}</p>
        </div>
      </Section>

      {/* ═══ USE CASES ═══ */}
      <Section className="section-beige">
        <SectionHeader title={t("holonet.useCases.title")} subtitle={t("holonet.useCases.intro")} />
        <div className="grid md:grid-cols-2 gap-5">
          {useCases.map((uc, i) => (
            <div key={i} className="enterprise-card p-7">
              <h3 className="font-semibold mb-2 text-foreground">{uc.environment}</h3>
              <p className="text-muted-foreground text-[15px] leading-relaxed">{uc.description}</p>
            </div>
          ))}
        </div>
      </Section>

      {/* ═══ BENEFITS ═══ */}
      <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("holonet.benefits.title")} subtitle={t("holonet.benefits.intro")} tone="dark" />
          <div className="grid md:grid-cols-2 gap-6">
            {benefits.map((b, i) => (
              <div key={i} className="dark-card p-7">
                <h3 className="font-semibold mb-2">{b.title}</h3>
                <p className="text-[15px] leading-relaxed" style={{ color: 'rgba(226,232,240,0.75)' }}>{b.description}</p>
              </div>
            ))}
          </div>
        </div>
      </section>

      {/* ═══ FAQ ═══ */}
      <Section className="section-white">
        <SectionHeader eyebrow="FAQ" title={t("holonet.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>

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

      {/* ═══ CTA ═══ */}
      <Section className="section-beige">
        <div className="max-w-2xl mx-auto text-center">
          <h2 className="mb-4 text-foreground">{t("holonet.ctaSection.title")}</h2>
          <p className="text-muted-foreground mb-4 leading-relaxed">{t("holonet.ctaSection.description")}</p>
          <p className="text-sm text-muted-foreground/70 mb-8">{t("holonet.ctaSection.meetingIntent")}</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("holonet.ctaSection.button")}
          </a>
        </div>
      </Section>
    </Layout>
  );
}
