import React, { useState } from "react";
import { FiChevronDown, FiChevronUp } from "react-icons/fi";

export default function Faq() {
  const [openIndex, setOpenIndex] = useState<number | null>(null);

  const faqs = [
    {
      question: "What is Happy Home Creators and how is it different from a regular dating site?",
      answer:
        "Happy Home Creators is a bespoke matchmaking service dedicated to helping individuals find compatible life partners. Unlike typical dating sites, we don't feature public profiles, microblogging, or endless scrolling. Our service is based on a discreet, intelligent matchmaking algorithm that handles all the heavy lifting, connecting you directly with individuals who truly align with your values and aspirations for a 'happy home'. While primarily designed for Nigerians in Nigeria and the diaspora, we warmly welcome non-Nigerians who are seeking meaningful connections.",
    },
    {
      question: "How does the matchmaking process work?",
      answer:
        "Once you join Happy Home Creators, you'll complete a comprehensive profile that helps our algorithm understand your preferences, values, and what you're seeking in a partner. Our advanced system then meticulously analyzes this information to identify highly compatible matches for you. We believe in quality over quantity, presenting you with carefully selected individuals rather than a vast, unfiltered pool of profiles.",
    },
    {
      question: "What kind of information do I need to provide to join?",
      answer:
        "To ensure accurate and meaningful matches, we require detailed information about your background, lifestyle, relationship goals, medical history, values, and preferred qualities in a partner. This includes aspects relevant to Nigerian culture and diaspora experiences, as well as general relationship preferences. All information is handled with the utmost confidentiality.",
    },
    {
      question: "Is my privacy protected?",
      answer:
        "Absolutely. Your privacy is a cornerstone of our service. We do not display your profile publicly, and there is no microblogging or public interaction. All matches are introduced to you privately, maintaining a high level of discretion throughout your journey. Your personal data is securely stored and never shared without your consent."
    },
    {
      question: "How are matches determined?",
      answer:
        "Our proprietary matchmaking algorithm goes beyond superficial details. It considers a wide range of factors including shared values, family aspirations, cultural background, medical history, lifestyle compatibility, and long-term relationship goals. This holistic approach helps us identify individuals who are genuinely suited for a lasting partnership and a happy home.",
    },
    {
      question: "Do I get to view my matches and contact them?",
      answer:
       "Yes! When our algorithm identifies a highly compatible match for you, we will present you with their profile. If there's mutual interest, and after a token payment has been made, you will both be able to view each other's full profiles and initiate contact directly through our secure platform. This ensures that every interaction is intentional and valued."
    },
    {
      question: " Is Happy Home Creators only for Nigerians?",
      answer: "No, while our service is primarily designed to cater to Nigerians both within the country and in the diaspora, we warmly welcome non-Nigerians who are genuinely seeking a serious relationship and are open to connecting with our diverse community."
    },
    {
      question: "What is the success rate of Happy Home Creators?",
      answer: "While we cannot guarantee a specific outcome for every individual, our focus on deliberate, algorithm-driven matchmaking for genuine compatibility significantly increases the likelihood of finding a successful and lasting partnership. We are committed to supporting you in your search for your happy home."
    },
    {
      question: "What if I don't find a match immediately?",
      answer: "Finding the right partner is a journey, and sometimes it takes time. Our algorithm continuously works to identify new potential matches as our community grows and evolves. We encourage patience and open communication with our team as we strive to find your perfect match."
    },
    {
      question: "How do I get started?",
      answer: "Getting started is simple! Click on 'Create your profile' and complete your profile to begin your journey to a happy home."
    }
  ];

  const toggleAccordion = (index: number) => {
    setOpenIndex(openIndex === index ? null : index);
  };

  return (
    <div className="w-full bg-[#D9D9D980] py-12">
      <div className="max-w-6xl mx-auto px-4">
        <h2 className="text-xl text-center mb-10 font-[600] text-[22px]">
          Frequently Asked Questions
        </h2>
        <div className="grid md:grid-cols-2 gap-8">
          {faqs.map((faq, index) => (
            <div key={index} className="text-center">
              <div
                onClick={() => toggleAccordion(index)}
                className="flex justify-between items-center cursor-pointer font-medium mb-2 text-[18px]"
              >
                <h3 className="text-left">{faq.question}</h3>
                <span className="ml-4 text-base">
                  {openIndex === index ? <FiChevronUp /> : <FiChevronDown />}
                </span>
              </div>

              <div
                className={`overflow-hidden transition-all duration-300 ease-in-out ${
                  openIndex === index ? "max-h-64 opacity-100" : "max-h-0 opacity-0"
                }`}
              >
                <p className="text-[16px] text-left leading-7">{faq.answer}</p>
              </div>
            </div>
          ))}
        </div>
      </div>
    </div>
  );
}
