// Icons | line-style, 1.6 stroke, warm but professional
// All take size + color props

const iconBase = (size, children, opts = {}) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none"
       stroke="currentColor" strokeWidth={opts.sw || 1.6}
       strokeLinecap="round" strokeLinejoin="round">{children}</svg>
);

const Icon = {
  // Navigation / dashboard
  home: (s = 20) => iconBase(s, <><path d="M3 11l9-7 9 7"/><path d="M5 10v9a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1v-9"/></>),
  image: (s = 20) => iconBase(s, <><rect x="3" y="4" width="18" height="16" rx="2"/><circle cx="9" cy="10" r="1.6"/><path d="M21 16l-5-5-9 9"/></>),
  post: (s = 20) => iconBase(s, <><rect x="3" y="3" width="18" height="18" rx="3"/><path d="M3 14l4-4 4 4 3-3 7 7"/><circle cx="16" cy="8" r="1.4"/></>),
  story: (s = 20) => iconBase(s, <><rect x="6" y="3" width="12" height="18" rx="2.5"/><circle cx="12" cy="6.5" r="0.6"/></>),
  history: (s = 20) => iconBase(s, <><path d="M3 12a9 9 0 1 0 3-6.7"/><path d="M3 4v5h5"/><path d="M12 8v4l3 2"/></>),
  identity: (s = 20) => iconBase(s, <><circle cx="12" cy="8.5" r="3.5"/><path d="M5 20c.6-3.4 3.6-5.5 7-5.5s6.4 2.1 7 5.5"/></>),
  link: (s = 20) => iconBase(s, <><path d="M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7L11 7"/><path d="M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7L13 17"/></>),
  invoice: (s = 20) => iconBase(s, <><path d="M5 3h11l3 3v15a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"/><path d="M9 9h6M9 13h6M9 17h4"/></>),
  // UI
  upload: (s = 20) => iconBase(s, <><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="M17 8l-5-5-5 5"/><path d="M12 3v12"/></>),
  download: (s = 20) => iconBase(s, <><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="M7 10l5 5 5-5"/><path d="M12 15V3"/></>),
  refresh: (s = 20) => iconBase(s, <><path d="M3 12a9 9 0 0 1 15-6.7L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-15 6.7L3 16"/><path d="M3 21v-5h5"/></>),
  thumbsdown: (s = 20) => iconBase(s, <><path d="M10 15v4a2 2 0 0 0 4 0v-3h3a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h3z" transform="rotate(180 12 12)"/></>),
  check: (s = 20) => iconBase(s, <polyline points="4,12 10,18 20,6"/>),
  x: (s = 20) => iconBase(s, <><path d="M6 6l12 12M18 6L6 18"/></>),
  arrowRight: (s = 20) => iconBase(s, <><path d="M5 12h14"/><path d="M13 5l7 7-7 7"/></>),
  arrowDown: (s = 20) => iconBase(s, <><path d="M12 5v14"/><path d="M5 13l7 7 7-7"/></>),
  bolt: (s = 20) => iconBase(s, <path d="M13 2L4 14h7l-1 8 9-12h-7l1-8z"/>),
  sparkle: (s = 20) => iconBase(s, <><path d="M12 3l1.6 5.4L19 10l-5.4 1.6L12 17l-1.6-5.4L5 10l5.4-1.6z"/><path d="M19 4v3M20.5 5.5h-3" strokeWidth="1.4"/></>),
  // Social
  instagram: (s = 20) => iconBase(s, <><rect x="3" y="3" width="18" height="18" rx="5"/><circle cx="12" cy="12" r="4"/><circle cx="17.5" cy="6.5" r="0.6" fill="currentColor"/></>),
  whatsapp: (s = 20) => (
    <svg width={s} height={s} viewBox="0 0 24 24" fill="currentColor">
      <path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.297-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.71.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347zM12.034 21.785c-.001 0-.002 0-.003 0-1.991-.001-3.951-.534-5.658-1.547l-.408-.244-4.214 1.105 1.124-4.108-.265-.42c-1.114-1.769-1.7-3.811-1.7-5.91.003-6.115 4.978-11.087 11.094-11.087 2.962.001 5.747 1.155 7.84 3.249 2.094 2.095 3.246 4.882 3.245 7.844-.003 6.115-4.978 11.088-11.094 11.088zM20.52 3.449C18.235 1.225 15.265.005 12.106 0 5.566 0 .242 5.323.24 11.864c0 2.092.547 4.133 1.587 5.933L.13 24l6.335-1.661c1.732.945 3.683 1.444 5.668 1.444h.005c6.539 0 11.864-5.323 11.866-11.864.001-3.171-1.232-6.151-3.474-8.398z"/>
    </svg>
  ),
  // Misc
  bell: (s = 20) => iconBase(s, <><path d="M6 8a6 6 0 0 1 12 0c0 7 3 8 3 8H3s3-1 3-8z"/><path d="M10 21a2 2 0 0 0 4 0"/></>),
  search: (s = 20) => iconBase(s, <><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></>),
  menu: (s = 20) => iconBase(s, <><path d="M3 6h18M3 12h18M3 18h18"/></>),
  chev: (s = 20) => iconBase(s, <path d="M9 6l6 6-6 6"/>),
  chevDown: (s = 20) => iconBase(s, <path d="M6 9l6 6 6-6"/>),
  plus: (s = 20) => iconBase(s, <><path d="M12 5v14M5 12h14"/></>),
  fire: (s = 20) => iconBase(s, <path d="M12 3s4 4 4 8a4 4 0 0 1-8 0c0-2 1-3 1-3s0 2 2 2c0-3-1-4 1-7zM7 14a5 5 0 0 0 10 0"/>),
  star: (s = 20) => iconBase(s, <path d="M12 3l2.7 5.6 6.3.9-4.5 4.4 1.1 6.2L12 17.3 6.4 20.1l1.1-6.2L3 9.5l6.3-.9z"/>),
  shield: (s = 20) => iconBase(s, <><path d="M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z"/><path d="M9 12l2 2 4-4"/></>),
  clock: (s = 20) => iconBase(s, <><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></>),
  phone: (s = 20) => iconBase(s, <rect x="6" y="2" width="12" height="20" rx="3"/>),
  monitor: (s = 20) => iconBase(s, <><rect x="2" y="4" width="20" height="13" rx="2"/><path d="M8 21h8M12 17v4"/></>),
  building: (s = 20) => iconBase(s, <><rect x="4" y="3" width="16" height="18" rx="1"/><path d="M9 8h2M13 8h2M9 12h2M13 12h2M9 16h2M13 16h2"/></>),
  copy: (s = 20) => iconBase(s, <><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></>),
  share: (s = 20) => iconBase(s, <><circle cx="6" cy="12" r="2.5"/><circle cx="18" cy="6" r="2.5"/><circle cx="18" cy="18" r="2.5"/><path d="M8.2 11l7.6-3.6M8.2 13l7.6 3.6"/></>),
  trash: (s = 20) => iconBase(s, <><path d="M4 7h16M9 7V4h6v3M6 7l1 13a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1l1-13"/></>),
  // logo glyph | stylized chef hat + spark
  logo: (s = 28) => (
    <svg width={s} height={s} viewBox="0 0 32 32" fill="none">
      <path d="M8 14c0-4 3.5-7 8-7s8 3 8 7v2H8v-2z" fill="currentColor"/>
      <path d="M8 16h16v6a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2v-6z" fill="currentColor" opacity="0.7"/>
      <circle cx="22" cy="9" r="2" fill="#F5A623"/>
    </svg>
  ),
};

window.Icon = Icon;
