// Inline condition-reflecting icons. Stroke SVGs sized 24x24, viewBox 0 0 24 24.
// Two visual treatments via the `family` prop:
//   "saffron" — gradient stroke (psychiatry/neurology)
//   "teal"    — flat var(--teal-600) stroke (ophthalmology)

const ICON_PATHS = {
  depression: <React.Fragment><path d="M16 13a4 4 0 0 0-8-1.5A3.5 3.5 0 1 0 7 18h9a3 3 0 0 0 0-6Z"/><path d="M8 19v2"/><path d="M12 19v3"/><path d="M16 19v2"/></React.Fragment>,
  adhd: <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/>,
  schizophrenia: <React.Fragment><circle cx="9" cy="12" r="6"/><circle cx="15" cy="12" r="6"/></React.Fragment>,
  deaddiction: <React.Fragment><circle cx="12" cy="12" r="9"/><line x1="5.6" y1="5.6" x2="18.4" y2="18.4"/></React.Fragment>,
  dementia: <React.Fragment><path d="M9.5 2A2.5 2.5 0 0 1 12 4.5v15A2.5 2.5 0 0 1 7 19.5a2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 1.98-3A2.5 2.5 0 0 1 9.5 2Z"/><path d="M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 5 0 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-1.98-3A2.5 2.5 0 0 0 14.5 2Z"/></React.Fragment>,
  headache: <React.Fragment><circle cx="12" cy="13" r="6.5"/><path d="M9 4l1 2"/><path d="M15 4l-1 2"/><path d="M12 3v2"/><path d="M10 13h4"/></React.Fragment>,
  epilepsy: <polyline points="3 12 7 12 9 5 13 19 15 12 21 12"/>,
  stroke: <React.Fragment><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/><polyline points="3.5 12 7 12 9 9 12 15 14 12 17 12"/></React.Fragment>,
  insomnia: <React.Fragment><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79Z"/><path d="M15 4h4l-4 4h4"/></React.Fragment>,
  apnoea: <React.Fragment><path d="M3 12h3l2-4 4 8 2-4 2 2h5"/></React.Fragment>,
  cataract: <React.Fragment><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z"/><circle cx="12" cy="12" r="3" fill="currentColor" fillOpacity="0.25"/></React.Fragment>,
  glaucoma: <React.Fragment><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/><path d="M12 14v3"/></React.Fragment>,
  dryEye: <React.Fragment><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/><path d="M22 4l-2 2"/><path d="M22 8l-3 0"/></React.Fragment>,
  eye: <React.Fragment><path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/></React.Fragment>,
  glasses: <React.Fragment><circle cx="6" cy="14" r="3.5"/><circle cx="18" cy="14" r="3.5"/><path d="M9.5 14h5"/><path d="M3 9l2-2"/><path d="M21 9l-2-2"/></React.Fragment>,
  retina: <React.Fragment><circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="4"/><circle cx="12" cy="12" r="1.2" fill="currentColor"/></React.Fragment>,
};

function ConditionIcon({ name, family = 'saffron', size = 26 }) {
  const stroke = family === 'teal' ? 'var(--teal-600)' : 'url(#saffronGrad)';
  return (
    <svg viewBox="0 0 24 24" width={size} height={size} fill="none" stroke={stroke}
      strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" style={{ color: '#FE6A2E' }}>
      {ICON_PATHS[name] || ICON_PATHS.eye}
    </svg>
  );
}

function IconDefs() {
  return (
    <svg width="0" height="0" style={{ position: 'absolute' }} aria-hidden="true">
      <defs>
        <linearGradient id="saffronGrad" x1="0" y1="0" x2="1" y2="1">
          <stop offset="0%" stopColor="#FF9937"/>
          <stop offset="100%" stopColor="#FE6A2E"/>
        </linearGradient>
      </defs>
    </svg>
  );
}

// Lucide-style chevron / utility
function Chevron({ dir = 'right', size = 16 }) {
  const rot = { right: 0, left: 180, down: 90, up: -90 }[dir];
  return (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
      strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round" style={{ transform: `rotate(${rot}deg)` }}>
      <polyline points="9 18 15 12 9 6" />
    </svg>
  );
}
function CloseIcon({ size = 18 }) {
  return (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
      strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round">
      <line x1="6" y1="6" x2="18" y2="18"/><line x1="18" y1="6" x2="6" y2="18"/>
    </svg>
  );
}
function PhoneIcon({ size = 16 }) {
  return (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
      strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round">
      <path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6A19.79 19.79 0 0 1 2.12 4.18 2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92Z"/>
    </svg>
  );
}
function PinIcon({ size = 16 }) {
  return (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
      strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round">
      <path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/>
    </svg>
  );
}
function ClockIcon({ size = 16 }) {
  return (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
      strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round">
      <circle cx="12" cy="12" r="9"/><polyline points="12 7 12 12 15 14"/>
    </svg>
  );
}
function MenuIcon({ size = 22 }) {
  return (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
      strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round">
      <line x1="4" y1="7" x2="20" y2="7"/><line x1="4" y1="13" x2="20" y2="13"/><line x1="4" y1="19" x2="20" y2="19"/>
    </svg>
  );
}
function ArrowRight({ size = 14 }) {
  return (
    <svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
      strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round">
      <line x1="5" y1="12" x2="19" y2="12"/><polyline points="13 6 19 12 13 18"/>
    </svg>
  );
}

Object.assign(window, { ConditionIcon, IconDefs, Chevron, CloseIcon, PhoneIcon, PinIcon, ClockIcon, MenuIcon, ArrowRight });
