import { ChevronRight, ChevronLeft } from "lucide-react"

export function SectionBadge({ label, variant = "white" }: { label: string; variant?: "white" | "gray" }) {
  return (
    <div
      className={`inline-flex items-center gap-2 px-6 py-3 rounded-[66px] ${
        variant === "gray" ? "bg-[#ebebeb]" : "bg-white"
      }`}
    >
      <svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
        <path d="M7.73651 10.0487C7.94413 9.53035 7.27452 9.10649 6.87359 9.50244L2.52232 13.7997C2.28855 14.0305 2.33101 14.4125 2.61008 14.5892L4.70808 15.9172C4.98715 16.0939 5.36218 15.9762 5.48324 15.674L7.73651 10.0487Z" fill="#9C1D35" />
        <path d="M8.98511 6.53045C8.86987 7.07545 8.07157 7.07545 7.95634 6.53045L6.70572 0.615619C6.63853 0.297847 6.8874 0 7.2201 0H9.72134C10.054 0 10.3029 0.297848 10.2357 0.615619L8.98511 6.53045Z" fill="#9C1D35" />
        <path d="M9.23167 10.0572C9.01886 9.54086 9.68417 9.11062 10.0891 9.50273L14.4833 13.7582C14.7193 13.9868 14.6807 14.3692 14.4034 14.5485L12.3189 15.8965C12.0416 16.0759 11.6654 15.9618 11.5413 15.6607L9.23167 10.0572Z" fill="#9C1D35" />
        <path d="M6.9323 7.18408C7.42089 7.47151 7.15509 8.2056 6.58975 8.1301L0.454237 7.31071C0.124608 7.26669 -0.0805194 6.93867 0.0302586 6.63273L0.863076 4.33268C0.973854 4.02673 1.34471 3.89706 1.62959 4.06465L6.9323 7.18408Z" fill="#9C1D35" />
        <path d="M10.0677 7.18408C9.57911 7.47151 9.84491 8.2056 10.4102 8.1301L16.5458 7.31071C16.8754 7.26669 17.0805 6.93867 16.9697 6.63273L16.1369 4.33268C16.0261 4.02673 15.6553 3.89706 15.3704 4.06465L10.0677 7.18408Z" fill="#9C1D35" />
      </svg>
      <span className="font-heading text-[#20262b] text-[16px] leading-none uppercase">
        {label}
      </span>
    </div>
  )
}

export function ArrowButton({
  direction,
  theme = "light",
  disabled = false,
  size = "default",
  onClick,
}: {
  direction: "left" | "right"
  theme?: "light" | "dark"
  disabled?: boolean
  size?: "small" | "default"
  onClick?: () => void
}) {
  const borderColor = theme === "dark" ? "border-white" : "border-[#d20010]"
  const sizeClass = size === "small" ? "w-[44px] h-[44px]" : "w-[44px] h-[44px] md:w-[58px] md:h-[58px]"
  const iconSize = size === "small" ? 20 : 24

  return (
    <button
      onClick={onClick}
      disabled={disabled}
      className={`${sizeClass} rounded-full border-2 ${borderColor} flex items-center justify-center transition-all active:scale-95 ${
        disabled ? "opacity-30 cursor-not-allowed" : "opacity-100 hover:opacity-80"
      }`}
    >
      {direction === "left" ? (
        <ChevronLeft size={iconSize} strokeWidth={1.5} className={theme === "dark" ? "text-white" : "text-[#d20010]"} />
      ) : (
        <ChevronRight size={iconSize} strokeWidth={1.5} className={theme === "dark" ? "text-white" : "text-[#d20010]"} />
      )}
    </button>
  )
}

export function CtaButton({ label, variant = "red", href }: { label: string; variant?: "red" | "white"; href?: string }) {
  const isRed = variant === "red"
  const inner = (
    <div className={`flex items-center justify-center pl-[2px] py-[2px] rounded-[66px] ${isRed ? "bg-[#d20010]" : "bg-white"} group hover:opacity-90 transition-opacity`}>
      <span className={`flex items-center justify-center px-6 py-3 rounded-[44px] ${isRed ? "bg-white" : "bg-[#b70312]"}`}>
        <span
          className={`font-sans font-medium text-[16px] leading-[22px] tracking-[0.32px] uppercase whitespace-nowrap ${
            isRed ? "text-[#20262b]" : "text-white"
          }`}
        >
          {label}
        </span>
      </span>
      <span className="flex items-center justify-center w-6 h-6 mx-2">
        <svg width="8" height="14" viewBox="0 0 7.5 13.5" fill="none" xmlns="http://www.w3.org/2000/svg">
          <path
            d="M0.75 0.75C0.75 0.75 6.75 5.169 6.75 6.75C6.75 8.331 0.75 12.75 0.75 12.75"
            stroke={isRed ? "#d20010" : "#999"}
            strokeWidth="1.5"
            strokeLinecap="round"
            strokeLinejoin="round"
          />
        </svg>
      </span>
    </div>
  )

  if (href) {
    return (
      <a href={href} className="inline-block">
        {inner}
      </a>
    )
  }

  return inner
}
