/* eslint-disable @next/next/no-img-element */
import Link from "next/link";
import {BsBook, BsHeadphones, BsMegaphone, BsPen} from "react-icons/bs";
import Navbar from "@/components/Navbar";
import Footer from "@/components/Footer";
import translation from "@/translation/home.json";
import clsx from "clsx";
import Tag from "@/components/Tag";
import Title from "@/components/Title";

interface Props {
	language: "en" | "ar";
}

export default function Home({language}: Props) {
	return (
		<main
			className={clsx("h-screen w-full bg-white text-mti-black flex flex-col", language === "ar" && "text-right")}
			dir={language === "ar" ? "rtl" : "ltr"}>
			<Navbar currentPage="/" language={language} />

			<section className="w-full relative bg-white">
				<img src="/banner_encoach_home.png" alt="IELTS Packages - Together we prepare for the future" className="w-full" />
				<Link href={language === "ar" ? "/ar/price" : "/price"}>
					<button className="absolute bottom-1/12 -lg:hidden left-1/12 bg-mti-purple-light hover:bg-mti-purple text-white rounded-xl px-8 py-4 transition ease-in-out duration-300 shadow">
						{translation.get_started_btn[language]}
					</button>
				</Link>
			</section>

			{/* Modules Section */}
			<section className="w-full bg-white">
				<div className="w-full grid grid-rows-4 md:grid-rows-1 md:grid-cols-4 gap-8 p-8 md:p-20 container mx-auto">
					<div className="flex flex-col items-center gap-6">
						<div className="bg-mti-rose-ultralight border border-mti-rose-light p-6 rounded-3xl flex items-center justify-center">
							<BsBook className="text-mti-rose-light w-10 h-10" />
						</div>
						<div className={clsx("flex flex-col gap-4 items-center max-w-[260px]", language === "ar" ? "text-right" : "text-left")}>
							<span className="font-bold text-xl">{translation.modules.reading.title[language]}</span>
							<span>{translation.modules.reading.description[language]}</span>
						</div>
					</div>
					<div className="flex flex-col items-center gap-6">
						<div className="bg-mti-rose-ultralight border border-mti-rose-light p-6 rounded-3xl flex items-center justify-center">
							<BsHeadphones className="text-mti-rose-light w-10 h-10" />
						</div>
						<div className={clsx("flex flex-col gap-4 items-center max-w-[260px]", language === "ar" ? "text-right" : "text-left")}>
							<span className="font-bold text-xl">{translation.modules.listening.title[language]}</span>
							<span>{translation.modules.listening.description[language]}</span>
						</div>
					</div>
					<div className="flex flex-col items-center gap-6">
						<div className="bg-mti-rose-ultralight border border-mti-rose-light p-6 rounded-3xl flex items-center justify-center">
							<BsPen className="text-mti-rose-light w-10 h-10" />
						</div>
						<div className={clsx("flex flex-col gap-4 items-center max-w-[260px]", language === "ar" ? "text-right" : "text-left")}>
							<span className="font-bold text-xl">{translation.modules.writing.title[language]}</span>
							<span>{translation.modules.writing.description[language]}</span>
						</div>
					</div>
					<div className="flex flex-col items-center gap-6">
						<div className="bg-mti-rose-ultralight border border-mti-rose-light p-6 rounded-3xl flex items-center justify-center">
							<BsMegaphone className="text-mti-rose-light w-10 h-10" />
						</div>
						<div className={clsx("flex flex-col gap-4 items-center max-w-[260px]", language === "ar" ? "text-right" : "text-left")}>
							<span className="font-bold text-xl">{translation.modules.speaking.title[language]}</span>
							<span>{translation.modules.speaking.description[language]}</span>
						</div>
					</div>
				</div>
			</section>

			{/* Learn with AI */}
			<section className="w-full bg-mti-gray-seasalt">
				<div className="w-full p-8 lg:py-24 lg:px-12 flex flex-col gap-8 md:gap-24 lg:flex-row items-center justify-center container mx-auto">
					<div className="flex flex-col gap-8">
						<Tag>{translation.learn_ai.tag[language]}</Tag>
						<div className={clsx("flex flex-col gap-3", language === "ar" && "items-end")}>
							<Title>{translation.learn_ai.title[language]}</Title>
							<p className="max-w-lg text-base">{translation.learn_ai.description[language]}</p>
						</div>
						<Link href="/price">
							<button className="bg-mti-purple-light hover:bg-mti-purple text-white rounded-xl px-8 py-4 transition ease-in-out duration-300 shadow">
								{translation.learn_more[language]}
							</button>
						</Link>
					</div>
					<div className="relative -md:h-64 grid grid-cols-1 place-items-center gap-8">
						<img src="/writing-evaluation.png" alt="Writing Evaluation" className="-md:w-full md:h-80 shadow rounded-xl" />
					</div>
				</div>
			</section>

			{/* EnCoach Benefits Section */}
			<section className="w-full bg-white">
				<div className="w-full p-8 md:p-20 lg:p-32 flex flex-col-reverse gap-8 md:gap-24 md:flex-row items-center justify-center container mx-auto">
					<div className="relative h-fit grid grid-cols-2 place-items-center gap-8 -md:px-8">
						<div className="w-60 h-60 rounded-xl overflow-hidden flex items-center justify-center">
							<img src="/person_laptop_3.jpg" alt="Person using a laptop" />
						</div>
						<div className="w-60 h-80 rounded-xl overflow-hidden flex items-center justify-center row-span-2">
							<img src="/person_laptop_1.jpg" alt="Person using a laptop" />
						</div>
						<div className="w-60 h-60 rounded-xl overflow-hidden flex items-center justify-center">
							<img src="/person_laptop_2.jpg" alt="Person using a laptop" />
						</div>
					</div>
					<div className="flex flex-col gap-8">
						<Tag>{translation.encoach_benefits.tag[language]}</Tag>
						<div className={clsx("flex flex-col gap-3", language === "ar" && "items-end")}>
							<Title>{translation.encoach_benefits.title[language]}</Title>
							<p className="max-w-lg text-base">{translation.encoach_benefits.description[language]}</p>
						</div>
						<Link href="/about">
							<button className="bg-mti-purple-light hover:bg-mti-purple text-white rounded-xl px-8 py-4 transition ease-in-out duration-300 shadow">
								{translation.learn_more[language]}
							</button>
						</Link>
					</div>
				</div>
			</section>

			{/* Interested Section */}
			<section className="w-full bg-mti-gray-seasalt">
				<div className="w-full p-8 py-16 md:py-32 md:px-16 lg:px-28 items-center justify-center flex flex-col gap-10 relative container mx-auto">
					<Tag>{translation.interested.tag[language]}</Tag>
					<Title className="!max-w-sm text-center">{translation.interested.title[language]}</Title>
					<Link href="/contact">
						<button className="bg-mti-purple-light hover:bg-mti-purple text-white rounded-xl px-8 py-4 transition ease-in-out duration-300 shadow">
							{translation.interested.contact_us[language]}
						</button>
					</Link>
					<div className="lg:absolute top-1/2 lg:-translate-y-2/3 right-1/6 flex flex-col items-center">
						<em className="text-xs text-mti-purple-light font-semibold">{translation.interested.whatsapp[language]}</em>
						<img className="w-32 h-32" alt="WhatsApp QR Code for MTI" src="/whatsapp_qrcode.png" />
						<div className="w-full h-full relative">
							<div className="w-3 h-3 bg-mti-purple rounded-full absolute -bottom-6" />
							<div className="w-3 h-3 bg-mti-purple rounded-full absolute -bottom-0 -left-6" />
							<div className="w-3 h-3 bg-mti-purple rounded-full absolute bottom-6 -left-6" />
							<div className="w-3 h-3 bg-mti-purple rounded-full absolute bottom-12 -left-6" />
							<div className="w-3 h-3 bg-mti-purple rounded-full absolute bottom-18 -left-6" />
							<div className="w-3 h-3 bg-mti-purple rounded-full absolute -bottom-6 -left-6" />
							<div className="w-3 h-3 bg-mti-purple rounded-full absolute -bottom-6 left-6" />
							<div className="w-3 h-3 bg-mti-purple rounded-full absolute -bottom-6 left-12" />
							<div className="w-3 h-3 bg-mti-purple rounded-full absolute -bottom-6 left-18" />
						</div>
					</div>
				</div>
			</section>

			{/* CEO Message Section */}
			<section className="w-full bg-white">
				<div className="w-full px-8 pt-12 pb-20 md:p-20 lg:p-32 flex flex-col gap-12 md:flex-row items-center justify-around container mx-auto">
					<div className="flex flex-col gap-8">
						<Tag>{translation.ceo_message.tag[language]}</Tag>
						<div className={clsx("flex flex-col gap-3", language === "ar" && "items-end")}>
							<Title>{translation.ceo_message.title[language]}</Title>
							<p className="max-w-lg text-base">{translation.ceo_message.description[language]}</p>
						</div>
						<Link href={`${language === "ar" ? "/ar" : ""}/about#message`}>
							<button className="bg-mti-purple-light hover:bg-mti-purple text-white rounded-xl px-8 py-4 transition ease-in-out duration-300 shadow">
								{translation.learn_more[language]}
							</button>
						</Link>
					</div>
					<div className="w-fit h-fit relative">
						<div className="w-64 h-64 md:w-80 md:h-80 rounded-t-[80px] rounded-br-[80px] md:rounded-t-[120px] md:rounded-br-[120px] overflow-hidden">
							<img className="w-full h-full" alt="MTI's CEO" src="/DrNasserALDhahli.jpeg" />
						</div>
						<div>
							<div className="w-5 h-5 rounded-full bg-mti-purple-ultralight absolute left-10 -bottom-10" />
							<div className="w-5 h-5 rounded-full bg-mti-purple-ultralight absolute left-20 -bottom-10" />
							<div className="w-5 h-5 rounded-full bg-mti-purple-ultralight absolute left-30 -bottom-10" />
							<div className="w-5 h-5 rounded-full bg-mti-purple-ultralight absolute -bottom-10 left-0" />
							<div className="w-5 h-5 rounded-full bg-mti-purple-ultralight absolute -left-10 -bottom-10" />
							<div className="w-5 h-5 rounded-full bg-mti-purple-ultralight absolute -left-10 bottom-0" />
							<div className="w-5 h-5 rounded-full bg-mti-purple-ultralight absolute -left-10 bottom-10" />
							<div className="w-5 h-5 rounded-full bg-mti-purple-ultralight absolute -left-10 bottom-20" />
							<div className="w-5 h-5 rounded-full bg-mti-purple-ultralight absolute -left-10 bottom-30" />
						</div>
					</div>
				</div>
			</section>

			{/* Partner and Accreditation Section */}
			{/* <section className="w-full bg-white">
				<div className="p-8 md:p-20 xl:p-32 flex flex-col gap-8 md:gap-24 lg:gap-32 w-full container mx-auto">
					<div className="flex flex-col gap-12 w-full">
						<span className="text-white bg-mti-rose-light px-1 py-0 font-semibold w-fit">{translation.our_partners[language]}</span>
						<div className="flex gap-9 flex-wrap -lg:justify-center items-center">
							<div className="w-48 h-48 xl:w-52 xl:h-52 shadow-lg rounded-xl flex items-center justify-center">
								<img src="/logos/sohar_aluminium_logo.png" alt="Sohar Aluminium's Logo" />
							</div>
						</div>
					</div>
					<div className="flex flex-col gap-12 w-full">
						<span className="text-white bg-mti-rose-light px-1 py-0 font-semibold w-fit">{translation.accreditation[language]}</span>
						<div className="flex gap-9 flex-wrap -lg:justify-center items-center">
							<div className="w-48 h-48 xl:w-52 xl:h-52 shadow-lg rounded-xl flex items-center justify-center">
								<img src="/logos/idp_logo.png" alt="IDP's Logo" />
							</div>
						</div>
					</div>
				</div>
			</section> */}

			<Footer language={language} />
		</main>
	);
}
