import Link from "next/link";
import Image from "next/image";

const SOCIAL_LINKS = {
  instagram: "https://www.instagram.com/Falltaroti/",
  telegram: "https://t.me/Falltaroti50",
  bale: "https://web.bale.ai/@falltarotiii",
  rubika: "https://rubika.ir/falltarotiii",
} as const;

const ICON_CLASS = "size-5 text-muted-foreground hover:text-primary transition-colors";

export function SiteFooter() {
  return (
    <footer className="border-t border-border/80 bg-surface py-8 text-center text-sm text-muted-foreground">
      <div className="flex justify-center gap-6 mb-4 flex-wrap">
        <Link href={SOCIAL_LINKS.instagram} target="_blank" rel="noopener noreferrer" aria-label="اینستاگرام">
          <svg className={ICON_CLASS} viewBox="0 0 24 24" fill="currentColor" aria-hidden>
            <path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.919 0 3.274-.012 3.584-.069 4.919-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.85-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.919 0-3.273.012-3.584.07-4.919.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z" />
          </svg>
        </Link>
        <Link href={SOCIAL_LINKS.telegram} target="_blank" rel="noopener noreferrer" aria-label="تلگرام">
          <svg className={ICON_CLASS} viewBox="0 0 24 24" fill="currentColor" aria-hidden>
            <path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z" />
          </svg>
        </Link>
        <Link
          href={SOCIAL_LINKS.bale}
          target="_blank"
          rel="noopener noreferrer"
          aria-label="بله"
          className={`inline-flex items-center ${ICON_CLASS}`}
        >
          <span
            aria-hidden
            className="size-6 shrink-0 bg-current [mask-image:url('/bale.svg')] [mask-size:contain] [mask-repeat:no-repeat] [mask-position:center] [-webkit-mask-image:url('/bale.svg')] [-webkit-mask-size:contain] [-webkit-mask-repeat:no-repeat] [-webkit-mask-position:center]"
          />
        </Link>
        <Link href={SOCIAL_LINKS.rubika} target="_blank" rel="noopener noreferrer" aria-label="روبیکا">
          <Image
            src="/rubika.png"
            alt="روبیکا"
            width={24}
            height={24}
            className="size-6 object-contain opacity-70 transition-opacity hover:opacity-100"
            unoptimized
          />
        </Link>
      </div>
      <div className="flex justify-center">
        <Image
          src="/logo.png"
          alt="فال تاروت"
          width={112}
          height={112}
          className="h-28 w-auto object-contain"
          unoptimized
        />
      </div>
      <div className="mt-3 flex justify-center">
        <a
          referrerPolicy="origin"
          target="_blank"
          href="https://trustseal.enamad.ir/?id=726359&Code=h14rFUeFNNZM9JllohSg2eofq3PRXVWP"
        >
          {/* eslint-disable-next-line @next/next/no-img-element */}
          <img
            referrerPolicy="origin"
            src="https://trustseal.enamad.ir/logo.aspx?id=726359&Code=h14rFUeFNNZM9JllohSg2eofq3PRXVWP"
            alt=""
            style={{ cursor: "pointer" }}
            {...{ code: "h14rFUeFNNZM9JllohSg2eofq3PRXVWP" }}
          />
        </a>
      </div>
      <p className="mt-3">
        برای پشتیبانی با شماره{" "}
        <a href="tel:09901231401" className="underline">
          09901231401
        </a>{" "}
        تماس بگیرید.
      </p>
      <p className="mt-1">تمامی حقوق محفوظ است.</p>
    </footer>
  );
}
