// Inline SVG icon set. Light (1.5 stroke) line icons that match Linear/Lucide vibe.
// All accept {size, className, strokeWidth}.

const _ico = (paths, viewBox = "0 0 24 24") => ({ size = 16, className = "", strokeWidth = 1.6, ...rest }) => (
  <svg
    xmlns="http://www.w3.org/2000/svg"
    viewBox={viewBox}
    width={size}
    height={size}
    fill="none"
    stroke="currentColor"
    strokeWidth={strokeWidth}
    strokeLinecap="round"
    strokeLinejoin="round"
    className={className}
    aria-hidden="true"
    {...rest}
  >
    {paths}
  </svg>
);

const IcoDashboard = _ico(<>
  <rect x="3" y="3" width="7" height="9" rx="1.5" />
  <rect x="14" y="3" width="7" height="5" rx="1.5" />
  <rect x="14" y="12" width="7" height="9" rx="1.5" />
  <rect x="3" y="16" width="7" height="5" rx="1.5" />
</>);

const IcoTrending = _ico(<>
  <path d="M3 17l6-6 4 4 8-8" />
  <path d="M14 7h7v7" />
</>);

const IcoExchange = _ico(<>
  <path d="M7 7h13l-3-3" />
  <path d="M17 17H4l3 3" />
</>);

const IcoClipboard = _ico(<>
  <rect x="6" y="4" width="12" height="17" rx="2" />
  <path d="M9 4v-1h6v1" />
  <path d="M9 10h6M9 14h6M9 18h4" />
</>);

const IcoTarget = _ico(<>
  <circle cx="12" cy="12" r="9" />
  <circle cx="12" cy="12" r="5" />
  <circle cx="12" cy="12" r="1.5" />
</>);

const IcoBars = _ico(<>
  <path d="M4 20V10M10 20V4M16 20v-7M22 20H2" />
</>);

const IcoCalendar = _ico(<>
  <rect x="3" y="5" width="18" height="16" rx="2" />
  <path d="M3 9h18M8 3v4M16 3v4" />
</>);

const IcoCalendarClock = _ico(<>
  <rect x="3" y="5" width="13" height="16" rx="2" />
  <path d="M3 9h13M8 3v4M14 3v4" />
  <circle cx="18" cy="16" r="4" />
  <path d="M18 14v2l1.5 1" />
</>);

const IcoDollar = _ico(<>
  <path d="M12 3v18" />
  <path d="M17 7c-1.5-2-3.5-2-5-2s-4 1-4 3 2 3 4 3 4 1 4 3-2 3-4 3-3.5 0-5-2" />
</>);

const IcoBadge = _ico(<>
  <circle cx="12" cy="12" r="9" />
  <path d="M12 7v10M15 9h-4a1.5 1.5 0 0 0 0 3h2a1.5 1.5 0 0 1 0 3H9" />
</>);

const IcoShuffle = _ico(<>
  <path d="M3 6h4l11 12h4M3 18h4l3-3M14 9l4-3 4 3M18 18l4-3-4-3" />
</>);

const IcoBriefcase = _ico(<>
  <rect x="3" y="7" width="18" height="13" rx="2" />
  <path d="M9 7V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2" />
  <path d="M3 13h18" />
</>);

const IcoLink = _ico(<>
  <path d="M10 14a4 4 0 0 0 5.66 0l3-3a4 4 0 0 0-5.66-5.66l-1 1" />
  <path d="M14 10a4 4 0 0 0-5.66 0l-3 3a4 4 0 0 0 5.66 5.66l1-1" />
</>);

const IcoPuzzle = _ico(<>
  <path d="M14 4v3h3a1 1 0 0 1 1 1v3h-1.5a1.5 1.5 0 1 0 0 3H18v3a1 1 0 0 1-1 1h-3v-1.5a1.5 1.5 0 1 0-3 0V21H7a1 1 0 0 1-1-1v-3H4.5a1.5 1.5 0 1 1 0-3H6V10a1 1 0 0 1 1-1h3V8a1 1 0 0 1 0-3 1 1 0 0 1 0-1Z" />
</>);

const IcoSettings = _ico(<>
  <circle cx="12" cy="12" r="3" />
  <path d="M19.4 15a1.7 1.7 0 0 0 .34 1.87l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.7 1.7 0 0 0-1.87-.34 1.7 1.7 0 0 0-1 1.55V21a2 2 0 1 1-4 0v-.09A1.7 1.7 0 0 0 9 19.4a1.7 1.7 0 0 0-1.87.34l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.7 1.7 0 0 0 4.6 15a1.7 1.7 0 0 0-1.55-1H3a2 2 0 1 1 0-4h.09A1.7 1.7 0 0 0 4.6 9a1.7 1.7 0 0 0-.34-1.87l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.7 1.7 0 0 0 9 4.6a1.7 1.7 0 0 0 1-1.55V3a2 2 0 1 1 4 0v.09A1.7 1.7 0 0 0 15 4.6a1.7 1.7 0 0 0 1.87-.34l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.7 1.7 0 0 0 19.4 9a1.7 1.7 0 0 0 1.55 1H21a2 2 0 1 1 0 4h-.09a1.7 1.7 0 0 0-1.51 1Z" />
</>);

const IcoHelp = _ico(<>
  <circle cx="12" cy="12" r="9" />
  <path d="M9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.7.3-1 .9-1 1.7M12 17h.01" />
</>);

const IcoSearch = _ico(<>
  <circle cx="11" cy="11" r="7" />
  <path d="M21 21l-4.3-4.3" />
</>);

const IcoBell = _ico(<>
  <path d="M6 8a6 6 0 1 1 12 0c0 7 3 7 3 9H3c0-2 3-2 3-9Z" />
  <path d="M10 21a2 2 0 0 0 4 0" />
</>);

const IcoSun = _ico(<>
  <circle cx="12" cy="12" r="4" />
  <path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41" />
</>);

const IcoMoon = _ico(<>
  <path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z" />
</>);

const IcoArrowUp = _ico(<>
  <path d="M5 12l7-7 7 7M12 5v15" />
</>);

const IcoArrowDown = _ico(<>
  <path d="M19 12l-7 7-7-7M12 19V4" />
</>);

const IcoArrowRight = _ico(<>
  <path d="M5 12h14M13 5l7 7-7 7" />
</>);

const IcoCheck = _ico(<>
  <path d="M5 12l5 5L20 7" />
</>);

const IcoX = _ico(<>
  <path d="M6 6l12 12M18 6 6 18" />
</>);

const IcoMinus = _ico(<>
  <path d="M5 12h14" />
</>);

const IcoChevronDown = _ico(<>
  <path d="M6 9l6 6 6-6" />
</>);

const IcoChevronRight = _ico(<>
  <path d="M9 6l6 6-6 6" />
</>);

const IcoInfo = _ico(<>
  <circle cx="12" cy="12" r="9" />
  <path d="M12 8h.01M11 12h1v4h1" />
</>);

const IcoRepeat = _ico(<>
  <path d="M17 1l4 4-4 4" />
  <path d="M3 11V9a4 4 0 0 1 4-4h14" />
  <path d="M7 23l-4-4 4-4" />
  <path d="M21 13v2a4 4 0 0 1-4 4H3" />
</>);

const IcoExternal = _ico(<>
  <path d="M14 3h7v7" />
  <path d="M10 14L21 3" />
  <path d="M21 14v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h6" />
</>);

const IcoDownload = _ico(<>
  <path d="M12 3v13M6 11l6 6 6-6M5 21h14" />
</>);

const IcoUpload = _ico(<>
  <path d="M12 21V8M6 13l6-6 6 6M5 3h14" />
</>);

const IcoLock = _ico(<>
  <rect x="4" y="11" width="16" height="10" rx="2" />
  <path d="M8 11V7a4 4 0 1 1 8 0v4" />
</>);

const IcoShield = _ico(<>
  <path d="M12 3l8 3v5c0 5-3.5 9-8 10-4.5-1-8-5-8-10V6l8-3Z" />
</>);

const IcoSparkle = _ico(<>
  <path d="M12 3l1.8 4.2L18 9l-4.2 1.8L12 15l-1.8-4.2L6 9l4.2-1.8L12 3Z" />
  <path d="M19 14l.8 1.7L21.5 16.5l-1.7.8L19 19l-.8-1.7L16.5 16.5l1.7-.8L19 14Z" />
</>);

const IcoGitHub = _ico(<>
  <path d="M9 19c-4 1.5-4-2-6-2.5M15 22v-3.5a3 3 0 0 0-.8-2.3c2.7-.3 5.5-1.3 5.5-6 0-1.2-.4-2.3-1.2-3.2.4-1.2.3-2.4-.2-3.5 0 0-1 0-3 1.5-2-.5-4-.5-6 0C6.3 1 5.3 1 5.3 1c-.5 1.1-.6 2.3-.2 3.5C4.4 5.4 4 6.5 4 7.7c0 4.7 2.8 5.7 5.5 6a3 3 0 0 0-.8 2.3V22" />
</>);

const IcoXSocial = _ico(<>
  <path d="M3 3l8.2 10.4L4 21h2l6.2-7 5.6 7H21l-8.6-10.9L20 3h-2l-5.5 6.2L7 3H3Z" strokeWidth="1.4" />
</>);

const IcoCircle = _ico(<>
  <circle cx="12" cy="12" r="4" />
</>);

const IcoZap = _ico(<>
  <path d="M13 2L4 14h7l-1 8 9-12h-7l1-8Z" />
</>);

const IcoDatabase = _ico(<>
  <ellipse cx="12" cy="5" rx="8" ry="3" />
  <path d="M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5" />
  <path d="M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6" />
</>);

const IcoFilter = _ico(<>
  <path d="M3 5h18l-7 9v6l-4-2v-4L3 5Z" />
</>);

const IcoPlus = _ico(<>
  <path d="M12 5v14M5 12h14" />
</>);

const IcoGrip = _ico(<>
  <circle cx="9" cy="6" r="1.2" /><circle cx="15" cy="6" r="1.2" />
  <circle cx="9" cy="12" r="1.2" /><circle cx="15" cy="12" r="1.2" />
  <circle cx="9" cy="18" r="1.2" /><circle cx="15" cy="18" r="1.2" />
</>);

const IcoAlert = _ico(<>
  <path d="M12 3 2 21h20L12 3Z" />
  <path d="M12 10v5M12 18h.01" />
</>);

const IcoFile = _ico(<>
  <path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8l-5-5Z" />
  <path d="M14 3v5h5" />
</>);

const IcoLayers = _ico(<>
  <path d="M12 3L2 8l10 5 10-5-10-5Z" />
  <path d="M2 13l10 5 10-5M2 18l10 5 10-5" />
</>);

const IcoLogo = ({ size = 22, className = "" }) => (
  <svg viewBox="0 0 24 24" width={size} height={size} className={className} aria-hidden="true">
    <defs>
      <linearGradient id="logo-grad" x1="0" y1="0" x2="1" y2="1">
        <stop offset="0%" stopColor="hsl(262 83% 75%)" />
        <stop offset="100%" stopColor="hsl(262 83% 50%)" />
      </linearGradient>
    </defs>
    <rect x="2" y="2" width="20" height="20" rx="5" fill="url(#logo-grad)" />
    <path d="M5 16.5 L9 12 L11.5 13.7 L15 9 L19 11.5" stroke="white" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" fill="none" opacity=".95" />
    <circle cx="19" cy="11.5" r="1.5" fill="white" />
  </svg>
);

// DashFolio.ai wordmark (source: upload_perso/Dashfolio-logo.png, files in /brand/).
// Two variants: white text for html.dark, navy text for html.light — same icon.
const BrandLogo = ({ height = 32, className = "" }) => (
  <span className={`inline-flex items-center ${className}`} style={{ height }}>
    <img src="/brand/dashfolio-logo-v5-light.png" alt="DashFolio.ai" className="dark:hidden" style={{ height, width: "auto" }} />
    <img src="/brand/dashfolio-logo-v5-dark.png" alt="DashFolio.ai" className="hidden dark:block" style={{ height, width: "auto" }} />
  </span>
);

Object.assign(window, {
  BrandLogo,
  IcoDashboard, IcoTrending, IcoExchange, IcoClipboard, IcoTarget, IcoBars,
  IcoCalendar, IcoCalendarClock, IcoDollar, IcoBadge, IcoShuffle, IcoBriefcase,
  IcoLink, IcoPuzzle, IcoSettings, IcoHelp, IcoSearch, IcoBell, IcoSun, IcoMoon,
  IcoArrowUp, IcoArrowDown, IcoArrowRight, IcoCheck, IcoX, IcoMinus,
  IcoChevronDown, IcoChevronRight, IcoInfo, IcoRepeat, IcoExternal, IcoDownload,
  IcoUpload, IcoLock, IcoShield, IcoSparkle, IcoGitHub, IcoXSocial, IcoCircle,
  IcoZap, IcoDatabase, IcoFilter, IcoPlus, IcoGrip, IcoAlert, IcoFile, IcoLayers,
  IcoLogo,
});
