"use client";

import React, { useState } from "react";
import Image from "next/image";
import Link from "next/link";
import { FaDownload, FaEnvelope, FaChevronRight, FaArrowRight } from "react-icons/fa6";
import {
  LuLayers,
  LuShieldCheck,
  LuLightbulb,
  LuTrendingUp,
  LuCpu,
  LuHouse

} from "react-icons/lu";
import Breadcrumb from "@/components/Common/Breadcrumb";
interface TechnicalSpec {
  id: string;
  title: string;
  category: string;
  technicalDetails: string;
}

export default function PolycabLvThermoplasticCable() {
  const [activeSpecId, setActiveSpecId] = useState<string>("spec-1");

  const engineeringMetrics = [
    { label: "Standard Class", val: "BS EN 50525-2-11" },
    { label: "Voltage Grade", val: "300 / 500 V" },
    { label: "Thermal Limits", val: "70°C & 90°C Ratings" },
    { label: "Core Layouts", val: "Circular & Flat Multicore" }
  ];

  const technicalSpecifications: TechnicalSpec[] = [
    {
      id: "spec-1",
      title: "Annealed Bunched Copper Conductor",
      category: "Conductor Core Architecture",
      technicalDetails: "Constructed with a high-conductivity annealed bunched copper conductor, processed completely in-house using state-of-the-art machinery. The precision annealing process increases material ductility and maximizes elastic wire flexibility for tight routing behind domestic hardware."
    },
    {
      id: "spec-2",
      title: "Thermoplastic / Heat-Resistant Insulation",
      category: "Dielectric Layering",
      technicalDetails: "Insulated with Polycab's proprietary, in-house developed thermoplastic or specialized heat-resistant thermoplastic compounds. These formulas maintain consistent electrical baseline insulation when subjected to sustained operating temperatures of 70°C or 90°C."
    },
    {
      id: "spec-3",
      title: "Zinc-Coated Steel Rope Strain Member",
      category: "Mechanical Tensile Anchor",
      technicalDetails: "For specialized strain-bearing environments, a high-tensile zinc-coated steel rope is embedded directly in the center of the insulated core cluster. This structural backbone absorbs external pull forces, safeguarding copper tracks against elongation or tearing."
    },
    {
      id: "spec-4",
      title: "Thermoplastic External Compound Sheath",
      category: "Protective Outer Shell",
      technicalDetails: "Wrapped in an in-house developed thermoplastic compound sheath applied directly over the insulated core assembly. This outer layer seals the internals against everyday environmental stresses, offering uniform structural protection and cleanly handling friction wear."
    },
    {
      id: "spec-5",
      title: "End-to-End Compliance Testing Matrix",
      category: "Quality Assurance Framework",
      technicalDetails: "Polycab enforces strict quality control across every production stage. Raw polymer and copper elements undergo exhaustive, mandatory verification testing through to the final product stage, meeting or exceeding BS EN 50525-2-11 design guidelines."
    }
  ];

  return (
    <>
      <Breadcrumb pageName="Polycab ICEA S-93-639 MV HT Cables" />
    <div className="min-h-screen bg-white text-slate-800 py-16 lg:py-24 2xl:py-32 selection:bg-cyan-100 selection:text-cyan-900">
      <div className="container mx-auto px-4 max-w-7xl 2xl:max-w-[1650px]">

        {/* ─── HERO BRAND / DETAILS SECTION ──────────────────── */}
        <div className="grid grid-cols-1 lg:grid-cols-12 gap-12 2xl:gap-16 items-center mb-20 2xl:mb-28">

          {/* Left Frame: Image Asset Viewport */}
          <div className="lg:col-span-5 flex justify-center order-2 lg:order-1">
            <div className="relative w-full max-w-[420px] 2xl:max-w-[500px] aspect-square rounded-3xl overflow-hidden bg-slate-50 border border-slate-100 p-8 shadow-xs group">
              <div className="relative w-full h-full">
                <Image
                  src="/images/polycab/Lighting-and-Domestic-aplliances.png"
                  alt="Polycab Low Voltage Thermoplastic Energy Cable BS EN 50525-2-11"
                  fill
                  priority
                  className="object-contain group-hover:scale-105 transition-transform duration-500"
                  sizes="(max-width: 768px) 100vw, (max-width: 1536px) 420px, 500px"
                />
              </div>
            </div>
          </div>

          {/* Right Frame: Text Narrative Content */}
          <div className="lg:col-span-7 space-y-6 2xl:space-y-8 order-1 lg:order-2">
            <span className="inline-flex items-center gap-1.5 rounded-full bg-slate-900 px-4 py-1.5 text-xs font-bold tracking-wider text-cyan-400 uppercase border border-slate-800">
              BS EN 50525-2-11 Standard • Low Voltage Flexible Energy Lines
            </span>

            <h1 className="text-3xl md:text-4xl 2xl:text-5xl font-black tracking-tight text-slate-900 leading-tight">
              Polycab Thermoplastic Cables <br />
              <span className="text-cyan-600 font-extrabold text-xl md:text-2xl 2xl:text-3xl block mt-2">
                300/500 V Multicore Flat &amp; Circular Appliance Wiring Systems
              </span>
            </h1>

            <div className="space-y-4 text-slate-600 text-sm md:text-base 2xl:text-lg leading-relaxed font-medium">
              <p>
                Polycab’s range of <strong>Low Voltage Thermoplastic Energy Cables</strong> offers exceptional structural flexibility and durable insulation performance, designed in compliance with the harmonized <strong>BS EN 50525-2-11</strong> European standard framework.
              </p>
              <p>
                Engineered for connecting household appliances and commercial equipment directly to fixed power outlets, these <strong>300/500 V</strong> flexible lines effortlessly manage the routing configurations required by modern consumer and industrial technology.
              </p>
              <p>
                To fit diverse installation constraints, these systems are available in both <strong>multicore circular and flat configurations</strong>. They feature thermal thresholds rated for <strong>70°C and 90°C</strong> continuous conductor operation, maintaining long-term safety profiles inside active residential, commercial, and lighting environments.
              </p>
            </div>

            {/* Parameter Cards Summary Layout */}
            <div className="grid grid-cols-2 sm:grid-cols-4 gap-3 bg-slate-50 border border-slate-200 p-4 rounded-2xl">
              {engineeringMetrics.map((metric, index) => (
                <div key={index} className="bg-white border border-slate-100 p-3 rounded-xl text-center flex flex-col justify-center shadow-xs">
                  <span className="text-[10px] 2xl:text-xs text-slate-400 font-bold uppercase tracking-wider block mb-1">
                    {metric.label}
                  </span>
                  <span className="text-xs 2xl:text-sm font-black text-slate-900 leading-snug">
                    {metric.val}
                  </span>
                </div>
              ))}
            </div>

            {/* Direct Brochure CTAs */}
            <div className="flex flex-wrap gap-4 pt-2">
              <Link
                href="https://realswitchgears.com/assets/images/products/polycab-cable/lighting-and-domestic-aplliances/pdf/Lighting-and-Domestic-aplliances.pdf"
                target="_blank"
                className="inline-flex items-center gap-2 bg-slate-900 hover:bg-slate-800 text-white text-xs 2xl:text-sm font-bold px-6 py-3.5 2xl:px-8 2xl:py-4 rounded-xl transition-all group"
              >
                <FaDownload className="w-3.5 h-3.5 group-hover:translate-y-0.5 transition-transform" />
                Download BS EN 50525-2-11 Catalog
              </Link>
              <Link
                href="/contact"
                className="inline-flex items-center gap-2 bg-cyan-500 hover:bg-cyan-600 text-white text-xs 2xl:text-sm font-bold px-6 py-3.5 2xl:px-8 2xl:py-4 rounded-xl transition-all shadow-sm shadow-cyan-500/10"
              >
                Send Enquiry <FaEnvelope className="w-3.5 h-3.5" />
              </Link>
            </div>
          </div>

        </div>

        {/* ─── INTERACTIVE ARCHITECTURE SPECIFICATION VIEWER ──── */}
        <div className="mb-20 2xl:mb-28">
          <div className="flex items-center gap-3 mb-10 border-b border-slate-200 pb-4">
            <div className="p-2 bg-slate-50 border border-slate-200 text-slate-700 rounded-xl">
              <LuLayers className="w-5 h-5 text-cyan-600" />
            </div>
            <div>
              <h2 className="text-lg 2xl:text-xl font-black text-slate-900">Technical Specifications &amp; Extrusion Blueprint</h2>
              <p className="text-xs 2xl:text-sm text-slate-500 font-medium">
                Select a cross-sectional category below to inspect the inner technical details of Polycab's low-voltage material matrix.
              </p>
            </div>
          </div>

          <div className="grid grid-cols-1 lg:grid-cols-12 gap-8 items-start">

            {/* Left Control Panel Column */}
            <div className="lg:col-span-5 space-y-2">
              {technicalSpecifications.map((spec) => (
                <button
                  key={spec.id}
                  onClick={() => setActiveSpecId(spec.id)}
                  className={`w-full text-left p-3.5 rounded-xl border text-xs 2xl:text-sm font-bold transition-all flex items-center justify-between group ${activeSpecId === spec.id
                    ? "bg-slate-900 text-white border-slate-950 shadow-xs"
                    : "bg-slate-50 text-slate-700 border-slate-200 hover:bg-slate-100"
                    }`}
                >
                  <span className="truncate">{spec.title}</span>
                  <FaChevronRight className={`w-2.5 h-2.5 opacity-70 group-hover:translate-x-0.5 transition-transform ${activeSpecId === spec.id ? "text-cyan-400" : "text-slate-400"
                    }`} />
                </button>
              ))}
            </div>

            {/* Right Details Information Block */}
            <div className="lg:col-span-7 bg-slate-50 border border-slate-200 rounded-2xl p-6 md:p-8 min-h-[220px] flex flex-col justify-between shadow-xs">
              {(() => {
                const specMatch = technicalSpecifications.find((s) => s.id === activeSpecId)!;
                return (
                  <>
                    <div className="space-y-4">
                      <div>
                        <span className="text-[10px] 2xl:text-xs font-black tracking-widest text-cyan-600 uppercase block mb-1">
                          {specMatch.category}
                        </span>
                        <h3 className="text-base 2xl:text-lg font-black text-slate-900">
                          {specMatch.title}
                        </h3>
                      </div>
                      <p className="text-xs md:text-sm 2xl:text-base text-slate-600 font-medium leading-relaxed pt-2 border-t border-slate-200/60">
                        {specMatch.technicalDetails}
                      </p>
                    </div>

                    <div className="mt-6 pt-4 border-t border-slate-200/60 flex items-center justify-between text-[11px] 2xl:text-xs text-slate-400 font-bold">
                      <span className="flex items-center gap-1 text-slate-700">
                        <LuShieldCheck className="w-3.5 h-3.5 text-cyan-600" /> Comprehensive Quality Control Auditing
                      </span>
                      <span>300/500 V Energy Rated</span>
                    </div>
                  </>
                );
              })()}
            </div>

          </div>
        </div>

        {/* ─── DOMESTIC & COMMERCIAL UTILITY CARDS ───────────── */}
        <div className="grid grid-cols-1 md:grid-cols-3 gap-6 mb-20 2xl:mb-28">
          <div className="bg-slate-50 border border-slate-200 rounded-2xl p-5 shadow-xs flex items-start gap-4">
            <div className="p-2.5 bg-white border border-slate-100 rounded-xl text-cyan-600 shrink-0 shadow-xs">
              <LuHouse className="w-5 h-5" />
            </div>
            <div className="space-y-1">
              <h4 className="text-xs 2xl:text-sm font-black text-slate-900">Domestic Appliance Integration</h4>
              <p className="text-[11px] 2xl:text-xs text-slate-500 font-medium leading-relaxed">
                Optimized for standard appliances requiring reliable, long-term 300/500V power delivery and high outer jacket flexibility.
              </p>
            </div>
          </div>
          <div className="bg-slate-50 border border-slate-200 rounded-2xl p-5 shadow-xs flex items-start gap-4">
            <div className="p-2.5 bg-white border border-slate-100 rounded-xl text-cyan-600 shrink-0 shadow-xs">
              <LuLightbulb className="w-5 h-5" />
            </div>
            <div className="space-y-1">
              <h4 className="text-xs 2xl:text-sm font-black text-slate-900">Commercial Lighting Networks</h4>
              <p className="text-[11px] 2xl:text-xs text-slate-500 font-medium leading-relaxed">
                Perfectly suited for multi-bay architectural downlighting systems and commercial track setups using flat or circular multicore patterns.
              </p>
            </div>
          </div>
          <div className="bg-slate-50 border border-slate-200 rounded-2xl p-5 shadow-xs flex items-start gap-4">
            <div className="p-2.5 bg-white border border-slate-100 rounded-xl text-cyan-600 shrink-0 shadow-xs">
              <LuTrendingUp className="w-5 h-5" />
            </div>
            <div className="space-y-1">
              <h4 className="text-xs 2xl:text-sm font-black text-slate-900">Elevated Thermal Thresholds</h4>
              <p className="text-[11px] 2xl:text-xs text-slate-500 font-medium leading-relaxed">
                Available heat-resistant configurations withstand sustained operating temperatures up to 90°C without compound degradation.
              </p>
            </div>
          </div>
        </div>

        {/* ─── COMMERCIAL INQUIRY BLOCK ──────────────────────── */}
        <div className="flex flex-col sm:flex-row justify-center items-center gap-4 w-full">
          <Link
            href="https://realswitchgears.com/assets/images/products/polycab-cable/lv-power-cable/pdf/LV-Power-Cable-IS-1.pdf"
            target="_blank"
            className="inline-flex items-center justify-center gap-2 bg-slate-100 hover:bg-slate-200 text-slate-900 text-xs font-bold px-8 py-4 rounded-full transition-all w-full sm:w-auto uppercase tracking-wider border border-slate-200 shadow-xs"
          >
            <FaDownload className="w-3.5 h-3.5" />
            View Technical PDF
          </Link>

          <Link
            href="/contact"
            className="inline-flex items-center justify-center gap-2 bg-cyan-500 hover:bg-cyan-600 text-white text-xs xl:text-sm font-bold px-8 sm:px-10 py-4 rounded-full transition-all duration-200 active:scale-95 shadow-md shadow-cyan-500/10 w-full sm:w-auto uppercase tracking-wider"
          >
            Send Enquiry
            <FaArrowRight className="w-3.5 h-3.5 transition-transform group-hover:translate-x-0.5" />
          </Link>
        </div>

      </div >
    </div >
    </>
  );
}