import { useState } from "react"
import { Link } from "react-router"
import { ChevronDown, ChevronUp } from "lucide-react"

const FAQS = [
  { q: "Are the subscriptions genuine and legal?", a: "Yes. We provide 100% authentic subscriptions through official channels. All licenses are genuine with zero ban risk. We have served 10,000+ customers since 2023 with a 99.8% success rate." },
  { q: "How fast will I receive my subscription?", a: "Instant delivery! Most orders are fulfilled within 2 to 10 minutes via WhatsApp or email. You will receive clear setup instructions and direct access credentials." },
  { q: "What payment methods do you accept?", a: "We accept UPI (Google Pay, PhonePe, Paytm), PayPal for international orders, and Cryptocurrency (Bitcoin, Ethereum, USDT). All payments are secure and encrypted." },
  { q: "Can I get a refund if something doesn't work?", a: "Absolutely! We offer a 24-hour money-back guarantee. If we cannot resolve any issue within 24 hours, you get a full refund — no questions asked." },
  { q: "Will my subscription work on multiple devices?", a: "Yes, most subscriptions support multi-device access. After purchase, you will receive detailed instructions on how to activate on all your devices." },
  { q: "How do I contact support?", a: "Our support team is available 24/7 via WhatsApp at +91 7038146526, Telegram @mfatool, or through our Contact page. Average response time is under 5 minutes." },
]

export function FAQSection() {
  const [open, setOpen] = useState<number | null>(0)
  return (
    <section className="py-20 px-4">
      <div className="max-w-3xl mx-auto">
        <div className="text-center mb-12">
          <h2 className="text-3xl md:text-4xl font-bold mb-3">Frequently Asked Questions</h2>
          <p className="text-slate-400">Got questions? We've got answers.</p>
        </div>
        <div className="space-y-3">
          {FAQS.map((faq, i) => (
            <div key={i} className="glass-card overflow-hidden">
              <button onClick={() => setOpen(open === i ? null : i)} className="w-full flex items-center justify-between p-5 text-left">
                <span className="font-medium pr-4">{faq.q}</span>
                {open === i ? <ChevronUp className="w-5 h-5 text-slate-400 flex-shrink-0" /> : <ChevronDown className="w-5 h-5 text-slate-400 flex-shrink-0" />}
              </button>
              {open === i && <div className="px-5 pb-5 text-slate-400 text-sm leading-relaxed animate-fade-in">{faq.a}</div>}
            </div>
          ))}
        </div>
        <div className="text-center mt-8">
          <Link to="/faq" className="inline-flex items-center gap-2 px-6 py-3 rounded-full border border-white/20 hover:bg-white/5 transition-all text-sm">View All FAQs</Link>
        </div>
      </div>
    </section>
  )
}
