"use client";

import React, { useState } from "react";
import Image from "next/image";
import Link from "next/link";
import { FaDownload, FaEnvelope, FaChevronRight } from "react-icons/fa6";
import {
  LuLayers,
  LuShieldAlert,
  LuCpu,
  LuGauge,
  LuSparkles,
  LuThermometerSnowflake
} from "react-icons/lu";
import Breadcrumb from "@/components/Common/Breadcrumb";
interface TechFeature {
  id: string;
  title: string;
  highlight: string;
  description: string;
}

export default function PolycabIs7098Part1ControlCable() {
  const [activeFeatureId, setActiveFeatureId] = useState<string>("feat-1");

  const systemMetrics = [
    { label: "Standard Baseline", val: "IS 7098-P1 Standard" },
    { label: "Voltage Rating", val: "Up to & Including 1100V AC" },
    { label: "Core Formats", val: "2, 3, 4, & Multicore" },
    { label: "Thermal Scope", val: "90°C Run / 250°C Short" }
  ];

  const technicalAdvantages: TechFeature[] = [
    {
      id: "feat-1",
      title: "Thermosetting Insulation Matrix",
      highlight: "Cross-Linked Polyethylene (XLPE) Core",
      description: "Features a robust thermosetting compound that does not melt or soften under structural thermal loads, ensuring excellent physical stability during continuous operations."
    },
    {
      id: "feat-2",
      title: "Superior Insulation Resistance",
      highlight: "1000x More Resistant Than PVC",
      description: "Delivers an exceptional electrical isolation profile, maintaining cross-talk signal integrity with an insulation resistance 1,000 times greater than traditional PVC alternatives."
    },
    {
      id: "feat-3",
      title: "Moisture & Chemical Immunity",
      highlight: "High Barrier Environmental Defense",
      description: "Engineered to offer superior resistance to damp environments, continuous moisture intrusion, and aggressive chemical exposure in industrial plant areas."
    },
    {
      id: "feat-4",
      title: "Optimized Dielectric Efficiency",
      highlight: "Ultra-Low Dielectric Losses",
      description: "Minimizes structural dissipation factors and signal degradation during automation measurement and regulation loop signaling."
    },
    {
      id: "feat-5",
      title: "Extended System Service Life",
      highlight: "Long-Term Thermal Degradation Resistance",
      description: "Resists structural aging and environmental stress-cracking, ensuring reliable transmission across automated industrial processes."
    },
    {
      id: "feat-6",
      title: "Elevated Thermal Limits",
      highlight: "90°C Continuous / 250°C Short Circuit",
      description: "Supports elevated continuous conductor run limits of 90°C and transient short-circuit heat spikes up to 250°C without risk of insulation failure."
    }
  ];

  return (
    <>
      {/* <Breadcrumbs pageName="Polycab LT Control Cables" discription="IS 7098-P1 Industrial Automation Series" /> */}
      <div className="min-h-screen bg-white text-slate-800 py-12 md:py-16 lg:py-24 xl:py-28 2xl:py-36 selection:bg-cyan-100 selection:text-cyan-950">
        <div className="container mx-auto px-4 sm:px-6 lg:px-8 xl:px-16 2xl:px-24 max-w-[1800px]">

          {/* ─── HERO BRAND / DETAILS SECTION ──────────────────── */}
          <div className="grid grid-cols-1 lg:grid-cols-12 gap-8 lg:gap-12 xl:gap-16 2xl:gap-24 items-center mb-20 lg:mb-28 2xl:mb-36">

            {/* 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-[480px] xl:max-w-[540px] 2xl:max-w-[620px] aspect-square rounded-3xl overflow-hidden bg-slate-50 border border-slate-200 p-6 sm:p-8 xl:p-12 shadow-xs group hover:border-cyan-500 transition-colors duration-300">
                <div className="relative w-full h-full">
                  <Image
                    src="https://realswitchgears.com/assets/images/products/polycab-cable/lv-control-cable/LV-Control-Cable-IS-1.png"
                    alt="Polycab Low Tension control cable conforming to IS 7098 Part 1 standard"
                    fill
                    priority
                    className="object-contain group-hover:scale-103 transition-transform duration-500"
                    sizes="(max-width: 640px) 100vw, (max-width: 1024px) 480px, (max-width: 1536px) 540px, 620px"
                  />
                </div>
              </div>
            </div>

            {/* Right Frame: Text Narrative Content */}
            <div className="lg:col-span-7 space-y-6 xl:space-y-8 order-1 lg:order-2">
              <span className="inline-flex items-center gap-1.5 rounded-full bg-cyan-50 px-4 py-1.5 text-xs xl:text-sm font-bold tracking-wider text-cyan-600 uppercase border border-cyan-200">
                Low Tension Signal &amp; Control
              </span>

              <h1 className="text-2xl sm:text-3xl md:text-4xl lg:text-5xl 2xl:text-6xl font-black tracking-tight text-slate-900 leading-tight uppercase">
                Polycab LT Control Cables <br />
                <span className="text-cyan-500 font-black text-lg sm:text-xl md:text-2xl xl:text-3xl block normal-case tracking-wide mt-2 xl:mt-4">
                  IS 7098-P1 Industrial Automation Series
                </span>
              </h1>

              <div className="space-y-4 xl:space-y-6 text-slate-600 text-sm md:text-base xl:text-lg 2xl:text-xl leading-relaxed font-medium">
                <p>
                  Polycab’s Low Tension (LT) Control Cables meet the comprehensive performance and manufacturing parameters set by the <strong>IS 7098-P1 standard</strong>. They are optimized for both <strong>armoured and unarmoured</strong> applications.
                </p>
                <p>
                  Designed for complex automation control circuits, these systems are available in <strong>two, three, four, and multi-core configurations</strong>. They feature premium cross-linked polyethylene (XLPE) insulation paired with a tough protective PVC sheath.
                </p>
                <p>
                  Operating at low-tension voltage grades <strong>up to and including 1100V AC</strong>, these control elements are widely specified to accurately measure, monitor, and regulate automated process loops across modern production facilities.
                </p>
              </div>

              {/* Parameter Cards Summary Layout */}
              <div className="grid grid-cols-2 sm:grid-cols-4 gap-3 xl:gap-4 bg-slate-50/50 border border-slate-200/60 p-4 xl:p-6 rounded-2xl shadow-xs">
                {systemMetrics.map((metric, index) => (
                  <div key={index} className="bg-white border border-slate-150 p-3 xl:p-5 rounded-xl text-center flex flex-col justify-center shadow-xs group hover:border-cyan-500 transition-colors duration-300">
                    <span className="text-[10px] xl:text-xs text-slate-400 group-hover:text-cyan-500 font-black uppercase tracking-widest block mb-1 transition-colors">
                      {metric.label}
                    </span>
                    <span className="text-xs xl:text-sm 2xl:text-base font-black text-slate-900 leading-snug">
                      {metric.val}
                    </span>
                  </div>
                ))}
              </div>

              {/* Direct Brochure CTAs */}
              <div className="flex flex-col sm:flex-row flex-wrap gap-4 pt-2 xl:pt-4">
                <Link
                  href="https://realswitchgears.com/assets/images/products/polycab-cable/lv-control-cable/pdf/LV-Control-Cable-IS-1.pdf"
                  target="_blank"
                  className="inline-flex items-center justify-center gap-2 bg-slate-900 hover:bg-slate-800 text-white text-xs xl:text-sm font-bold px-6 xl:px-8 py-4 xl:py-5 rounded-xl transition-all group w-full sm:w-auto uppercase tracking-wider shadow-sm"
                >
                  <FaDownload className="w-3.5 h-3.5 xl:w-4 xl:h-4 group-hover:translate-y-0.5 transition-transform" />
                  Download Control Catalog
                </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-6 xl:px-8 py-4 xl:py-5 rounded-xl transition-all shadow-md shadow-cyan-500/10 w-full sm:w-auto uppercase tracking-wider"
                >
                  Send Enquiry <FaEnvelope className="w-3.5 h-3.5 xl:w-4 xl:h-4" />
                </Link>
              </div>
            </div>

          </div>

          {/* ─── INTERACTIVE ARCHITECTURE FEATURE VIEWER ────────── */}
          <div className="mb-20 lg:mb-28 2xl:mb-36">
            <div className="flex flex-col sm:flex-row sm:items-center gap-3 mb-8 xl:mb-12 pb-4 border-b border-slate-200/60">
              <div className="p-2.5 bg-cyan-50 border border-cyan-100 text-cyan-500 rounded-xl shadow-xs self-start sm:self-auto xl:p-3.5">
                <LuLayers className="w-5 h-5 xl:w-6 xl:h-6" />
              </div>
              <div>
                <h2 className="text-base sm:text-lg xl:text-xl 2xl:text-2xl font-black text-slate-900 uppercase tracking-wide">Technical Advantages Profile</h2>
                <p className="text-xs xl:text-sm text-slate-500 font-medium">
                  Select any benefit criteria below to review the structural tolerances and material performance advantages over standard options.
                </p>
              </div>
            </div>

            <div className="grid grid-cols-1 lg:grid-cols-12 gap-6 lg:gap-8 xl:gap-12 items-start">

              {/* Left Control Panel Column */}
              <div className="lg:col-span-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-1 gap-2 xl:gap-3">
                {technicalAdvantages.map((feat) => (
                  <button
                    key={feat.id}
                    onClick={() => setActiveFeatureId(feat.id)}
                    className={`w-full text-left p-3.5 xl:p-5 rounded-xl border text-xs xl:text-sm font-bold transition-all flex items-center justify-between group ${activeFeatureId === feat.id
                      ? "bg-cyan-500 text-white border-cyan-600 shadow-md shadow-cyan-500/10"
                      : "bg-slate-50/50 text-slate-700 border-slate-200 hover:bg-slate-100/80 hover:border-cyan-200"
                      }`}
                  >
                    <span className="truncate pr-2">{feat.title}</span>
                    <FaChevronRight className={`w-2.5 h-2.5 xl:w-3 xl:h-3 opacity-90 group-hover:translate-x-0.5 transition-transform shrink-0 ${activeFeatureId === feat.id ? "text-white" : "text-slate-400"
                      }`} />
                  </button>
                ))}
              </div>

              {/* Right Details Information Block */}
              <div className="lg:col-span-7 bg-slate-50/50 border border-slate-200/60 rounded-3xl p-6 md:p-8 xl:p-12 min-h-[250px] xl:min-h-[380px] flex flex-col justify-between shadow-xs border-l-4 border-l-cyan-500 transition-colors">
                {(() => {
                  const featMatch = technicalAdvantages.find((f) => f.id === activeFeatureId)!;
                  return (
                    <>
                      <div className="space-y-4 xl:space-y-6">
                        <div>
                          <span className="text-[10px] xl:text-xs font-black tracking-widest text-cyan-500 uppercase block mb-1">
                            Performance Advantage
                          </span>
                          <h3 className="text-base font-black text-slate-900 xl:text-lg 2xl:text-xl uppercase tracking-wide">
                            {featMatch.title}
                          </h3>
                        </div>
                        <div className="inline-block bg-cyan-50 text-cyan-700 text-[11px] xl:text-xs font-extrabold px-3 xl:px-4 py-1.5 xl:py-2 rounded-md border border-cyan-100 shadow-xs">
                          {featMatch.highlight}
                        </div>
                        <p className="text-xs md:text-sm xl:text-base 2xl:text-lg text-slate-600 font-medium leading-relaxed pt-2">
                          {featMatch.description}
                        </p>
                      </div>

                      <div className="mt-6 pt-4 border-t border-slate-200/40 flex items-center justify-between text-[11px] xl:text-xs text-slate-400 font-bold">
                        <span className="flex items-center gap-1 text-cyan-500">
                          <LuSparkles className="w-3.5 h-3.5 xl:w-4 xl:h-4" /> High Signal Integrity
                        </span>
                        <span className="tracking-wide uppercase text-[10px] xl:text-xs">IS 7098-P1 Compliant Run</span>
                      </div>
                    </>
                  );
                })()}
              </div>

            </div>
          </div>

          {/* ─── ADDED ADVANTAGES SPECS CARDS ──────────────────── */}
          <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 xl:gap-8 mb-20 lg:mb-28 2xl:mb-36">
            <div className="bg-slate-50/50 border border-slate-200/60 rounded-3xl p-5 xl:p-8 shadow-xs flex items-start gap-4 xl:gap-6 hover:border-cyan-500/30 transition-colors duration-300">
              <div className="p-2.5 bg-cyan-50 border border-cyan-100 rounded-xl text-cyan-500 shrink-0 shadow-xs xl:p-4">
                <LuGauge className="w-5 h-5 xl:w-6 xl:h-6" />
              </div>
              <div className="space-y-1 xl:space-y-2">
                <h4 className="text-xs xl:text-sm font-black text-slate-900 uppercase tracking-wide">Precision Regulation</h4>
                <p className="text-[11px] xl:text-xs 2xl:text-sm text-slate-500 font-medium leading-relaxed">
                  Engineered with ultra-low dielectric losses to reliably transmit telemetry, measurement, and automated control loop signals.
                </p>
              </div>
            </div>
            <div className="bg-slate-50/50 border border-slate-200/60 rounded-3xl p-5 xl:p-8 shadow-xs flex items-start gap-4 xl:gap-6 hover:border-cyan-500/30 transition-colors duration-300">
              <div className="p-2.5 bg-cyan-50 border border-cyan-100 rounded-xl text-cyan-500 shrink-0 shadow-xs xl:p-4">
                <LuCpu className="w-5 h-5 xl:w-6 xl:h-6" />
              </div>
              <div className="space-y-1 xl:space-y-2">
                <h4 className="text-xs xl:text-sm font-black text-slate-900 uppercase tracking-wide">1000x Insulation Profile</h4>
                <p className="text-[11px] xl:text-xs 2xl:text-sm text-slate-500 font-medium leading-relaxed">
                  High cross-linked thermoset compound structures provide 1,000 times more insulation resistance than standard PVC cables.
                </p>
              </div>
            </div>
            <div className="bg-slate-50/50 border border-slate-200/60 rounded-3xl p-5 xl:p-8 shadow-xs flex items-start gap-4 xl:gap-6 sm:col-span-2 lg:col-span-1 hover:border-cyan-500/30 transition-colors duration-300">
              <div className="p-2.5 bg-cyan-50 border border-cyan-100 rounded-xl text-cyan-500 shrink-0 shadow-xs xl:p-4">
                <LuThermometerSnowflake className="w-5 h-5 xl:w-6 xl:h-6" />
              </div>
              <div className="space-y-1 xl:space-y-2">
                <h4 className="text-xs xl:text-sm font-black text-slate-900 uppercase tracking-wide">Extreme Short Margin</h4>
                <p className="text-[11px] xl:text-xs 2xl:text-sm text-slate-500 font-medium leading-relaxed">
                  Maintains insulation integrity during unexpected thermal overloads up to 250°C and severe emergency system trips.
                </p>
              </div>
            </div>
          </div>

          {/* ─── COMMERCIAL INQUIRY BLOCK ──────────────────────── */}
          <div className="bg-gradient-to-br from-slate-900 to-slate-800 text-white rounded-3xl p-6 sm:p-10 md:p-12 lg:p-16 xl:p-20 text-center max-w-5xl xl:max-w-6xl 2xl:max-w-7xl mx-auto border border-slate-950 shadow-xl relative overflow-hidden">
            <div className="absolute top-0 right-0 w-64 h-64 bg-cyan-500/10 rounded-full blur-3xl pointer-events-none" />
            <div className="inline-flex p-3 bg-slate-950 rounded-2xl border border-slate-800 text-cyan-400 mb-4 xl:mb-6">
              <LuShieldAlert className="w-6 h-6 xl:w-8 xl:h-8" />
            </div>
            <h3 className="text-xl md:text-2xl lg:text-3xl 2xl:text-4xl font-black text-white mb-3 xl:mb-5 uppercase tracking-wide">
              Source Certified IS 7098-P1 Low-Tension Control Infrastructure
            </h3>
            <p className="text-slate-400 text-sm md:text-base xl:text-lg max-w-xl xl:max-w-2xl mx-auto mb-8 xl:mb-12 font-medium">
              Connect directly with our applications engineering desk to define core count layouts, verify armor requirements, or get an immediate wholesale quote.
            </p>
            <div className="flex flex-col sm:flex-row justify-center items-center gap-4 xl:gap-6">
              <Link
                href="https://realswitchgears.com/assets/images/products/polycab-cable/lv-control-cable/pdf/LV-Control-Cable-IS-1.pdf"
                target="_blank"
                className="inline-flex items-center gap-2 bg-slate-800 hover:bg-slate-700 text-white text-xs xl:text-sm font-bold px-8 xl:px-10 py-4 xl:py-5 rounded-full transition-all w-full sm:w-auto justify-center uppercase tracking-wider border border-slate-700 shadow-sm"
              >
                <FaDownload className="w-3.5 h-3.5 xl:w-4 xl:h-4" /> Technical Specification PDF
              </Link>
              <Link
                href="/contact"
                className="inline-flex items-center gap-2 bg-cyan-500 hover:bg-cyan-600 text-white text-xs xl:text-sm font-bold px-8 xl:px-10 py-4 xl:py-5 rounded-full transition-all duration-200 active:scale-95 shadow-lg shadow-cyan-500/20 w-full sm:w-auto justify-center uppercase tracking-wider"
              >
                Request Commercial Quote
                <FaChevronRight className="w-3 h-3 xl:w-3.5 xl:h-3.5" />
              </Link>
            </div>
          </div>

        </div>
      </div>
    </>
  );
}