import { Suspense } from "react";
import { getProfilAktif } from "@/lib/data";
import { ProfileTabs } from "@/components/public/profile-tabs";

// Force dynamic rendering
export const dynamic = 'force-dynamic';

export default async function ProfilPage() {
    const profilData = await getProfilAktif();

    return (
        <div data-theme="dark" className="min-h-screen bg-[#07090f] flex flex-col">
            {/* 1. Hero Section */}
            <main className="w-full min-h-[60vh] pt-32 pb-32 bg-[#07090f] overflow-hidden relative flex flex-col items-center justify-center">
            {/* Background: bg-hero.png + dark overlay */}
            <div className="absolute inset-0 z-0">
                {/* eslint-disable-next-line @next/next/no-img-element */}
                <img src="/bg-hero.png" alt="" className="w-full h-full object-cover object-center" />
                {/* Dark overlay */}
                <div className="absolute inset-0 bg-[#07090f]/82"></div>
            </div>

            {/* Bottom Fade Gradient for blending */}
            <div className="absolute bottom-0 left-0 w-full h-40 bg-gradient-to-t from-[#07090f] to-transparent z-10 pointer-events-none"></div>

            {/* Subtle grid */}
            <div className="absolute inset-0 z-[1] pointer-events-none">
                <div className="absolute inset-0 opacity-[0.04]" style={{backgroundImage: 'linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px)', backgroundSize: '60px 60px'}}></div>
            </div>

                <div className="container px-4 md:px-8 relative z-20 w-full flex flex-col items-center text-center">

                    <h1 className="animate-in fade-in slide-in-from-bottom-6 duration-700 delay-100 font-sans leading-[1.05] tracking-tight mb-6">
                        <span className="block text-4xl sm:text-5xl md:text-6xl lg:text-7xl font-black text-white">
                            Kenali Kami
                        </span>
                        <span className="block text-4xl sm:text-5xl md:text-6xl lg:text-7xl font-black text-white/30">
                            Lebih Dekat
                        </span>
                    </h1>

                    <p className="animate-in fade-in slide-in-from-bottom-8 duration-700 delay-200 text-gray-400 text-lg md:text-xl max-w-2xl text-center leading-relaxed font-light mb-12">
                        Menyelami identitas dan sejarah di bawah naungan Himpunan Mahasiswa Fisika FPMIPA Universitas Pendidikan Indonesia.
                    </p>

                </div>            </main>

            {/* 2. Interactive Tabs Section (Sejarah, Lambang, Mars) */}
            <section className="w-full pb-24">
                <Suspense fallback={<div className="container px-4 text-center py-20 text-gray-500">Memuat informasi profil...</div>}>
                    <ProfileTabs profil={profilData} />
                </Suspense>
            </section>
        </div>
    );
}
