/* Footer.jsx — closing CTA band + site footer */
const { createElement: fh } = React;

function ClosingCTA({ go, title = 'Ready to work together?', sub, cta = 'Contact us', target = 'contact' }) {
  const { Container, GradientButton, GlowField, Kicker } = window;
  return fh('section', { style: { position: 'relative', padding: '120px 0', overflow: 'hidden', borderTop: '1px solid var(--border-1)' } },
    fh(GlowField, { style: { background: 'radial-gradient(70% 120% at 50% 120%, rgba(31,200,210,.16), rgba(67,224,195,.05) 40%, transparent 70%)' } }),
    fh(Container, { style: { position: 'relative', textAlign: 'center' } },
      fh('div', { style: { display: 'flex', justifyContent: 'center', marginBottom: 20 } }, fh(Kicker, null, 'GET STARTED')),
      fh('h2', { style: { fontFamily: 'var(--font-display)', fontWeight: 500, fontSize: 'clamp(34px,5vw,56px)', letterSpacing: '-.03em', lineHeight: 1.05, margin: '0 auto 16px', maxWidth: 720, color: 'var(--fg-1)' } }, title),
      sub && fh('p', { style: { color: 'var(--fg-2)', fontSize: 18, lineHeight: 1.6, maxWidth: 560, margin: '0 auto 34px' } }, sub),
      fh('div', { style: { display: 'flex', gap: 14, justifyContent: 'center', marginTop: sub ? 0 : 34 } },
        fh(GradientButton, { size: 'lg', icon: 'arrow-right', onClick: () => go(target) }, cta)
      )
    )
  );
}

function Footer({ go }) {
  const { Container, Logo, SocialIcons } = window;
  const cols = [
    { h: 'Product', links: [['Why Yottasecure', 'why'], ['The platform', 'about'], ['Book a demo', 'contact']] },
    { h: 'Company', links: [['About', 'about'], ['Our team', 'about'], ['Partners', 'about'], ['RSAC 2026', 'rsac']] },
    { h: 'Support', links: [['Contact', 'contact'], ['Documentation', 'why'], ['Security', 'why'], ['Status', 'why']] },
  ];
  return fh('footer', { style: { borderTop: '1px solid var(--border-1)', background: 'var(--bg-0)', paddingTop: 72, paddingBottom: 36 } },
    fh(Container, null,
      fh('div', { style: { display: 'grid', gridTemplateColumns: '1.6fr 1fr 1fr 1fr', gap: 40, paddingBottom: 56 } },
        fh('div', null,
          fh(Logo, { height: 30, onClick: () => go('home'), tagline: true }),
          fh('p', { style: { color: 'var(--fg-3)', fontSize: 14, lineHeight: 1.6, maxWidth: 280, marginTop: 22 } }, 'Contextual vulnerability intelligence — ANN-powered, trained on the network it defends.'),
          fh('div', { style: { marginTop: 22 } }, fh(SocialIcons, { size: 17, links: { twitter: 'https://x.com/Yottasecure1', linkedin: 'https://www.linkedin.com/company/yottasecure/'} }))
        ),
        cols.map(c => fh('div', { key: c.h },
          fh('div', { className: 'ys-kicker', style: { color: 'var(--fg-2)', marginBottom: 16 } }, c.h.toUpperCase()),
          fh('ul', { style: { listStyle: 'none', margin: 0, padding: 0, display: 'flex', flexDirection: 'column', gap: 11 } },
            c.links.map((l, i) => fh('li', { key: i },
              fh('button', { onClick: () => go(l[1]), className: 'ys-foot', style: { background: 'none', border: 'none', padding: 0, cursor: 'pointer', color: 'var(--fg-3)', fontSize: 14, fontFamily: 'var(--font-sans)', transition: 'color var(--dur)', textAlign: 'left' } }, l[0])
            ))
          )
        ))
      ),
      fh('div', { style: { borderTop: '1px solid var(--border-1)', paddingTop: 24, display: 'flex', justifyContent: 'space-between', alignItems: 'center', flexWrap: 'wrap', gap: 12 } },
        fh('span', { style: { color: 'var(--fg-4)', fontFamily: 'var(--font-mono)', fontSize: 12 } }, '© 2026 Yottasecure, Inc. All rights reserved.'),
        fh('div', { style: { display: 'flex', gap: 22 } },
          ['Privacy', 'Terms', 'Security'].map(t => fh('a', { key: t, href: '#', onClick: e => e.preventDefault(), className: 'ys-foot', style: { color: 'var(--fg-4)', fontFamily: 'var(--font-mono)', fontSize: 12, textDecoration: 'none' } }, t))
        )
      )
    )
  );
}
Object.assign(window, { Footer, ClosingCTA });
