// mockups.jsx — fake product mockups in HTML/CSS

// Small inline SVG icons (Lucide-style strokes)
const Icons = {
  cal: (p={}) => { const s = typeof p === "object" ? (p.size || 20) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"><rect x="3" y="5" width="18" height="16" rx="2"/><path d="M16 3v4M8 3v4M3 10h18"/></svg>); },
  stethoscope: (p={}) => { const s = typeof p === "object" ? (p.size || 20) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"><path d="M4 4v6a5 5 0 0 0 10 0V4"/><circle cx="18" cy="14" r="2.5"/><path d="M9 14v3a5 5 0 0 0 6.5 4.8"/></svg>); },
  people: (p={}) => { const s = typeof p === "object" ? (p.size || 20) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"><path d="M16 19v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="3"/><path d="M22 19v-2a4 4 0 0 0-3-3.8"/><path d="M16 4.2a3 3 0 0 1 0 5.6"/></svg>); },
  coin: (p={}) => { const s = typeof p === "object" ? (p.size || 20) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"><circle cx="12" cy="12" r="9"/><path d="M14.8 9.5a3 3 0 0 0-5.6 1c0 2.7 5.6 1.5 5.6 4.2a3 3 0 0 1-5.6 1M12 6.5v11"/></svg>); },
  megaphone: (p={}) => { const s = typeof p === "object" ? (p.size || 20) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"><path d="M3 11v2a2 2 0 0 0 2 2h2l8 5V4l-8 5H5a2 2 0 0 0-2 2Z"/><path d="M18 8a5 5 0 0 1 0 8"/></svg>); },
  register: (p={}) => { const s = typeof p === "object" ? (p.size || 20) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"><rect x="3" y="4" width="18" height="6" rx="1.5"/><rect x="3" y="14" width="18" height="6" rx="1.5"/><path d="M7 7h2M7 17h2M14 17h3"/></svg>); },
  globe: (p={}) => { const s = typeof p === "object" ? (p.size || 20) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/></svg>); },
  phone: (p={}) => { const s = typeof p === "object" ? (p.size || 20) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"><rect x="7" y="2" width="10" height="20" rx="2.5"/><path d="M11 18h2"/></svg>); },
  spark: (p={}) => { const s = typeof p === "object" ? (p.size || 20) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"><path d="M12 3v4M12 17v4M3 12h4M17 12h4M5.6 5.6l2.8 2.8M15.6 15.6l2.8 2.8M5.6 18.4l2.8-2.8M15.6 8.4l2.8-2.8"/></svg>); },
  bolt: (p={}) => { const s = typeof p === "object" ? (p.size || 20) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"><path d="M13 2 4 14h7l-1 8 9-12h-7l1-8Z"/></svg>); },
  shield: (p={}) => { const s = typeof p === "object" ? (p.size || 20) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z"/><path d="m9 12 2 2 4-4"/></svg>); },
  layers: (p={}) => { const s = typeof p === "object" ? (p.size || 20) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"><path d="M12 2 2 7l10 5 10-5-10-5Z"/><path d="m2 17 10 5 10-5M2 12l10 5 10-5"/></svg>); },
  pawprint: (p={}) => { const s = typeof p === "object" ? (p.size || 20) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"><circle cx="6" cy="9" r="2"/><circle cx="10" cy="5" r="2"/><circle cx="14" cy="5" r="2"/><circle cx="18" cy="9" r="2"/><path d="M8 14a4 4 0 0 1 8 0c0 3-2 3-2 5a2 2 0 1 1-4 0c0-2-2-2-2-5Z"/></svg>); },
  search: (p={}) => { const s = typeof p === "object" ? (p.size || 20) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg>); },
  book: (p={}) => { const s = typeof p === "object" ? (p.size || 20) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"><path d="M4 4v16a2 2 0 0 1 2-2h14V2H6a2 2 0 0 0-2 2Z"/></svg>); },
  code: (p={}) => { const s = typeof p === "object" ? (p.size || 20) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"><path d="m8 6-6 6 6 6M16 6l6 6-6 6M14 4l-4 16"/></svg>); },
  mail: (p={}) => { const s = typeof p === "object" ? (p.size || 20) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"><rect x="2" y="4" width="20" height="16" rx="2"/><path d="m2 7 10 7 10-7"/></svg>); },
  chat: (p={}) => { const s = typeof p === "object" ? (p.size || 20) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" strokeLinecap="round" strokeLinejoin="round"><path d="M21 12a8 8 0 0 1-12 7l-5 1 1-5a8 8 0 1 1 16-3Z"/></svg>); },
  arrow: (p={}) => { const s = typeof p === "object" ? (p.size || 14) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M5 12h14M13 5l7 7-7 7"/></svg>); },
  check: (p={}) => { const s = typeof p === "object" ? (p.size || 14) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"><path d="m4 12 5 5L20 6"/></svg>); },
  plus: (p={}) => { const s = typeof p === "object" ? (p.size || 14) : p; return (<svg width={s} height={s} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M12 5v14M5 12h14"/></svg>); },
};

// ── Brand mark / logo ──
function ZoeeMark({ size = 30 }) {
  return (
    <div className="brand-mark" style={{ width: size, height: size, fontSize: size * 0.55, borderRadius: size * 0.3 }}>
      <span style={{ position: 'relative', zIndex: 2, lineHeight: 1, fontWeight: 800, letterSpacing: '-0.04em' }}>Z</span>
    </div>
  );
}

// ── Hero dashboard mockup ──
function HeroMockup() {
  return (
    <div className="hero-visual">
      <div className="laptop">
        <div className="lp-topbar">
          <div className="lp-dot r"></div><div className="lp-dot y"></div><div className="lp-dot g"></div>
          <div className="lp-url"><span style={{opacity:0.5,marginRight:6}}>🔒</span>app.zoee.pet/dashboard</div>
        </div>
        <div className="lp-body">
          <aside className="lp-side">
            <div className="lp-brand"><ZoeeMark size={22}/> Zoee</div>
            <div className="lp-nav active"><span className="ico" style={{background:'#A5B4FC'}}>A</span>{tx('Schedule','Agenda')}</div>
            <div className="lp-nav"><span className="ico" style={{background:'#F8A5C2'}}>C</span>{tx('Clinical','Atendimento')}</div>
            <div className="lp-nav"><span className="ico" style={{background:'#86EFAC'}}>R</span>CRM</div>
            <div className="lp-nav"><span className="ico" style={{background:'#FCD34D'}}>F</span>{tx('Finance','Financeiro')}</div>
            <div className="lp-sect">{tx('More modules','Mais módulos')}</div>
            <div className="lp-nav"><span className="ico" style={{background:'#FFB199'}}>M</span>Marketing</div>
            <div className="lp-nav"><span className="ico" style={{background:'#818CF8'}}>P</span>{tx('POS','PDV')}</div>
            <div className="lp-nav"><span className="ico" style={{background:'#67E8F9'}}>D</span>{tx('Directory','Diretório')}</div>
          </aside>

          <main className="lp-main">
            <div className="lp-h">
              <h4>{tx('Good morning, Dr. Reis','Bom dia, Dra. Camila')}</h4>
              <span className="sub">{tx('Tue · May 14','terça · 14 mai')}</span>
            </div>
            <div className="lp-kpis">
              <div className="lp-kpi"><div className="lbl">{tx('Today','Hoje')}</div><div className="val">14</div><div className="delta">{tx('+2 vs yest.','+2 ontem')}</div></div>
              <div className="lp-kpi"><div className="lbl">{tx('Week revenue','Receita semana')}</div><div className="val">{tx('$18.4k','R$ 18,4k')}</div><div className="delta">{tx('+12.4%','+12,4%')}</div></div>
              <div className="lp-kpi"><div className="lbl">{tx('Win-backs','Reativações')}</div><div className="val">7</div><div className="delta">{tx('AI','IA')}</div></div>
            </div>
            <div className="lp-list">
              <div className="lp-li"><div className="lp-av">L</div><div className="who">{tx('Luna · Golden 4y','Luna · Golden 4a')}<small>{tx('V10 vaccine','Vacina V10')}</small></div><div className="lp-tag g">{tx('confirmed','confirmado')}</div><div className="time">09:00</div></div>
              <div className="lp-li"><div className="lp-av b">T</div><div className="who">{tx('Thor · Bulldog 6y','Thor · Bulldog 6a')}<small>{tx('Derm consult','Consulta dermato')}</small></div><div className="lp-tag o">{tx('unconfirmed','a confirmar')}</div><div className="time">10:30</div></div>
              <div className="lp-li"><div className="lp-av g">M</div><div className="who">{tx('Mel · Mixed 2y','Mel · SRD 2a')}<small>{tx('Bath + groom','Banho + tosa')}</small></div><div className="lp-tag b">{tx('checked in','na clínica')}</div><div className="time">11:00</div></div>
              <div className="lp-li"><div className="lp-av y">B</div><div className="who">{tx('Bento · Persian 8y','Bento · Persa 8a')}<small>{tx('Cardio follow-up','Retorno cardio')}</small></div><div className="lp-tag g">{tx('confirmed','confirmado')}</div><div className="time">14:00</div></div>
            </div>
          </main>

          <aside className="lp-ai">
            <div className="lp-ai-hd"><div className="pulse"></div>Cowork<span className="name">claude-haiku</span></div>
            <div className="lp-msg user"><div className="lbl">{tx('You','Você')}</div>{tx('Create an agent that confirms bookings 24h ahead over WhatsApp.','Crie um agente que confirma agendamentos 24h antes via WhatsApp.')}</div>
            <div className="lp-msg ai"><div className="lbl">Cowork</div>{tx('Done. The ','Pronto. O agente ')}<b>Confirm-Bot</b>{tx(' agent sends at 6pm. Review it before activating.',' dispara mensagens às 18h. Use os botões pra revisar antes de ativar.')}<div className="chip">{tx('⚙ agent.confirm_24h','⚙ agent.confirmar_24h')}</div></div>
            <div className="lp-input"><span>{tx('Ask, request, automate…','Pergunte, peça, automatize...')}</span><div className="caret"></div></div>
          </aside>
        </div>
      </div>

      <div className="phone">
        <div className="phone-screen">
          <div className="phone-status"><span>9:41</span><span>●●● 5G</span></div>
          <div className="phone-h">{tx('Hi, Julia','Olá, Júlia')} <small>Luna · Thor · Mel</small></div>
          <div className="phone-card">
            <div className="pet">{tx('Luna 🐕 · Next visit','Luna 🐕 · Próxima consulta')}</div>
            <div className="meta">{tx('Pata Feliz · Dr. Reis','Pata Feliz · Dra. Camila')}</div>
            <div className="row"><span>{tx('Tomorrow 9:00','Amanhã 09:00')}</span><span className="pill">{tx('V10 vaccine','vacina V10')}</span></div>
          </div>
          <div className="phone-item"><div className="av">L</div><div><div className="who">{tx('V10 vaccine','Vacina V10')}<small>{tx('Reminder tomorrow','Lembrete amanhã')}</small></div></div><div className="when">8h</div></div>
          <div className="phone-item"><div className="av">M</div><div><div className="who">{tx('Mel · Bath','Mel · Banho')}<small>{tx('Saturday 11am','Sábado 11h')}</small></div></div><div className="when">2d</div></div>
          <div className="phone-item"><div className="av">T</div><div><div className="who">{tx('Thor · Rx','Thor · Receita')}<small>{tx('Apoquel available','Apoquel disponível')}</small></div></div><div className="when">{tx('1w','1s')}</div></div>
        </div>
      </div>
    </div>
  );
}

// ── Cowork conversational mockup ──
function CoworkMockup() {
  return (
    <div className="cowork">
      <div className="cw-tabs">
        <div className="cw-tab active">{tx('/clinical','/clinica')}</div>
        <div className="cw-tab">/crm</div>
        <div className="cw-tab">{tx('/finance','/financeiro')}</div>
        <div className="cw-tab">+ tab</div>
      </div>
      <div className="cw-msg user">
        <div className="lbl">{tx('You','Você')}</div>
        {tx('List the 5 owners who haven\u2019t returned in over 90 days and draft a win-back message.','Liste os 5 tutores que não voltam há mais de 90 dias e gere mensagem de reativação.')}
      </div>
      <div className="cw-msg">
        <div className="lbl">Cowork</div>
        {tx('I found 47 lapsed owners. Here are the 5 with the highest lifetime value:','Encontrei 47 tutores inativos. Aqui estão os 5 com maior LTV histórico:')}
        <div className="cw-table">
          <div className="cw-tr head"><div>{tx('Owner · Pet','Tutor · Pet')}</div><div>{tx('Days','Dias')}</div><div className="right">LTV</div></div>
          <div className="cw-tr"><div>{tx('Julia · Luna 🐕','Júlia · Luna 🐕')}</div><div>118</div><div className="right">{tx('$4.2k','R$ 4.2k')}</div></div>
          <div className="cw-tr"><div>Pedro · Bento 🐈</div><div>104</div><div className="right">{tx('$3.8k','R$ 3.8k')}</div></div>
          <div className="cw-tr"><div>Renata · Mel 🐕</div><div>96</div><div className="right">{tx('$2.9k','R$ 2.9k')}</div></div>
        </div>
        <div className="cw-tool">{tx('tool.win_back_owners · created just now','tool.reativar_tutores · criada agora')}</div>
      </div>
      <div className="cw-input">
        <span>{tx('Ask, request, automate…','Pergunte, peça, automatize...')}</span>
        <div className="caret"></div>
        <div className="cw-models">
          <div className="cw-model">claude</div>
          <div className="cw-model">gpt-5</div>
          <div className="cw-model">gemini</div>
        </div>
      </div>
    </div>
  );
}

// ── Generic module mockup for module detail pages ──
function ModuleMockup({ moduleId, color }) {
  const m = MODULE_LONG[moduleId];
  if (!m) return null;

  return (
    <div className="mod-mockup">
      <div className="lp-topbar">
        <div className="lp-dot r"></div><div className="lp-dot y"></div><div className="lp-dot g"></div>
        <div className="lp-url"><span style={{opacity:0.5,marginRight:6}}>🔒</span>app.zoee.pet/{moduleId}</div>
      </div>
      <div className="mm-body" style={{ '--mm-color': color || m.color }}>
        <div className="mm-h">
          <div>
            <div className="mm-eyebrow">{m.eyebrow}</div>
            <h4>{m.pitch}</h4>
          </div>
          <div className="mm-pulse"></div>
        </div>
        <div className="mm-grid">
          {m.metrics.map((mt, i) => (
            <div key={i} className="mm-metric">
              <div className="v">{mt.v}</div>
              <div className="l">{mt.l}</div>
            </div>
          ))}
        </div>
        <div className="mm-rows">
          {m.feats?.slice(0,5).map?.((f,i)=>(
            <div key={i} className="mm-row">
              <span className="dot"></span>{f}
            </div>
          )) || MODULES.find(x=>x.id===moduleId).feats.map((f,i)=>(
            <div key={i} className="mm-row"><span className="dot"></span>{f}</div>
          ))}
        </div>
      </div>
    </div>
  );
}

Object.assign(window, { Icons, ZoeeMark, HeroMockup, CoworkMockup, ModuleMockup });
