import { Link } from "wouter";
import Layout from "@/components/Layout";
import SEOHead from "@/components/SEOHead";
import PageHero from "@/components/PageHero";
import CTABanner from "@/components/CTABanner";
import { ArrowRight, ExternalLink, Tractor, Factory, Wheat, HardHat, Truck } from "lucide-react";
import { useLanguage } from "@/contexts/LanguageContext";

const MACHINERY_IMG = "/images/machinery-section.jpg";

const SCHAEFFER_IMG = "/images/iycCkdFLHqpIKbtJ.jpg";
const BVL_IMG = "/images/MAlBAGjVUbpKMmWd.png";

export default function IndustryMachinery() {
  const { t, lang } = useLanguage();

  const partners = [
    {
      name: "Schaeffer Maschinenfabrik GmbH",
      country: lang === "ar" ? "ألمانيا" : "Germany",
      website: "https://www.schaeffer.de/en/",
      icon: Tractor,
      specialty: lang === "ar" ? "لوادر مدمجة وتلسكوبية بعجلات" : "Compact & Telescopic Wheeled Loaders",
      image: SCHAEFFER_IMG,
      desc: lang === "ar"
        ? "تأسست عام 1956 على يد هاينريش شيفر في إرفيته، ألمانيا. شيفر ماشيننفابريك هي شركة أوروبية رائدة في تصنيع اللوادر المدمجة والتلسكوبية ذات العجلات بنظام التوجيه المحوري. مع أكثر من 480 موظفاً، تنتج شيفر مجموعة شاملة من اللوادر المصممة للزراعة وتربية الأبقار والبناء وتنسيق الحدائق والخدمات البلدية والتطبيقات الصناعية. في عام 2017، قدمت 23e — أول لودر ساحة كهربائي في العالم ببطارية ليثيوم أيون."
        : "Founded in 1956 by Heinrich Schäffer in Erwitte, Germany, Schaeffer Maschinenfabrik is a leading European manufacturer of pivot-steer compact and telescopic wheeled loaders. With over 480 employees, Schaeffer produces a comprehensive range of loaders designed for agriculture, dairy farming, construction, landscaping, municipal services, and industrial applications. In 2017, they introduced the 23e — the world's first electric yard loader with a lithium-ion battery — demonstrating their commitment to innovation and sustainability.",
      products: lang === "ar"
        ? ["لوادر مدمجة بعجلات — من 1.5 إلى 11 طن وزن تشغيل", "لوادر تلسكوبية بعجلات — لتطبيقات الوصول الممتد", "لوادر ساحة كهربائية (23e) — تشغيل بدون انبعاثات للبيئات الداخلية والحساسة", "مجموعة واسعة من الملحقات — دلاء وشوكات ومقابض وكناسات والمزيد"]
        : ["Compact wheeled loaders — from 1.5 to 11 tons operating weight", "Telescopic wheeled loaders — for extended reach applications", "Electric yard loaders (23e) — zero-emission operation for indoor and sensitive environments", "Wide range of attachments — buckets, forks, grabs, sweepers, and more"],
      audiences: [
        { icon: Wheat, label: lang === "ar" ? "مزارع الألبان" : "Dairy Farms" },
        { icon: HardHat, label: lang === "ar" ? "شركات البناء" : "Construction Companies" },
        { icon: Truck, label: lang === "ar" ? "شركات تنسيق الحدائق" : "Landscaping Businesses" },
        { icon: Factory, label: lang === "ar" ? "الخدمات البلدية" : "Municipal Services" },
      ],
    },
    {
      name: "BvL Maschinenfabrik GmbH & Co. KG",
      country: lang === "ar" ? "ألمانيا" : "Germany",
      website: "https://www.bvl-farmtechnology.com/en/",
      icon: Wheat,
      specialty: lang === "ar" ? "تقنيات التغذية والفراش" : "Feeding & Bedding Technology",
      image: BVL_IMG,
      desc: lang === "ar"
        ? "تأسست عام 1860 على يد غيرهارد فان لينغريش كورشة حدادة وعربات في إمسبورن، ألمانيا. BvL الآن شركة عائلية من الجيل الخامس. حاصلة على شهادة DIN ISO 9001 منذ 2009، وهي من الشركات الأوروبية الرائدة في تصنيع تقنيات التغذية لمزارع الألبان والماشية. تصمم وتصنع عربات خلط الأعلاف ونافخات القش ووحدات الفراش وقاطعات كتل الصوامع وأنظمة إدارة الأعلاف الكاملة."
        : "Established in 1860 by Gerhard van Lengerich as a blacksmith and wagon workshop in Emsbüren, Germany, BvL is now a 5th-generation family business led by Bernard van Lengerich and Bernhard Sievering. DIN ISO 9001 certified since 2009, BvL is one of Europe's leading manufacturers of feeding technology for dairy and livestock farms. They design and manufacture fodder mixer wagons, straw blowers, bedding units, silo block cutters, and complete feed management systems that help farmers optimize feed efficiency, reduce waste, and improve animal health.",
      products: lang === "ar"
        ? ["عربات خلط الأعلاف سلسلة V-MIX — خلط عمودي لتحضير الحصص بدقة", "نافخات القش — لتوزيع القش بكفاءة في الحظائر", "وحدات الفراش — أنظمة فراش آلية للألبان والماشية", "قاطعات كتل الصوامع — لإزالة السيلاج من صوامع المشابك", "أنظمة إدارة الأعلاف — حلول رقمية لتتبع الأعلاف وتحسينها"]
        : ["V-MIX series fodder mixer wagons — vertical mixing for precise ration preparation", "Straw blowers — for efficient straw distribution in barns", "Bedding units — automated bedding systems for dairy and livestock", "Silo block cutters — for silage removal from clamp silos", "Feed management systems — digital solutions for feed tracking and optimization"],
      audiences: [
        { icon: Wheat, label: lang === "ar" ? "مزارع الألبان" : "Dairy Farms" },
        { icon: Wheat, label: lang === "ar" ? "مزارع الماشية" : "Livestock Farms" },
        { icon: Factory, label: lang === "ar" ? "الأعمال الزراعية" : "Agricultural Businesses" },
      ],
    },
  ];

  return (
    <Layout>
      <SEOHead
        title="Loaders for Construction UAE | Dairy Farm Equipment | Alzar FZE"
        description="Alzar FZE is the authorized dealer for Schaeffer compact loaders and BvL dairy feeding technology in UAE, Saudi Arabia, and the GCC. Loaders for construction, farms, and landscaping."
        canonical="https://www.alzarfze.com/industries/machinery"
        keywords="loaders for construction UAE, Schaeffer loaders UAE dealer, compact loaders Dubai, wheeled loaders construction UAE, loaders for sale UAE, construction equipment Dubai, dairy farm equipment UAE, BvL feeding technology Middle East, fodder mixer wagon GCC, dairy feeding systems UAE, TMR mixer UAE, farm machinery Dubai, compact loader Saudi Arabia, landscaping loaders UAE, agricultural equipment GCC, Schaeffer loader dealer Middle East"
        breadcrumbs={[
          { name: "Home", url: "https://www.alzarfze.com" },
          { name: "Industries", url: "https://www.alzarfze.com" },
          { name: "Machinery", url: "https://www.alzarfze.com/industries/machinery" },
        ]}
      />

      <PageHero
        title={t("machinery.heroTitle")}
        subtitle={t("machinery.heroSubtitle")}
        bgImage={MACHINERY_IMG}
        breadcrumbs={[{ label: t("common.home"), href: "/" }, { label: t("common.industries") }, { label: t("nav.machinery") }]}
      />

      {/* Product Image Gallery */}
      <section className="py-12 bg-warm-white">
        <div className="container">
          <div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
            <div className="relative rounded-xl overflow-hidden aspect-[4/3] group">
              <img src={SCHAEFFER_IMG} alt="Schaeffer compact wheeled loader in agricultural use" className="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500" loading="lazy" />
              <div className="absolute inset-0 bg-gradient-to-t from-navy/80 to-transparent flex items-end p-5">
                <div>
                  <span className="text-white font-heading font-bold text-lg">{lang === "ar" ? "لوادر شيفر" : "Schaeffer Loaders"}</span>
                  <p className="text-white/70 text-sm mt-1">{lang === "ar" ? "لوادر مدمجة وتلسكوبية بعجلات" : "Compact & telescopic wheeled loaders"}</p>
                </div>
              </div>
            </div>
            <div className="relative rounded-xl overflow-hidden aspect-[4/3] group">
              <img src={BVL_IMG} alt="BvL V-MIX fodder mixer wagon for dairy farms" className="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500" loading="lazy" />
              <div className="absolute inset-0 bg-gradient-to-t from-navy/80 to-transparent flex items-end p-5">
                <div>
                  <span className="text-white font-heading font-bold text-lg">{lang === "ar" ? "سلسلة BvL V-MIX" : "BvL V-MIX Series"}</span>
                  <p className="text-white/70 text-sm mt-1">{lang === "ar" ? "تقنيات التغذية والفراش" : "Feeding & bedding technology"}</p>
                </div>
              </div>
            </div>
          </div>
        </div>
      </section>

      {/* Partners */}
      <section className="py-16 lg:py-24">
        <div className="container">
          <div className="space-y-16">
            {partners.map((p, i) => (
              <div key={i} className="scroll-mt-24" id={p.name.toLowerCase().replace(/\s+/g, "-")}>
                <div className="bg-white rounded-xl border border-navy/5 shadow-sm overflow-hidden">
                  {/* Header */}
                  <div className="bg-navy p-6 lg:p-8">
                    <div className="flex flex-col lg:flex-row lg:items-center gap-4 lg:gap-6">
                      <div className="p-3 bg-teal/20 rounded-lg w-fit">
                        <p.icon className="w-8 h-8 text-teal" />
                      </div>
                      <div className="flex-1">
                        <div className="flex flex-wrap items-center gap-3 mb-1">
                          <h2 className="font-heading font-bold text-2xl text-white" dir="ltr">{p.name}</h2>
                          <span className="text-xs bg-white/10 text-white/70 px-2.5 py-1 rounded-full">{p.country}</span>
                        </div>
                        <div className="text-teal font-medium">{p.specialty}</div>
                      </div>
                      <a
                        href={p.website}
                        target="_blank"
                        rel="noopener noreferrer"
                        className="inline-flex items-center gap-1.5 text-sm text-white/70 hover:text-teal font-medium transition-colors shrink-0"
                      >
                        {lang === "ar" ? "زيارة الموقع" : "Visit Website"} <ExternalLink className="w-3.5 h-3.5" />
                      </a>
                    </div>
                  </div>

                  {/* Content */}
                  <div className="p-6 lg:p-8">
                    <p className="text-slate-dark/80 leading-relaxed mb-6">{p.desc}</p>

                    <h3 className="font-heading font-semibold text-lg text-navy mb-3">{lang === "ar" ? "المنتجات والحلول" : "Products & Solutions"}</h3>
                    <ul className="space-y-2 mb-6">
                      {p.products.map((prod, j) => (
                        <li key={j} className="flex items-start gap-2 text-sm text-slate-dark/75">
                          <span className="w-1.5 h-1.5 bg-teal rounded-full mt-2 shrink-0" />
                          {prod}
                        </li>
                      ))}
                    </ul>

                    <h3 className="font-heading font-semibold text-lg text-navy mb-3">{lang === "ar" ? "من نخدم" : "Who This Serves"}</h3>
                    <div className="flex flex-wrap gap-3">
                      {p.audiences.map((a, j) => (
                        <div key={j} className="flex items-center gap-2 bg-teal/5 border border-teal/20 rounded-full px-4 py-2 text-sm text-navy/80">
                          <a.icon className="w-3.5 h-3.5 text-teal" />
                          {a.label}
                        </div>
                      ))}
                    </div>
                  </div>
                </div>
              </div>
            ))}
          </div>
        </div>
      </section>

      {/* CTA */}
      <section className="py-16 lg:py-20 bg-navy text-white">
        <div className="container text-center">
          <h2 className="font-heading font-bold text-3xl text-white mb-4">{t("machinery.ctaTitle")}</h2>
          <p className="text-white/60 max-w-2xl mx-auto mb-8">
            {t("machinery.ctaDesc")}
          </p>
          <Link href="/contact" className="inline-flex items-center gap-2 bg-teal hover:bg-teal-dark text-white font-semibold px-8 py-3.5 rounded-md transition-all group">
            {t("machinery.ctaButton")}
            <ArrowRight className="w-4 h-4 group-hover:translate-x-1 rtl:group-hover:-translate-x-1 transition-transform" />
          </Link>
        </div>
      </section>

      {/* FAQ Section for SEO */}
      <section className="py-16 lg:py-24 bg-warm-white">
        <div className="container">
          <div className="max-w-3xl mx-auto">
            <h2 className="font-heading font-bold text-3xl lg:text-4xl text-navy mb-8 text-center">
              {lang === "ar" ? "الأسئلة الشائعة" : "Frequently Asked Questions"}
            </h2>
            <div className="space-y-4">
              {(lang === "ar" ? [
                { q: "ما هي اللودرات المتوفرة للبناء في الإمارات؟", a: "توفر الزار مجموعة كاملة من لودرات شايفر المدمجة ذات العجلات للبناء في الإمارات. تشمل المجموعة موديلات متعددة بسعات تحميل مختلفة، مع ملحقات متنوعة للحفر والرفع والتنظيف والتسوية. نوفر الدعم الفني وقطع الغيار محلياً." },
                { q: "ما هي معدات مزارع الألبان المتوفرة؟", a: "نمثل شركة BvL الألمانية لتكنولوجيا التغذية في الإمارات والشرق الأوسط. تشمل المنتجات عربات خلط الأعلاف TMR وأنظمة تغذية الماشية ومعدات توزيع الأعلاف المؤتمتة." },
                { q: "هل توفرون خدمة ما بعد البيع للودرات شايفر؟", a: "نعم، بصفتنا الوكيل المعتمد، نوفر دعماً فنياً كاملاً وقطع غيار أصلية وخدمة صيانة لجميع موديلات لودرات شايفر في الإمارات ودول الخليج." },
              ] : [
                { q: "What loaders are available for construction in UAE?", a: "Alzar FZE supplies the full range of Schaeffer compact wheeled loaders for construction in the UAE. The range includes multiple models with varying load capacities, along with diverse attachments for digging, lifting, sweeping, and grading. We provide local technical support and genuine spare parts." },
                { q: "What dairy farm equipment does Alzar FZE offer?", a: "We represent BvL of Germany for feeding technology in the UAE and Middle East. Products include TMR (Total Mixed Ration) fodder mixer wagons, cattle feeding systems, and automated feed distribution equipment designed for modern dairy farm operations." },
                { q: "Do you provide after-sales service for Schaeffer loaders?", a: "Yes, as the authorized dealer, we provide full technical support, genuine spare parts, and maintenance service for all Schaeffer loader models across the UAE and GCC region." },
                { q: "Can Schaeffer loaders be used for landscaping?", a: "Absolutely. Schaeffer compact loaders are versatile machines ideal for landscaping projects. With attachments like pallet forks, buckets, sweepers, and augers, they can handle a wide range of landscaping tasks in tight spaces where larger equipment cannot operate." },
              ]).map((faq, i) => (
                <details key={i} className="group bg-white rounded-xl border border-navy/10 overflow-hidden">
                  <summary className="flex items-center justify-between p-5 cursor-pointer font-semibold text-navy hover:bg-navy/5 transition-colors">
                    {faq.q}
                    <ArrowRight className="w-4 h-4 text-teal transition-transform group-open:rotate-90 shrink-0 ltr:ml-4 rtl:mr-4" />
                  </summary>
                  <div className="px-5 pb-5 text-slate-dark/70 leading-relaxed">
                    {faq.a}
                  </div>
                </details>
              ))}
            </div>
          </div>
        </div>
        <script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify({
          "@context": "https://schema.org",
          "@type": "FAQPage",
          "mainEntity": [
            { "@type": "Question", "name": "What loaders are available for construction in UAE?", "acceptedAnswer": { "@type": "Answer", "text": "Alzar FZE supplies the full range of Schaeffer compact wheeled loaders for construction in the UAE, with diverse attachments for digging, lifting, sweeping, and grading. We provide local technical support and genuine spare parts." } },
            { "@type": "Question", "name": "What dairy farm equipment does Alzar FZE offer?", "acceptedAnswer": { "@type": "Answer", "text": "We represent BvL of Germany for feeding technology including TMR fodder mixer wagons, cattle feeding systems, and automated feed distribution equipment for modern dairy farm operations." } },
            { "@type": "Question", "name": "Do you provide after-sales service for Schaeffer loaders?", "acceptedAnswer": { "@type": "Answer", "text": "Yes, as the authorized dealer, we provide full technical support, genuine spare parts, and maintenance service for all Schaeffer loader models across the UAE and GCC region." } },
            { "@type": "Question", "name": "Can Schaeffer loaders be used for landscaping?", "acceptedAnswer": { "@type": "Answer", "text": "Absolutely. Schaeffer compact loaders are versatile machines ideal for landscaping projects with attachments like pallet forks, buckets, sweepers, and augers." } }
          ]
        }) }} />
      </section>

      <CTABanner />
    </Layout>
  );
}
