import {
  Accordion,
  AccordionContent,
  AccordionItem,
  AccordionTrigger,
} from "@/components/ui/accordion";

const faqs = [
  // Getting Started
  {
    question: "What is T-kash Soko?",
    answer: "T-kash Soko by Telkom Kenya is an all-in-one merchant and consumer app. Merchants can sell products and services, manage inventory, accept payments (T-kash, M-PESA, bank apps, cash), track sales, and manage employees. Consumers can shop, pay bills, book services, and send money—all with zero transaction fees when using T-kash."
  },
  {
    question: "Why do I need KYC (verification)?",
    answer: "KYC is required to activate your merchant account, get a T-kash wallet, and enable you to receive payments."
  },
  {
    question: "Face scan is not working. What can I do?",
    answer: "Try these steps: Wipe/clean your camera lens, stand in good light (bright indoor light or daylight), hold your phone steady, keep your face straight and fully inside the frame until the process finishes, and don't look down at the last moment."
  },
  {
    question: "It says 'Fake ID'. What does that mean?",
    answer: "This usually happens when the camera is unclear or lighting is poor. Try again after cleaning the camera, using brighter lighting, and making sure the original ID is clear and fully visible."
  },
  // PIN Help
  {
    question: "I forgot my Soko PIN. What should I do?",
    answer: "If you have NOT completed KYC yet, you can reset/change your PIN inside the Soko app (Settings → PIN code). If you have completed KYC and have a T-Kash wallet, PIN changes are handled by Telkom Customer Care—call 100 from a Telkom line or 020 222 1000 from other networks."
  },
  {
    question: "Can I use T-kash without a Telkom line?",
    answer: "Yes! You do not need a Telkom line. T-Kash works across all networks."
  },
  // Payments
  {
    question: "What payment methods can I accept?",
    answer: "You can accept payments from T-kash Soko users (zero fees for customers), M-PESA, any KE-QR compatible bank app (KCB, Co-op, NCBA, etc.), and cash. All payments are tracked in one app with digital receipts."
  },
  {
    question: "Can customers pay using M-Pesa?",
    answer: "Yes! Customers can pay using the USSD flow (e.g. *334#). Note: KE-QR is not supported by M-Pesa at the moment."
  },
  {
    question: "How long does a payment take to reflect?",
    answer: "Normally it reflects immediately after a successful payment, unless there is a network delay."
  },
  {
    question: "Customer paid but I don't see the money. What should I do?",
    answer: "First, log out of the Soko app and log in again. Then confirm the customer completed the payment and received confirmation. Also ensure the payment was made soon after checkout (ideally within 20 minutes). Important: If a checkout is created but payment is sent too late, it may fail to reflect properly."
  },
  // Fees & Charges
  {
    question: "How much does T-kash Soko cost?",
    answer: "T-kash Soko has no subscription fees. You only pay a 1% platform fee on each sale. This replaces expensive monthly subscriptions for POS systems (3,000-8,000 KSH), inventory management (2,000-6,000 KSH), online sales (3,000-10,000 KSH), accounting (4,000-12,000 KSH), CRM (2,000-7,000 KSH), and employee management (4,000-12,000 KSH)—saving you up to 55,000 KSH per month."
  },
  {
    question: "What platform fees are charged when selling?",
    answer: "Below KSh 100, the fee is KSh 1. Above KSh 100, the fee is 1% of the sale amount."
  },
  {
    question: "Why did my platform fee look higher than expected?",
    answer: "If you made some cash sales in between digital sales, any unpaid service fees can be deducted from the next digital payment."
  },
  {
    question: "What about cash payments and platform fees?",
    answer: "Every user gets 50 KSH in platform fee credits for cash payments. Platform fees for cash sales are accumulated until settled. You must settle before the debt reaches -50 KSH. Fees are deducted from your next digital payment or can be settled manually."
  },
  // Features
  {
    question: "How does the lottery system work?*",
    answer: "Both merchants and consumers earn lottery tickets! Every transaction of minimum 200 KSH qualifies. Consumers earn 1 ticket per qualifying purchase. Merchants earn tickets based on how customers pay: T-kash Soko payments earn 4 tickets, external wallet/bank payments earn 2 tickets, and cash payments earn 1 ticket. Monthly draws give you a chance to win up to 1,000,000 KSH. *Lottery feature will be active from February 2026."
  },
  {
    question: "How do I manage employees?",
    answer: "Each employee logs in with their own vetted account. You can set role-based access, track their sales activity, use geo-fencing to ensure they only sell from your shop location, and pay salaries directly through T-kash Soko."
  },
  {
    question: "What is geo-fencing?",
    answer: "Geo-fencing is a location-based control that ensures your employees can only make sales from your designated shop locations. This prevents fraud and unauthorized transactions from other locations."
  },
  {
    question: "How does credit scoring work?",
    answer: "T-kash Soko uses AI to build your credit profile based on your real transaction history. Every sale you make contributes to your credit score, which can help you qualify for business loans in the future."
  },
  {
    question: "What is the Pay Later feature?",
    answer: "Pay Later allows you to offer customers flexible payment terms of 7, 14, or 30 days. This helps you attract more customers and earn additional fees while providing convenience to buyers."
  },
  {
    question: "Can I use T-kash Soko for personal shopping?",
    answer: "Yes! T-kash Soko has two profiles—merchant and personal. With your personal profile, you can shop from local stores, book services, pay bills, send money, and enjoy zero fees when paying with T-kash. Plus, every purchase of 200 KSH or more earns you lottery tickets!*"
  },
  // App & Data
  {
    question: "Does T-kash Soko use my mobile data?",
    answer: "T-kash Soko uses free data when your phone has a Telkom SIM. This means you can run your business without worrying about data costs."
  },
  {
    question: "Should I update the app?",
    answer: "Yes—always update to the latest version from the Google Play Store to avoid errors and improve performance."
  },
  // Support
  {
    question: "Who do I call for help (PIN issues, account help, etc.)?",
    answer: "Contact Telkom Customer Care: Call 100 from a Telkom line, or 020 222 1000 from other networks."
  }
];

export default function FAQSection() {
  return (
    <section id="faq" className="py-20 bg-gray-50">
      <div className="max-w-4xl mx-auto px-4">
        <div className="text-center mb-12">
          <h2 className="text-3xl md:text-4xl font-bold text-gray-900 mb-4">
            Frequently Asked Questions
          </h2>
          <p className="text-lg text-gray-600">
            Everything you need to know about T-kash Soko
          </p>
        </div>
        
        <Accordion type="single" collapsible className="space-y-4">
          {faqs.map((faq, index) => (
            <AccordionItem 
              key={index} 
              value={`item-${index}`}
              className="bg-white border border-gray-200 rounded-xl px-6 data-[state=open]:border-telkom-turquoise/50 data-[state=open]:shadow-md transition-all"
              data-testid={`faq-item-${index}`}
            >
              <AccordionTrigger className="text-left font-semibold text-gray-900 hover:text-telkom-orange py-5">
                {faq.question}
              </AccordionTrigger>
              <AccordionContent className="text-gray-600 pb-5 leading-relaxed">
                {faq.answer}
              </AccordionContent>
            </AccordionItem>
          ))}
        </Accordion>
      </div>
    </section>
  );
}
