/* FAQs — accordion list. Only one item is open at a time. Edit the
   `items` array to change questions and answers. */
const { useState: useState_faqs } = React;

const FAQItem = ({ q, a, open, onClick }) => (
  <div className={`faq${open ? ' is-open' : ''}`}>
    <button onClick={onClick} className="faq-button">
      <span className="faq-q">{q}</span>
      <span className="faq-toggle">
        <svg width="14" height="14" viewBox="0 0 14 14"><path d="M7 1V13M1 7H13" stroke="#1a1a1a" strokeWidth="1.5" strokeLinecap="round"/></svg>
      </span>
    </button>
    <div className="faq-collapse">
      <div className="faq-body">{a}</div>
    </div>
  </div>
);

const FAQs = () => {
  const [open, setOpen] = useState_faqs(0);
  const items = [
    { q:"So… what's the catch?",
      a:"None. If you aren't yet generating revenue you might not be able to afford $20k upfront, so we built the profit share option - we take all the risk and only earn when you earn. The only thing we ask is that we agree on a marketing plan together, and that you actually run it. (If you ghost the marketing, we reserve the right to pause access.)" },
    { q:"What are the ongoing costs?",
      a:"We offer ongoing maintenance as a flat monthly fee (servers, updates, App Store fees, bug fixes) - the actual amount will depend on factors such as the size of your user base and app complexity. You are also welcome to handle this yourself. In the profit share model, we deduct from your revenue automatically. On months where downloads are quiet, we just ask you to top it up." },
    { q:"How much money can I make?",
      a:"Your pricing and revenue potential is up to you. You can make money overnight if you have the right marketing plan & offer in place, but it will also depend on other factors like your audience size, engagement, value of your product etc. If you aren't sure about how much to charge for your app, we can help put in place a strategy based on market research and industry best practice." },
    { q:"How long does it take to build?",
      a:"Typically an app takes 6+ months to launch, but we aim to get you live much faster. A simple coaching program + library + community can be ready to launch on the App Store as quickly as 4-5 weeks (+ Apple approval process), especially if you are clear on what you want and already have branding & content in place. If your app is more comprehensive and has more to set up from scratch, then it will naturally need more time to get ready." },
    { q:"Do I own the app?",
      a:"For upfront payment, you own the app from the start. For profit share, we own the app (excluding your proprietary content), but you have the option to take ownership of the app later on based on an agreed price schedule." },
    { q:"Can I add features later?",
      a:"We win if you win, so if you have more ideas down the line we can look at building those out later on." },
  ];

  return (
    <section>
      <div className="container">
        <div className="section-head faqs-head">
          <div>
            <div className="eyebrow">FAQS</div>
            <h2>Questions, <span className="it">answered.</span></h2>
          </div>
          <div className="faqs-head-sub">
            Still got something on your mind? Ask us on the discovery call.
          </div>
        </div>

        <div className="faqs-list">
          {items.map((it, i) => (
            <FAQItem
              key={i}
              q={it.q}
              a={it.a}
              open={open === i}
              onClick={() => setOpen(open === i ? -1 : i)}
            />
          ))}
        </div>
      </div>
    </section>
  );
};

window.AAS = window.AAS || {};
window.AAS.FAQs = FAQs;
