/* ============================================================
   VANTIK — Sistema de iconos lineales
   Trazo fino y uniforme, estilo técnico-industrial.
   Uso: <Icon name="cpu" size={28} />  (hereda color vía currentColor)
   ============================================================ */
const ICON_PATHS = {
  // Automatización / control
  cpu: (
    <g>
      <rect x="6" y="6" width="12" height="12" rx="1" />
      <rect x="9.5" y="9.5" width="5" height="5" rx="0.5" />
      <path d="M9 6V3M15 6V3M9 21v-3M15 21v-3M6 9H3M6 15H3M21 9h-3M21 15h-3" />
    </g>
  ),
  // Electricidad
  bolt: (
    <path d="M13 2 4 14h7l-1 8 9-12h-7l1-8Z" />
  ),
  // Software
  code: (
    <g>
      <rect x="3" y="4" width="18" height="16" rx="1" />
      <path d="M3 8h18" />
      <path d="M9 12l-2 2 2 2M15 12l2 2-2 2M13 11l-2 6" />
    </g>
  ),
  // Monitoreo
  monitor: (
    <g>
      <rect x="3" y="4" width="18" height="13" rx="1" />
      <path d="M7 12l3-3 2.5 2.5L17 8M9 21h6M12 17v4" />
    </g>
  ),
  // Instrumentación
  gauge: (
    <g>
      <path d="M3 14a9 9 0 0 1 18 0" />
      <path d="M3 14h2M19 14h2M12 5V3" />
      <path d="M12 14l5-3.5" />
      <circle cx="12" cy="14" r="1.3" />
    </g>
  ),
  // Integración / red
  network: (
    <g>
      <circle cx="12" cy="5" r="2.2" />
      <circle cx="5" cy="19" r="2.2" />
      <circle cx="19" cy="19" r="2.2" />
      <path d="M12 7.2v4.3M12 11.5 6.5 17M12 11.5 17.5 17" />
    </g>
  ),
  // Mantenimiento eléctrico
  plug: (
    <g>
      <path d="M9 3v5M15 3v5" />
      <path d="M6 8h12v3a6 6 0 0 1-12 0V8Z" />
      <path d="M12 17v4" />
    </g>
  ),
  // Ingeniería de proyectos
  ruler: (
    <g>
      <rect x="3" y="3" width="18" height="18" rx="1" />
      <path d="M3 9h4M3 15h4M9 3v4M15 3v4M17 21v-4M9 21v-4M21 9h-4M21 15h-4" />
    </g>
  ),
  // Trazabilidad / ruta
  route: (
    <g>
      <circle cx="6" cy="6" r="2.2" />
      <circle cx="18" cy="18" r="2.2" />
      <path d="M8 6h7a3 3 0 0 1 0 6H9a3 3 0 0 0 0 6h7" />
    </g>
  ),
  // Reportes
  report: (
    <g>
      <path d="M6 3h8l4 4v14H6V3Z" />
      <path d="M14 3v4h4" />
      <path d="M9 17v-3M12 17v-5M15 17v-2" />
    </g>
  ),
  // Enfoque técnico
  target: (
    <g>
      <circle cx="12" cy="12" r="8" />
      <circle cx="12" cy="12" r="4" />
      <circle cx="12" cy="12" r="0.6" />
    </g>
  ),
  // Calidad
  badge: (
    <g>
      <circle cx="12" cy="9" r="6" />
      <path d="M9.5 9l2 2 3.5-3.5" />
      <path d="M8 14.5 6.5 21l5.5-2.5L17.5 21 16 14.5" />
    </g>
  ),
  // Seguridad
  shield: (
    <path d="M12 3l7 3v5c0 4.5-3 8-7 10-4-2-7-5.5-7-10V6l7-3Z" />
  ),
  // Integridad
  shieldcheck: (
    <g>
      <path d="M12 3l7 3v5c0 4.5-3 8-7 10-4-2-7-5.5-7-10V6l7-3Z" />
      <path d="M9 11.5l2 2 4-4" />
    </g>
  ),
  // Integración (capas)
  layers: (
    <g>
      <path d="M12 3 3 8l9 5 9-5-9-5Z" />
      <path d="M3 13l9 5 9-5M3 18l9 5 9-5" />
    </g>
  ),
  // Acompañamiento
  headset: (
    <g>
      <path d="M5 13v-1a7 7 0 0 1 14 0v1" />
      <rect x="3" y="13" width="3.5" height="6" rx="1" />
      <rect x="17.5" y="13" width="3.5" height="6" rx="1" />
      <path d="M19 19v1a3 3 0 0 1-3 3h-3" />
    </g>
  ),
  // Compromiso
  handshake: (
    <g>
      <path d="M8 11 5 8 2 11l3 5 2-1" />
      <path d="M16 11l3-3 3 3-3 5-2-1" />
      <path d="M8 11l3-2 2 1.5 2-1.5 2 2-4 4-3-2-3 1" />
    </g>
  ),
  // Innovación
  bulb: (
    <g>
      <path d="M9 17h6M10 21h4" />
      <path d="M12 3a6 6 0 0 0-3.5 10.9c.5.4.5 1 .5 1.6V17h6v-1.5c0-.6 0-1.2.5-1.6A6 6 0 0 0 12 3Z" />
    </g>
  ),
  // Contacto
  pin: (
    <g>
      <path d="M12 21s7-5.5 7-11a7 7 0 0 0-14 0c0 5.5 7 11 7 11Z" />
      <circle cx="12" cy="10" r="2.5" />
    </g>
  ),
  mail: (
    <g>
      <rect x="3" y="5" width="18" height="14" rx="1" />
      <path d="M3 7l9 6 9-6" />
    </g>
  ),
  phone: (
    <path d="M6 3h3l1.5 5-2 1.5a12 12 0 0 0 6 6l1.5-2 5 1.5v3a2 2 0 0 1-2 2A16 16 0 0 1 4 5a2 2 0 0 1 2-2Z" />
  ),
  clock: (
    <g>
      <circle cx="12" cy="12" r="8.5" />
      <path d="M12 7v5l3.5 2" />
    </g>
  ),
  arrow: (
    <path d="M5 12h13M13 6l6 6-6 6" />
  ),
  // Sociales
  linkedin: (
    <g>
      <rect x="3" y="3" width="18" height="18" rx="2" />
      <path d="M7 10v7M7 7v.01M11 17v-4a2 2 0 0 1 4 0v4M11 11v6" />
    </g>
  ),
  instagram: (
    <g>
      <rect x="3" y="3" width="18" height="18" rx="5" />
      <circle cx="12" cy="12" r="4" />
      <path d="M17 7v.01" />
    </g>
  ),
  youtube: (
    <g>
      <rect x="3" y="6" width="18" height="12" rx="3" />
      <path d="M10 9.5l5 2.5-5 2.5v-5Z" />
    </g>
  ),
  x: (
    <path d="M4 4l16 16M20 4 4 20" />
  ),
};

function Icon({ name, size = 24, className = '', strokeWidth = 1.6, style }) {
  const path = ICON_PATHS[name];
  if (!path) return null;
  return (
    <svg
      className={className}
      width={size} height={size} viewBox="0 0 24 24"
      fill="none" stroke="currentColor"
      strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"
      style={style} aria-hidden="true"
    >
      {path}
    </svg>
  );
}

window.Icon = Icon;
