import type { SVGProps } from "react";
import Image from "next/image";

/* Lightweight, dependency-free icon set (stroke-based, inherits currentColor) */

type IconProps = SVGProps<SVGSVGElement>;

const base = {
  width: 24,
  height: 24,
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  strokeWidth: 1.75,
  strokeLinecap: "round" as const,
  strokeLinejoin: "round" as const,
};

export function VehCallLogo({ className }: { className?: string }) {
  return (
    <Image
      src="/logo.png"
      alt="VehCall"
      width={32}
      height={32}
      className={`h-8 w-8 rounded-lg ${className ?? ""}`}
    />
  );
}

export const PhoneIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M5 4h3l1.5 5-2 1.5a13 13 0 0 0 6 6l1.5-2 5 1.5v3a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2Z" />
  </svg>
);

export const MicIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <rect x="9" y="3" width="6" height="11" rx="3" />
    <path d="M5 11a7 7 0 0 0 14 0" />
    <path d="M12 18v3M9 21h6" />
  </svg>
);

export const MicOffIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M15 9.4V6a3 3 0 0 0-5.6-1.5M9 9v2a3 3 0 0 0 4.5 2.6" />
    <path d="M5 11a7 7 0 0 0 10.5 6.05M19 11a7 7 0 0 1-.4 2.3" />
    <path d="M12 18v3M9 21h6" />
    <path d="M4 4l16 16" />
  </svg>
);

export const MessageIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M4 5h16a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H9l-5 4V6a1 1 0 0 1 1-1Z" />
    <path d="M8 9.5h8M8 12.5h5" />
  </svg>
);

export const AlertIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M12 3l9 16H3l9-16Z" />
    <path d="M12 9v5M12 17.5v.5" />
  </svg>
);

export const ShieldCheckIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M12 3l7 3v5c0 4.5-3 8.3-7 10-4-1.7-7-5.5-7-10V6l7-3Z" />
    <path d="M9 12l2 2 4-4" />
  </svg>
);

export const LockIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <rect x="5" y="11" width="14" height="9" rx="2" />
    <path d="M8 11V8a4 4 0 0 1 8 0v3" />
    <circle cx="12" cy="15.5" r="1.2" fill="currentColor" stroke="none" />
  </svg>
);

export const BoltIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M13 2 4 14h6l-1 8 9-12h-6l1-8Z" />
  </svg>
);

export const HistoryIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M3 12a9 9 0 1 0 3-6.7M3 4v4h4" />
    <path d="M12 8v4l3 2" />
  </svg>
);

export const QrIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <rect x="3" y="3" width="7" height="7" rx="1" />
    <rect x="14" y="3" width="7" height="7" rx="1" />
    <rect x="3" y="14" width="7" height="7" rx="1" />
    <path d="M14 14h3v3M21 14v7M17 21h4M14 19v2" />
  </svg>
);

export const CarIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M3 14l1.6-4.6A3 3 0 0 1 7.4 7.4h9.2a3 3 0 0 1 2.8 2L21 14" />
    <path d="M3 14h18v4a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-1H7v1a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-4Z" />
    <circle cx="7.5" cy="14.5" r="1.1" fill="currentColor" stroke="none" />
    <circle cx="16.5" cy="14.5" r="1.1" fill="currentColor" stroke="none" />
  </svg>
);

export const LightbulbIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M9 18h6M10 21h4" />
    <path d="M12 3a6 6 0 0 0-4 10.5c.7.6 1 1.2 1 2v.5h6v-.5c0-.8.3-1.4 1-2A6 6 0 0 0 12 3Z" />
  </svg>
);

export const CrashIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M3 16l1.4-3.8A3 3 0 0 1 7.2 10h7.6a3 3 0 0 1 2.8 1.9L19 16" />
    <path d="M3 16h16v3a1 1 0 0 1-1 1h-1.5a1 1 0 0 1-1-1v-1H6.5v1a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-3Z" />
    <path d="M14 3l-2 4h3l-2 4" />
  </svg>
);

export const SearchIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <circle cx="11" cy="11" r="7" />
    <path d="m20 20-3.5-3.5" />
  </svg>
);

export const UsersIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <circle cx="9" cy="8" r="3" />
    <path d="M3 20a6 6 0 0 1 12 0" />
    <path d="M16 5.5a3 3 0 0 1 0 5.8M17 14a6 6 0 0 1 4 5.8" />
  </svg>
);

export const ActivityIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M3 12h4l2 6 4-14 2 8h6" />
  </svg>
);

export const BadgeCheckIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M12 2.5l2.2 1.6 2.7-.2 1 2.5 2.3 1.5-.7 2.6.7 2.6-2.3 1.5-1 2.5-2.7-.2L12 21.5 9.8 19.9l-2.7.2-1-2.5L3.8 16l.7-2.6L3.8 11l2.3-1.5 1-2.5 2.7.2L12 2.5Z" />
    <path d="M9 12l2 2 4-4" />
  </svg>
);

export const StarIcon = (p: IconProps) => (
  <svg
    width={18}
    height={18}
    viewBox="0 0 24 24"
    fill="currentColor"
    aria-hidden="true"
    {...p}
  >
    <path d="M12 2.5l2.9 6 6.6.8-4.9 4.5 1.3 6.5L12 17.9l-5.9 3.4 1.3-6.5L2.5 9.3l6.6-.8L12 2.5Z" />
  </svg>
);

export const CheckIcon = (p: IconProps) => (
  <svg {...base} width={18} height={18} {...p}>
    <path d="M5 12.5l4 4 10-10" />
  </svg>
);

export const ChevronDownIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="m6 9 6 6 6-6" />
  </svg>
);

export const ChevronLeftIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="m15 6-6 6 6 6" />
  </svg>
);

export const ShieldIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M12 3l7 3v5c0 4.5-3 8.3-7 10-4-1.7-7-5.5-7-10V6l7-3Z" />
  </svg>
);

export const WhatsAppIcon = (p: IconProps) => (
  <svg viewBox="0 0 24 24" width={24} height={24} fill="currentColor" {...p}>
    <path d="M12.04 2C6.58 2 2.13 6.45 2.13 11.91c0 1.75.46 3.45 1.32 4.95L2 22l5.25-1.38a9.9 9.9 0 0 0 4.79 1.21h.01c5.46 0 9.91-4.45 9.91-9.91 0-2.65-1.03-5.14-2.9-7.01A9.82 9.82 0 0 0 12.04 2Zm0 1.67c2.2 0 4.27.86 5.82 2.42a8.18 8.18 0 0 1 2.41 5.82c0 4.54-3.7 8.23-8.24 8.23-1.48 0-2.93-.4-4.19-1.15l-.3-.18-3.12.82.83-3.04-.2-.31a8.16 8.16 0 0 1-1.26-4.38c0-4.54 3.7-8.23 8.24-8.23Zm-3.6 4.43c-.17 0-.45.06-.68.31-.23.25-.9.88-.9 2.15 0 1.27.92 2.49 1.05 2.66.13.17 1.8 2.86 4.46 3.91 2.21.87 2.66.7 3.14.66.48-.04 1.55-.63 1.77-1.25.22-.62.22-1.15.15-1.26-.06-.11-.23-.17-.48-.3-.25-.13-1.55-.76-1.79-.85-.24-.09-.42-.13-.6.13-.17.25-.68.85-.83 1.03-.15.17-.31.19-.56.06-.25-.13-1.06-.39-2.02-1.25-.75-.66-1.25-1.48-1.4-1.73-.15-.25-.02-.39.11-.51.11-.11.25-.29.38-.44.12-.15.16-.25.25-.42.08-.17.04-.31-.02-.44-.06-.13-.54-1.39-.76-1.9-.2-.48-.4-.42-.56-.43-.14 0-.31-.01-.48-.01Z" />
  </svg>
);

export const ArrowRightIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M5 12h14M13 6l6 6-6 6" />
  </svg>
);

export const PlayIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M8 5.5v13l11-6.5-11-6.5Z" fill="currentColor" />
  </svg>
);

export const MenuIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M4 7h16M4 12h16M4 17h16" />
  </svg>
);

export const CloseIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M6 6l12 12M18 6 6 18" />
  </svg>
);

export const FingerprintIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M12 4a8 8 0 0 1 8 8M4 12a8 8 0 0 1 4-6.9" />
    <path d="M8 12a4 4 0 0 1 8 0v1a9 9 0 0 0 .8 3.7M12 12v2a9 9 0 0 0 1.5 5" />
    <path d="M7.5 16a9 9 0 0 1-.5-3v-1" />
  </svg>
);

export const GlobeIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <circle cx="12" cy="12" r="9" />
    <path d="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18" />
  </svg>
);

/* Social */
export const FacebookIcon = (p: IconProps) => (
  <svg viewBox="0 0 24 24" width={20} height={20} fill="currentColor" {...p}>
    <path d="M22 12a10 10 0 1 0-11.6 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.2c-1.2 0-1.6.8-1.6 1.6V12h2.7l-.4 2.9h-2.3v7A10 10 0 0 0 22 12Z" />
  </svg>
);

export const InstagramIcon = (p: IconProps) => (
  <svg {...base} width={20} height={20} {...p}>
    <rect x="3.5" y="3.5" width="17" height="17" rx="5" />
    <circle cx="12" cy="12" r="3.6" />
    <circle cx="17" cy="7" r="1" fill="currentColor" stroke="none" />
  </svg>
);

export const LinkedinIcon = (p: IconProps) => (
  <svg viewBox="0 0 24 24" width={20} height={20} fill="currentColor" {...p}>
    <path d="M4.8 3.5a2.3 2.3 0 1 0 0 4.6 2.3 2.3 0 0 0 0-4.6ZM3 9h3.6v11H3V9Zm6 0h3.4v1.5h.05c.5-.9 1.7-1.8 3.45-1.8 3.7 0 4.4 2.4 4.4 5.5V20h-3.6v-4.9c0-1.2 0-2.7-1.7-2.7s-1.95 1.3-1.95 2.6V20H9V9Z" />
  </svg>
);

export const TwitterIcon = (p: IconProps) => (
  <svg viewBox="0 0 24 24" width={20} height={20} fill="currentColor" {...p}>
    <path d="M18.9 3H22l-7 8 8.2 10H17l-5-6.4L6.2 21H3l7.5-8.6L2.5 3H9l4.5 5.9L18.9 3Zm-1.1 16h1.7L7.3 4.8H5.5L17.8 19Z" />
  </svg>
);

/* Dashboard / app-shell icons */

export const BellIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M6 9a6 6 0 0 1 12 0c0 4 1.5 5.5 2 6H4c.5-.5 2-2 2-6Z" />
    <path d="M10 19a2 2 0 0 0 4 0" />
  </svg>
);

export const UserCircleIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <circle cx="12" cy="12" r="9" />
    <circle cx="12" cy="10" r="3" />
    <path d="M6.6 18.4a6 6 0 0 1 10.8 0" />
  </svg>
);

export const ScanIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M4 8V6a2 2 0 0 1 2-2h2" />
    <path d="M16 4h2a2 2 0 0 1 2 2v2" />
    <path d="M20 16v2a2 2 0 0 1-2 2h-2" />
    <path d="M8 20H6a2 2 0 0 1-2-2v-2" />
    <rect x="9" y="9" width="6" height="6" rx="1" />
  </svg>
);

export const HomeIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M4 11l8-7 8 7" />
    <path d="M6 10v9a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-9" />
    <path d="M10 20v-5h4v5" />
  </svg>
);

export const PlusIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M12 5v14M5 12h14" />
  </svg>
);

export const LogOutIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M15 4h3a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3" />
    <path d="M10 17l-5-5 5-5" />
    <path d="M5 12h11" />
  </svg>
);

export const ChevronRightIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="m9 6 6 6-6 6" />
  </svg>
);

export const SparklesIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M12 4l1.6 4.4L18 10l-4.4 1.6L12 16l-1.6-4.4L6 10l4.4-1.6L12 4Z" />
    <path d="M19 14l.6 1.6 1.9.8-1.9.8-.6 1.8-.6-1.8-1.9-.8 1.9-.8.6-1.6Z" />
  </svg>
);

export const SettingsIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <circle cx="12" cy="12" r="3.2" />
    <path d="M12 2.5l1.5 2.1 2.5-.5.6 2.5 2.1 1.5-1.1 2.4 1.1 2.4-2.1 1.5-.6 2.5-2.5-.5L12 21.5l-1.5-2.1-2.5.5-.6-2.5L5.3 15.9l1.1-2.4-1.1-2.4 2.1-1.5.6-2.5 2.5.5L12 2.5Z" />
  </svg>
);

export const ShareIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <circle cx="18" cy="5" r="3" />
    <circle cx="6" cy="12" r="3" />
    <circle cx="18" cy="19" r="3" />
    <path d="M8.6 13.5l6.8 4M15.4 6.5l-6.8 4" />
  </svg>
);

export const DownloadIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M12 3v12" />
    <path d="m7 11 5 5 5-5" />
    <path d="M5 21h14" />
  </svg>
);

export const MotorcycleIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <circle cx="5.5" cy="17" r="3" />
    <circle cx="18.5" cy="17" r="3" />
    <path d="M8.5 17h6l3-6h-4l-2-3H6" />
    <path d="M13 8h4" />
  </svg>
);

export const MapPinIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M12 21s7-5.5 7-11a7 7 0 1 0-14 0c0 5.5 7 11 7 11Z" />
    <circle cx="12" cy="10" r="2.5" />
  </svg>
);

export const CrownIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M3 7l4 4 5-6 5 6 4-4-1.6 12H4.6L3 7Z" />
    <path d="M4.6 19h14.8" />
  </svg>
);

export const TrendingUpIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M3 17l6-6 4 4 8-8" />
    <path d="M15 7h6v6" />
  </svg>
);

export const ClockIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <circle cx="12" cy="12" r="9" />
    <path d="M12 7v5l3 2" />
  </svg>
);

export const LayoutGridIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <rect x="3" y="3" width="7" height="7" rx="1.5" />
    <rect x="14" y="3" width="7" height="7" rx="1.5" />
    <rect x="3" y="14" width="7" height="7" rx="1.5" />
    <rect x="14" y="14" width="7" height="7" rx="1.5" />
  </svg>
);

export const ChartBarIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M3 21h18" />
    <rect x="5" y="10" width="3.4" height="8" rx="1" />
    <rect x="10.3" y="6" width="3.4" height="12" rx="1" />
    <rect x="15.6" y="13" width="3.4" height="5" rx="1" />
  </svg>
);

export const CreditCardIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <rect x="3" y="5" width="18" height="14" rx="2.5" />
    <path d="M3 10h18" />
    <path d="M7 15h3" />
  </svg>
);

export const InboxIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M4 13l2.4-7.1A2 2 0 0 1 8.3 4.5h7.4a2 2 0 0 1 1.9 1.4L20 13" />
    <path d="M4 13h4a1 1 0 0 1 1 1 2 2 0 0 0 2 2h2a2 2 0 0 0 2-2 1 1 0 0 1 1-1h4" />
    <path d="M4 13v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4" />
  </svg>
);

export const MessageSquareIcon = (p: IconProps) => (
  <svg {...base} {...p}>
    <path d="M4 5h16a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H9l-5 4V6a1 1 0 0 1 1-1Z" />
  </svg>
);
