"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 {
  LuMountain,
  LuRadio,
  LuSun,
  LuLayers,
  LuCable
} from "react-icons/lu";

export default function PolycabAerialBunchDetail() {
  const [activeLayerTab, setActiveLayerTab] = useState<"conductor" | "insulation">("conductor");

  const basicParameters = [
    { label: "Standard Baseline", val: "IS 14255 Standard" },
    { label: "System Layouts", val: "Single & Three-Phase" },
    { label: "Thermal Ceilings", val: "70°C and 90°C Operations" },
    { label: "Street Light Lines", val: "Optional Configurations" }
  ];

  return (
    <div className="min-h-screen bg-slate-50 text-slate-800 py-16 lg:py-24 2xl:py-32 selection:bg-cyan-100 selection:text-cyan-950">
      <div className="container mx-auto px-4 max-w-7xl 2xl:max-w-(screen-2xl)">

        {/* ─── HERO & STRUCTURAL SUMMARY GRID ─────────────────── */}
        <div className="grid grid-cols-1 lg:grid-cols-12 2xl:grid-cols-14 gap-12 2xl:gap-16 items-center mb-20 2xl:mb-28">

          {/* Left Layout Grid: Product Image Element */}
          <div className="lg:col-span-5 2xl:col-span-6 flex justify-center order-2 lg:order-1">
            <div className="relative w-full max-w-[420px] 2xl:max-w-[560px] aspect-square rounded-3xl overflow-hidden bg-white border border-slate-200 p-6 2xl:p-10 shadow-sm group">
              <div className="relative w-full h-full">
                <Image
                  src="/images/polycab/LV-Aerial-Bunched-Cable-IS.png"
                  alt="Polycab LT Aerial Bunch Cable bundle profile conforming to IS 14255 standards"
                  fill
                  priority
                  className="object-contain group-hover:scale-105 transition-transform duration-500"
                  sizes="(max-width: 768px) 100vw, (max-width: 1536px) 420px, 560px"
                />
              </div>
            </div>
          </div>

          {/* Right Layout Grid: Text & Primary Parameters */}
          <div className="lg:col-span-7 2xl:col-span-8 space-y-6 2xl: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 2xl:text-sm font-bold tracking-wider text-cyan-800 uppercase border border-cyan-200">
              Overhead Distribution Grid
            </span>

            <h1 className="text-3xl md:text-4xl 2xl:text-5xl font-black tracking-tight text-slate-900 leading-tight">
              Polycab LT Aerial Bunch Cables <br />
              <span className="text-cyan-600 font-extrabold text-xl md:text-2xl 2xl:text-3xl block mt-2">
                IS 14255 Conforming Overhead Feeder Systems
              </span>
            </h1>

            <div className="space-y-4 text-slate-600 text-sm md:text-base 2xl:text-lg leading-relaxed font-medium max-w-prose">
              <p>
                Polycab manufactures highly reliable Low Tension (LT) aerial bunch cables conforming strictly to **IS 14255 guidelines**. These bundle cable networks are highly recommended for overhead distribution feeders across rural grids, residential networks, and steep mountain terrains where conventional underground trenching is structurally impossible.
              </p>
              <p>
                Engineered for structural adaptation, these multi-conductor sets are configured as single-phase or three-phase systems, with optional specialized street lighting wires supporting continuous core operations up to **70°C and 90°C**.
              </p>
            </div>

            {/* Quick Metrics Reference Cards */}
            <div className="grid grid-cols-2 sm:grid-cols-4 gap-3 bg-white border border-slate-200 p-4 rounded-2xl shadow-xs">
              {basicParameters.map((param, idx) => (
                <div key={idx} className="bg-slate-50 border border-slate-100 p-3 2xl:p-4 rounded-xl text-center flex flex-col justify-center">
                  <span className="text-[10px] 2xl:text-xs text-slate-400 font-bold uppercase tracking-wider block mb-1">
                    {param.label}
                  </span>
                  <span className="text-xs 2xl:text-sm font-black text-slate-900">
                    {param.val}
                  </span>
                </div>
              ))}
            </div>

            {/* Action Interactions Selection */}
            <div className="flex flex-wrap gap-4 pt-2">
              <Link
                href="https://realswitchgears.com/assets/images/products/polycab-cable/lv-power-cable/pdf/LV-Aerial-Bunched-Cable-IS.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 Catalogue
              </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-md shadow-cyan-500/10"
              >
                Send Enquiry <FaEnvelope className="w-3.5 h-3.5" />
              </Link>
            </div>
          </div>

        </div>

        {/* ─── DYNAMIC MATERIAL LAYERS SPECIFICATION INTERACTIVE ─── */}
        <div className="mb-20 2xl:mb-28">
          <div className="flex flex-col md:flex-row md:items-end justify-between border-b border-slate-200/60 pb-5 mb-8 gap-4">
            <div className="space-y-1">
              <h2 className="text-xl 2xl:text-2xl font-black text-slate-900 tracking-tight">Material Layer Specifications</h2>
              <p className="text-xs 2xl:text-sm text-slate-500 font-medium">Explore the in-house metal composition and protective compounds used in Polycab AB cables.</p>
            </div>

            {/* Interactive Control Toggles */}
            <div className="flex bg-slate-200/60 p-1 rounded-xl w-fit text-xs 2xl:text-sm font-bold border border-slate-200">
              <button
                onClick={() => setActiveLayerTab("conductor")}
                className={`px-4 py-2 rounded-lg transition-all flex items-center gap-2 ${activeLayerTab === "conductor" ? "bg-white text-slate-900 shadow-xs" : "text-slate-500 hover:text-slate-800"}`}
              >
                <LuCable className="w-3.5 h-3.5 text-cyan-600" /> Conductor Layout
              </button>
              <button
                onClick={() => setActiveLayerTab("insulation")}
                className={`px-4 py-2 rounded-lg transition-all flex items-center gap-2 ${activeLayerTab === "insulation" ? "bg-white text-slate-900 shadow-xs" : "text-slate-500 hover:text-slate-800"}`}
              >
                <LuLayers className="w-3.5 h-3.5 text-cyan-600" /> Insulation Matrices
              </button>
            </div>
          </div>

          {/* Tab Element Component Content: Conductors Grid */}
          {activeLayerTab === "conductor" && (
            <div className="grid grid-cols-1 md:grid-cols-3 gap-6 animate-fadeIn">
              <div className="bg-white border border-slate-200 p-6 2xl:p-8 rounded-2xl shadow-xs space-y-3">
                <div className="text-xs font-extrabold px-2 py-1 rounded bg-slate-100 text-slate-700 w-fit uppercase">Primary Core</div>
                <h3 className="text-sm 2xl:text-base font-black text-slate-900">Phase Conductor</h3>
                <p className="text-xs 2xl:text-sm text-slate-500 font-medium leading-relaxed">
                  High-conductivity, annealed stranded aluminum conductor cleanly produced in-house on state-of-the-art wire drawing machinery lines.
                </p>
              </div>
              <div className="bg-white border border-slate-200 p-6 2xl:p-8 rounded-2xl shadow-xs space-y-3">
                <div className="text-xs font-extrabold px-2 py-1 rounded bg-cyan-50 border border-cyan-200 text-cyan-800 w-fit uppercase">Structural Spine</div>
                <h3 className="text-sm 2xl:text-base font-black text-slate-900">Messenger Conductor</h3>
                <p className="text-xs 2xl:text-sm text-slate-500 font-medium leading-relaxed">
                  Stranded circular or heavily compacted heat-treated aluminum magnesium alloy wires explicitly specified to absorb layout tension and environmental stress.
                </p>
              </div>
              <div className="bg-white border border-slate-200 p-6 2xl:p-8 rounded-2xl shadow-xs space-y-3">
                <div className="text-xs font-extrabold px-2 py-1 rounded bg-slate-100 text-slate-700 w-fit uppercase">Auxiliary Core</div>
                <h3 className="text-sm 2xl:text-base font-black text-slate-900">Street Light Conductor</h3>
                <p className="text-xs 2xl:text-sm text-slate-500 font-medium leading-relaxed">
                  Integrated stranded aluminum conductors, insulated separately to allow quick power extensions for public municipal illumination layouts.
                </p>
              </div>
            </div>
          )}

          {/* Tab Element Component Content: Insulation Grid */}
          {activeLayerTab === "insulation" && (
            <div className="grid grid-cols-1 md:grid-cols-3 gap-6 animate-fadeIn">
              <div className="bg-white border border-slate-200 p-6 2xl:p-8 rounded-2xl shadow-xs space-y-3">
                <div className="text-xs font-extrabold px-2 py-1 rounded bg-cyan-50 text-cyan-800 border border-cyan-100 w-fit uppercase">Mandatory Safety</div>
                <h3 className="text-sm 2xl:text-base font-black text-slate-900">Phase Core Insulation</h3>
                <p className="text-xs 2xl:text-sm text-slate-500 font-medium leading-relaxed">
                  Features cross-linked polyethylene (XLPE) compounds developed fully in-house to protect lines against voltage breakdown and weather degradation.
                </p>
              </div>
              <div className="bg-white border border-slate-200 p-6 2xl:p-8 rounded-2xl shadow-xs space-y-3">
                <div className="text-xs font-extrabold px-2 py-1 rounded bg-slate-100 text-slate-700 w-fit uppercase">Application Optional</div>
                <h3 className="text-sm 2xl:text-base font-black text-slate-900">Messenger Core Insulation</h3>
                <p className="text-xs 2xl:text-sm text-slate-500 font-medium leading-relaxed">
                  Available with optional in-house formulated XLPE compound shielding depending on localized overhead framework security requirements.
                </p>
              </div>
              <div className="bg-white border border-slate-200 p-6 2xl:p-8 rounded-2xl shadow-xs space-y-3">
                <div className="text-xs font-extrabold px-2 py-1 rounded bg-cyan-50 text-cyan-800 border border-cyan-100 w-fit uppercase">Mandatory Safety</div>
                <h3 className="text-sm 2xl:text-base font-black text-slate-900">Street Light Core Insulation</h3>
                <p className="text-xs 2xl:text-sm text-slate-500 font-medium leading-relaxed">
                  Protected with specialized, high-resistance XLPE insulation layers to prevent accidental line grouping faults or short-circuit failures.
                </p>
              </div>
            </div>
          )}
        </div>

        {/* ─── ENVIRONMENTAL DEPLOYMENT ADAPTATION NOTICE ───────── */}
        <div className="grid grid-cols-1 md:grid-cols-3 gap-6 mb-20 2xl:mb-28">
          <div className="bg-white border border-slate-200 rounded-2xl p-5 2xl:p-6 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">
              <LuMountain className="w-5 h-5 2xl:w-6 2xl:h-6" />
            </div>
            <div className="space-y-1">
              <h4 className="text-xs 2xl:text-sm font-black text-slate-900">Challenging Topographies</h4>
              <p className="text-[11px] 2xl:text-xs text-slate-500 font-medium leading-relaxed">Perfect layout option for mountainous paths or rocky hillsides where underground cable trenching is structurally impossible.</p>
            </div>
          </div>
          <div className="bg-white border border-slate-200 rounded-2xl p-5 2xl:p-6 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">
              <LuRadio className="w-5 h-5 2xl:w-6 2xl:h-6" />
            </div>
            <div className="space-y-1">
              <h4 className="text-xs 2xl:text-sm font-black text-slate-900">Reduced Power Theft</h4>
              <p className="text-[11px] 2xl:text-xs text-slate-500 font-medium leading-relaxed">Bundled and insulated architectures actively reduce open wire tap hazards and hazardous power line interference.</p>
            </div>
          </div>
          <div className="bg-white border border-slate-200 rounded-2xl p-5 2xl:p-6 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">
              <LuSun className="w-5 h-5 2xl:w-6 2xl:h-6" />
            </div>
            <div className="space-y-1">
              <h4 className="text-xs 2xl:text-sm font-black text-slate-900">Weatherization Shield</h4>
              <p className="text-[11px] 2xl:text-xs text-slate-500 font-medium leading-relaxed">Advanced XLPE layers provide reliable protection against long-term solar UV exposure and unpredictable atmospheric moisture loops.</p>
            </div>
          </div>
        </div>

        {/* ─── TECHNICAL PROCUREMENT HUB ACTION CALLOUT ──────────── */}
        <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>
  );
}