"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,
  LuFlame,
  LuAnchor,
  LuShieldAlert,
  LuCpu
} from "react-icons/lu";
import Breadcrumb from "@/components/Common/Breadcrumb";
interface TechnicalSpec {
  id: string;
  title: string;
  category: string;
  technicalDetails: string;
}

export default function PolycabMarineCable() {
  const [activeSpecId, setActiveSpecId] = useState<string>("spec-1");

  const engineeringMetrics = [
    { label: "Low Voltage", val: "0.6/1.0kV & 1.8/3.0kV" },
    { label: "Medium Voltage", val: "6.0 kV to 20 kV" },
    { label: "Instrumentation", val: "150/250V Rating" },
    { label: "Max Core Heat", val: "90°C Continuous" }
  ];

  const technicalSpecifications: TechnicalSpec[] = [
    {
      id: "spec-1",
      title: "High Conductivity Annealed Plain Stranded Copper Conductor",
      category: "Conductor Infrastructure",
      technicalDetails: "Manufactured from high-conductivity annealed plain stranded copper. Processed entirely in-house using an advanced, state-of-the-art Contirod line to maintain uncompromised signal transmission and power distribution integrity under continuous mechanical motion."
    },
    {
      id: "spec-2",
      title: "Cross-Linked Polyethylene (XLPE) Thermoset or Ethylene Propylene Rubber (EPR)",
      category: "Dielectric Insulation Layer",
      technicalDetails: "Features custom in-house developed insulation options with high insulation resistance. Built using cross-linked polyethylene thermoset insulation or ethylene propylene rubber to handle intense peak/transient voltage stress without breakdown."
    },
    {
      id: "spec-3",
      title: "Individual Shielding via Aluminium-Mylar Tape & Drain Wire",
      category: "Individual Screening",
      technicalDetails: "Where specific multi-pair configurations require isolated protection, individual pairs are wrapped tightly with Aluminium-Mylar tape alongside a continuous configuration drain wire to eliminate localized internal crosstalk."
    },
    {
      id: "spec-4",
      title: "Extruded Polymeric Material Barrier or Protective Tape",
      category: "Inner Covering & Interlayer",
      technicalDetails: "A high-performance protective barrier is created between the internal core insulation and the outer armor/braid/screen layers. This is achieved via an extruded layer of robust polymeric material or specialized protective tape wrapping."
    },
    {
      id: "spec-5",
      title: "Collective Shielding via Aluminium-Mylar Tape & Drain Wire",
      category: "Overall Screening Matrix",
      technicalDetails: "Provides an overall collective shield for laid-up core assemblies. Features premium Aluminium-Mylar tape combined with a dedicated drain wire to establish clean electromagnetic interference (EMI) protection across the entire bundle."
    },
    {
      id: "spec-6",
      title: "High-Strength Copper Braiding Mechanical Screen",
      category: "Armor Protection Frame",
      technicalDetails: "Equipped with a tightly woven copper braiding shield. This layer allows the cable assembly to safely withstand severe structural and physical mechanical stresses common to marine routing channels and engine rooms."
    },
    {
      id: "spec-7",
      title: "Thermosetting Polyolefin Halogen-Free SHF-1 / SHF-2 Jacket",
      category: "Outer Casing Extrusion",
      technicalDetails: "Wrapped in an in-house developed thermosetting polyolefin compound jacket (Type SHF-1 or SHF-2). Formulated to be completely free from halogens, generating low levels of smoke and zero corrosive gases when exposed to open flames."
    }
  ];

  return (
    <>
      <Breadcrumb pageName="Polycab Marine Shipwiring Cables" description="Polycab IEC 60092 Marine Shipwiring Cables. Engineered with fire retardant, halogen-free SHF-1/SHF-2 sheathing for sea vessels and offshore platforms." />
      <div className="min-h-screen bg-white text-slate-800 py-16 lg:py-24 selection:bg-cyan-100 selection:text-slate-900">
        <div className="container mx-auto px-4 sm:px-6 lg:px-8 xl:px-12 max-w-[1600px]">

          {/* ─── HERO BRAND / DETAILS SECTION ──────────────────── */}
          <div className="grid grid-cols-1 lg:grid-cols-12 gap-12 items-center mb-20">

            {/* 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] aspect-square rounded-3xl overflow-hidden bg-slate-50 border border-slate-200 p-6 shadow-xs group">
                <div className="relative w-full h-full">
                  <Image
                    src="/images/polycab/MARINESHIPWIRING-CABLES.png"
                    alt="Polycab IEC Certified Fire Retardant Halogen Free Marine Shipwiring Cable"
                    fill
                    priority
                    className="object-contain group-hover:scale-105 transition-transform duration-500"
                    sizes="(max-width: 768px) 100vw, 420px"
                  />
                </div>
              </div>
            </div>

            {/* Right Frame: Text Narrative Content */}
            <div className="lg:col-span-7 space-y-6 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">
                IEC Specification Compliant • Zero Halogen Marine Vessel Grid
              </span>

              <h1 className="text-3xl md:text-4xl font-black tracking-tight text-slate-900 leading-tight">
                Polycab Marine Cables <br />
                <span className="text-cyan-600 font-extrabold text-xl md:text-2xl block mt-2">
                  Fire Retardant &amp; Resistant Shipwiring for Offshore Platforms
                </span>
              </h1>

              <div className="space-y-4 text-slate-600 text-sm md:text-base leading-relaxed font-medium">
                <p>
                  Polycab provides a comprehensive selection of specialized marine and shipwiring cables built in strict compliance with international <strong>IEC specifications and standards</strong>.
                </p>
                <p>
                  This range encompasses low voltage (0.6/1.0 kV &amp; 1.8/3.0 kV), medium voltage (6.0 kV to 20 kV), and instrumentation variations (150/250V) engineered in fire-retardant and fire-resistant combinations. Every line strictly meets the construction and performance criteria of <strong>IEC 60092-353, 354, 376, 350, 352, and 360</strong>.
                </p>
                <p>
                  These single and multi-core/pair lines are optimized for fixed installations across power, lighting, control, instrumentation, and communication circuits on sea vessels and offshore platforms. They are specifically built to withstand peak and transient voltages during motor operations and variable frequency drive (VFD) applications.
                </p>
                <p>
                  Featuring a maximum conductor operating threshold of <strong>90°C</strong> and a short-circuit limit of <strong>250°C</strong>, these cables produce exceptionally low smoke and corrosive gas profiles when exposed to fire compared to traditional alternatives.
                </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 shadow-xs">
                {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">
                    <span className="text-[10px] text-slate-400 font-bold uppercase tracking-wider block mb-1">
                      {metric.label}
                    </span>
                    <span className="text-xs 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/marine-shipwiring-cables/pdf/MARINESHIPWIRING-CABLES.pdf"
                  target="_blank"
                  className="inline-flex items-center gap-2 bg-slate-900 hover:bg-slate-800 text-white text-xs font-bold px-6 py-3.5 rounded-xl transition-all group"
                >
                  <FaDownload className="w-3.5 h-3.5 group-hover:translate-y-0.5 transition-transform" />
                  Download Marine Cable Catalogue
                </Link>
                <Link
                  href="/contact"
                  className="inline-flex items-center gap-2 bg-cyan-500 hover:bg-cyan-600 text-white text-xs font-bold px-6 py-3.5 rounded-xl transition-all shadow-sm"
                >
                  Send Enquiry <FaEnvelope className="w-3.5 h-3.5" />
                </Link>
              </div>
            </div>

          </div>

          {/* ─── INTERACTIVE ARCHITECTURE SPECIFICATION VIEWER ──── */}
          <div className="mb-20">
            <div className="flex items-center gap-3 mb-10 border-b border-slate-200/60 pb-4">
              <div className="p-2 bg-slate-50 border border-slate-200 text-slate-700 rounded-xl">
                <LuLayers className="w-5 h-5" />
              </div>
              <div>
                <h2 className="text-lg font-black text-slate-900">Technical Specifications &amp; Layer Architecture</h2>
                <p className="text-xs text-slate-500 font-medium">
                  Select an engineering layer module below to analyze the specialized insulation sheets, armoring braids, and jacket materials used by Polycab.
                </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 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-white" : "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] font-black tracking-widest text-cyan-600 uppercase block mb-1">
                            {specMatch.category}
                          </span>
                          <h3 className="text-base font-black text-slate-900">
                            {specMatch.title}
                          </h3>
                        </div>
                        <p className="text-xs md:text-sm 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] 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" /> High Transient &amp; VFD Suppressing Shield
                        </span>
                        <span>IEC 60092 Standard Compliant</span>
                      </div>
                    </>
                  );
                })()}
              </div>

            </div>
          </div>

          {/* ─── SYSTEM UTILITY & APPLICATION OVERVIEW CARDS ────── */}
          <div className="grid grid-cols-1 md:grid-cols-3 gap-6 mb-20">
            <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-cyan-50 border border-cyan-100 rounded-xl text-cyan-700 shrink-0">
                <LuAnchor className="w-5 h-5" />
              </div>
              <div className="space-y-1">
                <h4 className="text-xs font-black text-slate-900">Offshore &amp; Vessel Fixed Deployments</h4>
                <p className="text-[11px] text-slate-500 font-medium leading-relaxed">
                  Engineered for critical lighting, instrumentation, power distribution, and communication routing inside marine hulls and offshore drilling rigs.
                </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-blue-50 border border-blue-100 rounded-xl text-blue-700 shrink-0">
                <LuShieldAlert className="w-5 h-5" />
              </div>
              <div className="space-y-1">
                <h4 className="text-xs font-black text-slate-900">VFD Transient Tolerance</h4>
                <p className="text-[11px] text-slate-500 font-medium leading-relaxed">
                  Withstands high voltage spikes and transient surges that occur during heavy shipboard motor startups and variable frequency drive applications.
                </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-red-50 border border-red-100 rounded-xl text-red-700 shrink-0">
                <LuFlame className="w-5 h-5" />
              </div>
              <div className="space-y-1">
                <h4 className="text-xs font-black text-slate-900">Halogen-Free Safety Profile</h4>
                <p className="text-[11px] text-slate-500 font-medium leading-relaxed">
                  SHF-1/SHF-2 polyolefin coatings emit extremely low levels of smoke and zero toxic halogen gases during an emergency fire outbreak.
                </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 >
    </>
  );
}