"use client";

import { useState } from "react";
import { useRouter } from "next/navigation";

import Image from "next/image";



export default function PartnerPage() {
  const router = useRouter();

const OfferBadge = () => {
  

  return (
    <div className="flex items-center backdrop-blur-md bg-white/5 rounded-full px-4 md:px-5 py-3 md:py-3.5 border border-white/20 shadow-md max-w-sm w-full transition-transform hover:scale-[1.02]">
      
      {/* ICON */}
      <div className="relative flex-shrink-0 mr-3 md:mr-4">
        <div className="relative w-10 h-10 md:w-12 md:h-12 flex items-center justify-center">
          
          <div className="absolute inset-0 animate-[spin_30s_linear_infinite]">
            <svg viewBox="0 0 100 100" className="w-full h-full text-primary">
              <path
                fill="currentColor"
                d="M50 0 L58.3 12.5 L73.2 5.8 L75.8 21.8 L90.8 17.5 L86.6 32.5 L100 37.5 L91.7 50 L100 62.5 L86.6 67.5 L90.8 82.5 L75.8 78.2 L73.2 94.2 L58.3 87.5 L50 100 L41.7 87.5 L26.8 94.2 L24.2 78.2 L9.2 82.5 L13.4 67.5 L0 62.5 L8.3 50 L0 37.5 L13.4 32.5 L9.2 17.5 L24.2 21.8 L26.8 5.8 L41.7 12.5 Z"
              />
            </svg>
          </div>

          <span className="relative z-10 text-white font-black text-base md:text-lg">
            %
          </span>
        </div>
      </div>

      {/* TEXT */}
      <div className="flex flex-col">
        <h2 className="text-white text-xs md:text-sm font-bold leading-tight">
          0% commission for 1st month!
        </h2>
        <p className="text-white/70 text-[10px] md:text-xs mt-0.5">
          Only valid for new partners
        </p>
      </div>
    </div>
  );
};

  const faqData = [
    {
      q: "What is Ridoo?",
      a: "Ridoo is a platform that helps partners list and rent their vehicles easily.",
    },
    {
      q: "Who can rent a vehicle from Ridoo?",
      a: "Anyone meeting the platform’s requirements and verification can rent.",
    },
    {
      q: "Can we put our car or bike on rent on Ridoo?",
      a: "Yes, you can list your vehicles and start earning by renting them out.",
    },
    {
      q: "How can I trust any customer?",
      a: "Ridoo verifies users and provides tracking & security features.",
    },
    {
      q: "How can I trust any partner?",
      a: "All partners go through verification before onboarding.",
    },
    {
      q: "What kind of support do I get from Ridoo?",
      a: "We provide 24/7 support along with operational assistance.",
    },
    {
      q: "Will I get refund in case of cancellation?",
      a: "Refund policies depend on booking terms and cancellation timing.",
    },
  ];

  function FAQSection() {
  const [openIndex, setOpenIndex] = useState<number | null>(2);

  return (
    <div className="px-4 md:px-10 py-12 bg-[#f7f7f7]">
      <div className="max-w-4xl mx-auto">

        {/* TITLE */}
        <h2 className="text-xl md:text-2xl font-semibold mb-6">
          FAQ for <span className="text-yellow-500">Partners</span>
        </h2>

        {/* FAQ LIST */}
        <div className="space-y-3">
          {faqData.map((item, index) => (
            <div
              key={index}
              className={`rounded-lg border ${
                openIndex === index
                  ? "bg-yellow-50 border-yellow-200"
                  : "bg-white"
              }`}
            >
              <button
                onClick={() =>
                  setOpenIndex(openIndex === index ? null : index)
                }
                className="w-full flex justify-between items-center px-4 py-3 text-left text-sm font-medium"
              >
                {item.q}
                <span>{openIndex === index ? "▲" : "▼"}</span>
              </button>

              {openIndex === index && (
                <div className="px-4 pb-4 text-sm text-gray-600">
                  {item.a}
                </div>
              )}
            </div>
          ))}
        </div>
      </div>
    </div>
  );
}
  
  return (
    <>
      {/* HERO SECTION */}
      <div
        className="relative w-full h-[70vh] flex items-center justify-center text-center text-white"
        style={{
          backgroundImage: "url('/partner-img.jpg')",
          backgroundSize: "cover",
          backgroundPosition: "center",
        }}
      >
        <div className="absolute inset-0 bg-black/70"></div>

        <div className="relative z-10 px-4">
          <h1 className="text-3xl md:text-5xl font-bold max-w-2xl mx-auto mb-3">
            Partner with Ridoo and grow your business
          </h1>

         <div className="mt-6 flex flex-col items-center gap-5">
  <OfferBadge />



<button
  className="mt-2"
  onClick={() => router.push("/register-partner")}
>
  <Image
    src="/register-btn.png"
    alt="Register"
     width={180}
  height={54}
    className="w-[250px] md:w-[300px] object-contain hover:scale-110 transition duration-300"
  />
</button>
</div>
        </div>
      </div>

      {/* FLOATING CARD */}
      <div className="relative -mt-20 px-4 md:px-10 pb-10">
        <div className="max-w-6xl mx-auto bg-white rounded-2xl shadow-xl p-6 md:p-10 grid md:grid-cols-2 gap-8 items-center">

          {/* LEFT TEXT */}
          <div>
            <h2 className="text-xl md:text-2xl font-semibold mb-2">
              Get started: It only takes 10 minutes
            </h2>

            <p className="text-gray-500 text-sm mb-4">
              You don’t need any documents to create a Partner account with Ridoo.
              Sign-up in a click
            </p>

           <ul className="space-y-3 text-gray-700 text-sm">
  {[
    "Basic KYC (100% paperless)",
    "GST number, if applicable",
    "Bank account details",
  ].map((item, i) => (
    <li key={i} className="flex items-center gap-2">
      <Image
        src="/bullet.png"   // <-- your icon image
        alt="bullet"
         width={180}
  height={54}
        className="w-4 h-4 object-contain"
      />
      {item}
    </li>
  ))}
</ul>
          </div>

          {/* RIGHT YOUTUBE VIDEO */}
          <div className="w-full">
            <div className="rounded-xl overflow-hidden shadow-md">
              <iframe
                className="w-full h-[220px] md:h-[260px]"
                src="https://www.youtube.com/embed/dQw4w9WgXcQ"
                title="How to onboard your business"
                allowFullScreen
              ></iframe>
            </div>
          </div>
        </div>
      </div>

      {/* WHY PARTNER SECTION */}
      <div className="px-4 md:px-10 py-12 bg-[#f7f7f7]">

        {/* TITLE */}
        <div className="text-center mb-10">
          <h2 className="text-xl md:text-2xl font-semibold">
            Why should you partner with Ridoo?
          </h2>
        </div>

        {/* GRID */}
        <div className="max-w-6xl mx-auto grid grid-cols-2 md:grid-cols-4 gap-4">

          {[
            "Attract new customers",
            "Verify customers online",
            "Track RTO & challans",
            "Cloud data",
            "Repair & maintenance",
            "Report & Blacklist",
            "GPS tracking module",
            "Multi-point & vehicle management",
          ].map((item, index) => (
            <div
              key={index}
              className="bg-white border border-yellow-200 rounded-xl p-4 text-center shadow-sm hover:shadow-md transition"
            >
              <div className="text-yellow-500 text-2xl mb-2">👥</div>
              
              <p className="text-sm font-medium text-gray-700">{item}</p>
            </div>
          ))}

        </div>
      </div>

     
<div className="px-4 md:px-10 py-12 bg-white">
  <div className="text-center mb-10 flex items-center justify-center gap-4">
    <div className="h-[1px] w-16 bg-gray-300"></div>
    <h2 className="text-xl md:text-2xl font-semibold">
      Partner success stories
    </h2>
    <div className="h-[1px] w-16 bg-gray-300"></div>
  </div>

  <div className="max-w-6xl mx-auto grid md:grid-cols-2 gap-6">
    {[1, 2].map((_, i) => (
      <div
        key={i}
        className="border border-yellow-200 rounded-xl p-6 shadow-sm"
      >
        <p className="text-gray-700 text-sm md:text-base leading-relaxed">
          “My business grew 10x this year, all thanks to the Ridoo platform.
          It helped me reach more customers and manage operations effortlessly.”
        </p>

        <div className="flex items-center gap-3 mt-6">
          <Image
             alt="Partner"
             src="/partner-p.jpg" 
              width={180}
  height={54}
            className="w-10 h-10 rounded-full"
          />
          <div>
            <p className="text-sm font-semibold">Abaraj Hukkeri</p>
            <p className="text-xs text-gray-500">
              Movonwheels Bike Rentals
            </p>
            <p className="text-xs text-gray-400">Belagavi</p>
          </div>
        </div>
      </div>
    ))}
  </div>
</div>

<FAQSection />

<style>{`
  @keyframes shine {
    0% { transform: translateX(-150%) skewX(-25deg); }
    25% { transform: translateX(150%) skewX(-25deg); }
    100% { transform: translateX(150%) skewX(-25deg); }
  }
`}</style>
    </>
  );
}