export function IranFlagIcon({
  className = "w-6 h-4",
  rounded = true,
}) {
  const rx = rounded ? 3.5 : 0;

  return (
    <svg
      className={className}
      viewBox="0 0 64 48"
      xmlns="http://www.w3.org/2000/svg"
      role="img"
      aria-label="پرچم ایران"
      preserveAspectRatio="xMidYMid meet"
    >
      <defs>
        <clipPath id="ir_clip">
          <rect x="0" y="0" width="64" height="48" rx={rx} ry={rx} />
        </clipPath>
      </defs>

      <g clipPath="url(#ir_clip)">
        {/* stripes */}
        <rect x="0" y="0" width="64" height="16" fill="#239F40" />
        <rect x="0" y="16" width="64" height="16" fill="#FFFFFF" />
        <rect x="0" y="32" width="64" height="16" fill="#DA0000" />

        {/* simple emblem (stylized) */}
        <g transform="translate(32 24)" fill="none" stroke="#DA0000" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
          {/* vertical */}
          <path d="M0 -8 L0 8" />
          {/* side crescents */}
          <path d="M-5 -5 C-8 -2 -8 2 -5 5" />
          <path d="M5 -5 C8 -2 8 2 5 5" />
          {/* top small arc */}
          <path d="M-3 -8 C-1 -10 1 -10 3 -8" />
          {/* bottom small arc */}
          <path d="M-3 8 C-1 10 1 10 3 8" />
        </g>

        {/* optional thin separators like real flag */}
        <rect x="0" y="15.2" width="64" height="0.8" fill="#DA0000" opacity="0.55" />
        <rect x="0" y="32" width="64" height="0.8" fill="#239F40" opacity="0.55" />
      </g>

      {/* border for UI */}
      <rect x="0.75" y="0.75" width="62.5" height="46.5" rx={rx} ry={rx} fill="none" stroke="rgba(0,0,0,0.10)" />
    </svg>
  );
}
