"use client"

import { useState } from "react"
import Link from "next/link"

const FAQS = [
  { q: "How do I get started with our service?", a: "Lorem ipsum dolor sit amet consectetur ornare dui amet ultrices sed fermentum euismod dictum ut pellentesque aliquet nunc massa sed nisl pretium enim placerat." },
  { q: "Can AI solutions help my business?", a: "Lorem ipsum dolor sit amet consectetur ornare dui amet ultrices sed fermentum euismod dictum ut pellentesque aliquet nunc massa sed nisl pretium enim placerat." },
  { q: "How is ethical AI development ensured?", a: "Lorem ipsum dolor sit amet consectetur ornare dui amet ultrices sed fermentum euismod dictum ut pellentesque aliquet nunc massa sed nisl pretium enim placerat." },
  { q: "What role does QuantumLab Computing play in AI research?", a: "Lorem ipsum dolor sit amet consectetur ornare dui amet ultrices sed fermentum euismod dictum ut pellentesque aliquet nunc massa sed nisl pretium enim placerat." },
]

export default function CardsSection() {
  const [openIndex, setOpenIndex] = useState<number | null>(null)
  return (
    <section className="section-small">
      <div className="w-layout-blockcontainer container-default w-container">
        <div className="w-layout-grid faqs-v1-wrapper">
          <div className="sticky-top static-mbl">
            <div data-w-id="e69dfbb3-1a44-4cc6-11e0-94df71efbf76" style={{"opacity": "0", "filter": "blur(8px)"}} className="inner-container _260px _100-mbl">
              <div className="subtitle">
                  </div>
              <div className="mg-top-4x-extra-small">
                <h2>Have questions?</h2>
              </div>
              <div className="mg-top-4x-extra-small">
                <p>
    ipsum dolor sit amet consectetur nec quis suspendisse nulla.                  </p>
              </div>
              <div className="mg-top-2x-extra-small">
                <div className="buttons-row left">
                  <a id="w-node-_99805214-dd54-e7f3-2549-05c0df1040fb-df1040fb" data-wf--primary-button--variant="base" data-w-id="99805214-dd54-e7f3-2549-05c0df1040fb" href="mailto:support@quantum.com" className="primary-button w-inline-block" target="_blank" rel="noopener noreferrer">
                    <div className="button-content">
                      <div>
    Get support</div>
                      <div className="button-icon-wrapper primary">
                        <svg xmlns="http://www.w3.org/2000/svg" width="100%" viewBox="0 0 17 17" fill="none" className="squared-icon">
                          <path d="M6.25391 3.45312L10.7458 8.01563L6.25391 12.5781" stroke="currentColor" strokeWidth="1.5" strokeLinecap="square">
                          </path>
                        </svg>
                        <div className="button-icon-bg">
                        </div>
                        <div className="button-icon-bg-inside">
                        </div>
                      </div>
                    </div>
                  </a>
                </div>
              </div>
            </div>
          </div>
          <div className="w-layout-grid faqs-v1-grid">
            {FAQS.map((faq, i) => (
              <div key={i} className="card-accordion-v1-wrapper sibling-blur-item" onClick={() => setOpenIndex(openIndex === i ? null : i)} style={{ cursor: "pointer" }}>
                <div className="card accordion-card-v1">
                  <div className="accordion-number">
                    <div>{String(i + 1).padStart(2, "0")}</div>
                  </div>
                  <div className="accordion-content">
                    <h3 className="accordion-title">{faq.q}</h3>
                    <div className="accordion-body" style={{ maxHeight: openIndex === i ? "200px" : "0px", overflow: "hidden", transition: "max-height 0.3s ease" }}>
                      <p className="mg-top-4x-extra-small">{faq.a}</p>
                    </div>
                  </div>
                  <div className="accordion-arrow" style={{ transform: openIndex === i ? "rotate(180deg)" : "rotate(0deg)", transition: "transform 0.3s ease" }}>
                    <svg xmlns="http://www.w3.org/2000/svg" width="100%" viewBox="0 0 20 20" fill="none">
                      <path d="M15.5 7.03847L10 12.9615L4.5 7.03847" stroke="currentColor" strokeWidth="1.5" strokeLinecap="square" />
                    </svg>
                  </div>
                </div>
              </div>
            ))}
          </div>
        </div>
      </div>
    </section>
  )
}
