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

export default function OnboardingPage() {
  return (
    <div className="bg-[#0E0E0E] text-white font-body min-h-screen flex flex-col">
      {/* TopAppBar */}
      <header className="bg-[#0E0E0E]/80 backdrop-blur-md flex justify-between items-center px-6 py-5 w-full sticky top-0 z-50 border-b border-white/10">
        <div className="text-2xl font-black text-white tracking-tighter uppercase italic font-headline">VivaFit 50+</div>
        <div className="flex items-center gap-6">
          <button className="p-2 hover:bg-[#242424] transition-colors rounded-full">
            <span className="material-symbols-outlined text-white">search</span>
          </button>
          <button className="p-2 hover:bg-[#242424] transition-colors rounded-full">
            <span className="material-symbols-outlined text-white">notifications</span>
          </button>
          <div className="w-12 h-12 rounded-full overflow-hidden bg-[#242424] border-2 border-[#CCFF00]">
            <img
              alt="User profile photo"
              className="w-full h-full object-cover"
              src="https://lh3.googleusercontent.com/aida-public/AB6AXuBalucTPx3uH83FbFDA1LNa4kXDD7qT-QCCtZB8EHc-xTNLdhonoLFIGnxM-0rk3syN0Li89I4PZ1IDiGPWht_V-vbsxdnqlo6vkr989OV6srt0djgLt16QAehZBRcXLi9aV3tvX6OS2TVtbW7HnuK8RiugqxLoxxzlFvdyyXLrrPgPx3aZ24tetBl-4GM7p3Xo0rW0lFz8o4EYsupoHqBSbWz30jjDSHwJFR8BTm0EZYa-aUFVX_y-WWEQeErH0msllMcmFrpSIL0"
            />
          </div>
        </div>
      </header>

      <main className="flex-1 flex flex-col items-center justify-center p-6 md:p-12 lg:p-16">
        <div className="max-w-6xl w-full">
          {/* Progress Stepper */}
          <div className="grid grid-cols-3 gap-6 mb-16">
            <div className="group flex flex-col gap-4">
              <div className="h-3 rounded-full bg-[#CCFF00]/40"></div>
              <span className="text-sm md:text-base font-black uppercase tracking-[0.25em] text-white/40 font-headline">01 Perfil</span>
            </div>
            <div className="group flex flex-col gap-4">
              <div className="h-3 rounded-full bg-[#CCFF00] shadow-[0_0_20px_rgba(204,255,0,0.6)] transition-all duration-500"></div>
              <span className="text-sm md:text-base font-black uppercase tracking-[0.25em] text-[#CCFF00] font-headline">02 Saúde</span>
            </div>
            <div className="group flex flex-col gap-4">
              <div className="h-3 rounded-full bg-[#2D2D2D] border border-white/20"></div>
              <span className="text-sm md:text-base font-black uppercase tracking-[0.25em] text-white/60 font-headline">03 Objetivo</span>
            </div>
          </div>

          {/* Main Layout Bento */}
          <div className="grid grid-cols-1 lg:grid-cols-12 gap-12 items-start">
            {/* Left: Hero Headline */}
            <div className="lg:col-span-5 space-y-8 sticky top-32">
              <h1 className="text-6xl md:text-7xl lg:text-8xl font-black text-white leading-[0.9] tracking-tighter font-headline">
                FOCO NA<br />SUA<br />
                <span className="text-[#CCFF00] italic">SAÚDE 50+</span>.
              </h1>
              <p className="text-xl text-[#A8A8A8] font-medium leading-relaxed max-w-sm">
                Precisamos entender sua condição atual para garantir um treino seguro e eficiente.
              </p>
              <div className="hidden lg:block">
                <div className="bg-[#1A1A1A] p-8 rounded-xl border-l-8 border-[#CCFF00] shadow-2xl">
                  <p className="italic text-lg text-white font-light leading-relaxed">
                    &quot;O exercício é o remédio mais potente para a longevidade com qualidade.&quot;
                  </p>
                </div>
              </div>
            </div>

            {/* Right: High-Contrast Form */}
            <div className="lg:col-span-7 bg-[#1A1A1A]/80 backdrop-blur-2xl p-10 md:p-14 rounded-xl border border-white/10 shadow-[0_40px_100px_-20px_rgba(0,0,0,0.8)]">
              <form className="space-y-12">
                {/* Goal Section */}
                <div className="space-y-6">
                  <label className="text-xs font-black text-[#CCFF00] uppercase tracking-[0.3em] font-headline">
                    Qual o seu principal objetivo?
                  </label>
                  <div className="grid grid-cols-1 gap-4">
                    {/* Option 1 */}
                    <label className="cursor-pointer group">
                      <input className="hidden peer" name="goal" type="radio" defaultChecked />
                      <div className="bg-[#2D2D2D] border-2 border-transparent peer-checked:border-[#CCFF00] p-6 rounded-xl flex items-center justify-between transition-all">
                        <div className="flex items-center gap-4">
                          <span className="material-symbols-outlined text-3xl">fitness_center</span>
                          <span className="font-bold text-lg font-headline">Ganho de Massa e Força</span>
                        </div>
                        <span className="material-symbols-outlined opacity-0 peer-checked:opacity-100 text-[#CCFF00]">
                          check_circle
                        </span>
                      </div>
                    </label>
                    {/* Option 2 */}
                    <label className="cursor-pointer group">
                      <input className="hidden peer" name="goal" type="radio" />
                      <div className="bg-[#2D2D2D] border-2 border-transparent peer-checked:border-[#CCFF00] p-6 rounded-xl flex items-center justify-between transition-all">
                        <div className="flex items-center gap-4">
                          <span className="material-symbols-outlined text-3xl">monitor_heart</span>
                          <span className="font-bold text-lg font-headline">Saúde Cardiovascular e Vitalidade</span>
                        </div>
                        <span className="material-symbols-outlined opacity-0 peer-checked:opacity-100 text-[#CCFF00]">
                          check_circle
                        </span>
                      </div>
                    </label>
                    {/* Option 3 */}
                    <label className="cursor-pointer group">
                      <input className="hidden peer" name="goal" type="radio" />
                      <div className="bg-[#2D2D2D] border-2 border-transparent peer-checked:border-[#CCFF00] p-6 rounded-xl flex items-center justify-between transition-all">
                        <div className="flex items-center gap-4">
                          <span className="material-symbols-outlined text-3xl">balance</span>
                          <span className="font-bold text-lg font-headline">Mobilidade e Flexibilidade</span>
                        </div>
                        <span className="material-symbols-outlined opacity-0 peer-checked:opacity-100 text-[#CCFF00]">
                          check_circle
                        </span>
                      </div>
                    </label>
                  </div>
                </div>

                {/* Medical Recommendation */}
                <div className="space-y-6">
                  <label className="text-xs font-black text-[#A8A8A8] uppercase tracking-[0.3em] font-headline">
                    Possui alguma recomendação médica?
                  </label>
                  <textarea
                    className="w-full bg-[#2D2D2D] border-2 border-transparent focus:border-[#CCFF00] rounded-xl p-6 text-xl font-medium text-white transition-all placeholder-[#A8A8A8]/50 min-h-[120px] outline-none"
                    placeholder="Ex: Evitar impactos, restrição de carga lombar..."
                  ></textarea>
                </div>

                {/* Weekly Frequency */}
                <div className="space-y-6">
                  <label className="text-xs font-black text-[#A8A8A8] uppercase tracking-[0.3em] font-headline">
                    Frequência semanal desejada?
                  </label>
                  <div className="flex gap-4">
                    <label className="flex-1 cursor-pointer">
                      <input className="hidden peer" name="frequency" type="radio" />
                      <div className="bg-[#2D2D2D] border-2 border-transparent peer-checked:bg-[#CCFF00] peer-checked:text-black p-6 rounded-xl text-center font-black text-2xl transition-all font-headline">
                        2x
                      </div>
                    </label>
                    <label className="flex-1 cursor-pointer">
                      <input className="hidden peer" name="frequency" type="radio" defaultChecked />
                      <div className="bg-[#2D2D2D] border-2 border-transparent peer-checked:bg-[#CCFF00] peer-checked:text-black p-6 rounded-xl text-center font-black text-2xl transition-all font-headline">
                        3x
                      </div>
                    </label>
                    <label className="flex-1 cursor-pointer">
                      <input className="hidden peer" name="frequency" type="radio" />
                      <div className="bg-[#2D2D2D] border-2 border-transparent peer-checked:bg-[#CCFF00] peer-checked:text-black p-6 rounded-xl text-center font-black text-2xl transition-all font-headline">
                        4x
                      </div>
                    </label>
                    <label className="flex-1 cursor-pointer">
                      <input className="hidden peer" name="frequency" type="radio" />
                      <div className="bg-[#2D2D2D] border-2 border-transparent peer-checked:bg-[#CCFF00] peer-checked:text-black p-6 rounded-xl text-center font-black text-2xl transition-all font-headline">
                        5x+
                      </div>
                    </label>
                  </div>
                </div>

                {/* CTA */}
                <div className="pt-8">
                  <Link href="/dashboard">
                    <button
                      className="w-full bg-[#CCFF00] text-black h-24 rounded-xl font-black text-2xl flex items-center justify-center gap-4 hover:scale-[1.02] active:scale-[0.98] transition-all shadow-[0_20px_60px_-10px_rgba(204,255,0,0.5)] uppercase italic tracking-tighter font-headline"
                      type="button"
                    >
                      DEFINIR OBJETIVOS
                      <span className="material-symbols-outlined text-3xl">arrow_forward</span>
                    </button>
                  </Link>
                </div>
              </form>
            </div>
          </div>
        </div>
      </main>

      {/* Footer Security */}
      <footer className="p-8 md:p-12 border-t border-white/10 bg-black/50">
        <div className="max-w-6xl mx-auto flex flex-col md:flex-row items-center justify-between gap-8 opacity-50">
          <div className="flex items-center gap-4">
            <span className="material-symbols-outlined text-[#CCFF00] text-4xl">shield_with_heart</span>
            <p className="text-sm font-medium">
              Seus dados são protegidos por criptografia de ponta a ponta e protocolos médicos.
            </p>
          </div>
          <div className="flex gap-12 text-xs font-black uppercase tracking-[0.2em] font-headline">
            <Link href="#" className="hover:text-[#CCFF00] transition-colors">Privacidade</Link>
            <Link href="#" className="hover:text-[#CCFF00] transition-colors">Suporte 24h</Link>
            <Link href="#" className="hover:text-[#CCFF00] transition-colors">Termos</Link>
          </div>
        </div>
      </footer>
    </div>
  );
}
