// ZIADFILMING — Shared primitives: pill buttons, chips, icons.

const btnBase = {
  display: 'inline-flex', alignItems: 'center', gap: 12,
  borderRadius: 9999, fontSize: 13, fontWeight: 700,
  letterSpacing: '0.1em', textTransform: 'uppercase',
  cursor: 'pointer', border: 'none', transition: 'all 250ms var(--ease-standard)',
  fontFamily: 'var(--font-sans)', textDecoration: 'none',
};

function PillPrimary({ children, onClick, size = 'md' }) {
  const [hover, setHover] = React.useState(false);
  const [press, setPress] = React.useState(false);
  const pad = size === 'lg' ? '20px 48px' : '16px 40px';
  return (
    <button style={{ ...btnBase, padding: pad,
        background: hover ? '#e4e4e7' : '#fff', color: '#000',
        transform: press ? 'scale(0.97)' : 'scale(1)' }}
      onMouseEnter={() => setHover(true)} onMouseLeave={() => { setHover(false); setPress(false); }}
      onMouseDown={() => setPress(true)} onMouseUp={() => setPress(false)}
      onClick={onClick}>{children}</button>
  );
}

function PillSecondary({ children, onClick }) {
  const [hover, setHover] = React.useState(false);
  return (
    <button style={{ ...btnBase, padding: '16px 32px',
        background: hover ? '#27272a' : '#18181b', color: '#fff', border: '1px solid #27272a' }}
      onMouseEnter={() => setHover(true)} onMouseLeave={() => setHover(false)}
      onClick={onClick}>{children}</button>
  );
}

function PillGhost({ children, onClick }) {
  const [hover, setHover] = React.useState(false);
  return (
    <button style={{ ...btnBase, padding: '16px 40px',
        background: hover ? 'rgba(255,255,255,0.1)' : 'transparent', color: '#fff',
        border: '1px solid rgba(255,255,255,0.2)' }}
      onMouseEnter={() => setHover(true)} onMouseLeave={() => setHover(false)}
      onClick={onClick}>{children}</button>
  );
}

function Chip({ children }) {
  return <span style={{
    padding: '10px 20px', borderRadius: 9999, border: '1px solid #27272a',
    fontSize: 11, letterSpacing: '0.1em', textTransform: 'uppercase', color: '#a1a1aa',
    fontFamily: 'var(--font-sans)',
  }}>{children}</span>;
}

// Icons (inline Lucide SVGs)
const Icon = {
  ArrowRight: (p) => <svg width={p.size||18} height={p.size||18} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg>,
  ArrowLeft: (p) => <svg width={p.size||14} height={p.size||14} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M19 12H5"/><path d="m12 19-7-7 7-7"/></svg>,
  Play: (p) => <svg width={p.size||18} height={p.size||18} viewBox="0 0 24 24" fill={p.fill||"currentColor"} stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><polygon points="6 3 20 12 6 21 6 3"/></svg>,
  Instagram: (p) => <svg width={p.size||20} height={p.size||20} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><rect width="20" height="20" x="2" y="2" rx="5"/><circle cx="12" cy="12" r="4"/><circle cx="18" cy="6" r="1"/></svg>,
  Message: (p) => <svg width={p.size||20} height={p.size||20} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/></svg>,
  Mail: (p) => <svg width={p.size||20} height={p.size||20} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/><polyline points="22,6 12,13 2,6"/></svg>,
  MapPin: (p) => <svg width={p.size||20} height={p.size||20} viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"/><circle cx="12" cy="10" r="3"/></svg>,
};

Object.assign(window, { PillPrimary, PillSecondary, PillGhost, Chip, Icon });
