"use client";

import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleApple from '@/components/navbar/NavbarStyleApple/NavbarStyleApple';
import HeroBillboardCarousel from '@/components/sections/hero/HeroBillboardCarousel';
import FeatureBento from '@/components/sections/feature/FeatureBento';
import MetricCardOne from '@/components/sections/metrics/MetricCardOne';
import TestimonialCardSix from '@/components/sections/testimonial/TestimonialCardSix';
import FaqBase from '@/components/sections/faq/FaqBase';
import ContactText from '@/components/sections/contact/ContactText';
import FooterBase from '@/components/sections/footer/FooterBase';
import Link from "next/link";
import { BookOpen, Clock, Feather, Sparkles, Crown, Zap, Compass, BookMarked, Award, Users, Calendar, Star, HelpCircle } from "lucide-react";

const navItems = [
  { name: "Home", id: "/" },
  { name: "Eras", id: "/eras" },
  { name: "Poets", id: "/poets" },
  { name: "Poems", id: "/poems" },
  { name: "Resources", id: "/contact" },
];

const heroMediaItems = [
  {
    imageSrc: "http://img.b2bpic.net/free-photo/decorative-brick-wall-texture-background_23-2147960164.jpg?_wi=1",
    imageAlt: "Quranic and Early Islamic Poetry",
  },
  {
    imageSrc: "http://img.b2bpic.net/free-photo/shallow-focus-shot-arabian-male-traveling-horse-desert_181624-45408.jpg?_wi=1",
    imageAlt: "Pre-Islamic Era Poetry",
  },
  {
    imageSrc: "http://img.b2bpic.net/free-photo/gothic-vaults-with-bas-reliefs-stone-church-decor-historic-cathedral-art_169016-68761.jpg?_wi=1",
    imageAlt: "Umayyad Dynasty Period",
  },
  {
    imageSrc: "http://img.b2bpic.net/free-photo/view-ancient-paper-scroll-writing-documenting_23-2151751744.jpg?_wi=1",
    imageAlt: "Abbasid Golden Age",
  },
  {
    imageSrc: "http://img.b2bpic.net/free-photo/courtyard-myrtles-alhambra_1139-25.jpg?_wi=1",
    imageAlt: "Andalusian Islamic Spain",
  },
  {
    imageSrc: "http://img.b2bpic.net/free-photo/drawings-roof-church_1122-1166.jpg?_wi=1",
    imageAlt: "Ottoman Empire Era",
  },
];

const heroButtons = [
  { text: "Explore Eras", href: "/eras" },
  { text: "Featured Poets", href: "/poets" },
];

const eraFeatures = [
  {
    title: "Pre-Islamic Era (Jahiliyyah)",
    description: "The age of tribal poets and oral tradition, celebrating courage, honor, and desert life.",
    bentoComponent: "reveal-icon",
    icon: Feather,
  },
  {
    title: "Quranic and Early Islamic",
    description: "Poetry transformed by Islamic values, emphasizing spiritual themes and divine guidance.",
    bentoComponent: "reveal-icon",
    icon: Sparkles,
  },
  {
    title: "Umayyad Period (661-750 CE)",
    description: "Court poetry flourished with sophisticated rhetoric and refined love themes.",
    bentoComponent: "reveal-icon",
    icon: Crown,
  },
  {
    title: "Abbasid Golden Age (750-1258 CE)",
    description: "The peak of Arabic poetry with unprecedented innovation, intellectual freedom, and cultural synthesis.",
    bentoComponent: "reveal-icon",
    icon: Zap,
  },
  {
    title: "Andalusian Period (711-1492 CE)",
    description: "Islamic Spain's unique poetic tradition blending Arabic, Berber, and European influences.",
    bentoComponent: "reveal-icon",
    icon: Compass,
  },
  {
    title: "Mamluk and Ottoman Eras",
    description: "Poetry during the Mamluk Sultanate and Ottoman Empire, maintaining classical traditions with new forms.",
    bentoComponent: "reveal-icon",
    icon: BookMarked,
  },
];

const metrics = [
  {
    id: "1",
    value: "500",
    title: "Years",
    description: "Pre-Islamic Poetry Tradition",
    icon: Feather,
  },
  {
    id: "2",
    value: "1400",
    title: "Years",
    description: "Islamic Era Poetry Development",
    icon: BookOpen,
  },
  {
    id: "3",
    value: "7",
    title: "Masterpieces",
    description: "Mu'allaqat Hanging Poems",
    icon: Award,
  },
  {
    id: "4",
    value: "400",
    title: "Poets",
    description: "Documented in Classical Records",
    icon: Users,
  },
];

const testimonials = [
  {
    id: "1",
    name: "Dr. Muhammad Al-Qadi",
    handle: "Professor of Arabic Literature",
    testimonial: "This platform beautifully preserves and celebrates the richness of Arabic poetry across centuries. An invaluable resource for students and scholars alike.",
    imageSrc: "http://img.b2bpic.net/free-photo/man-teacher-wearing-glasses-checking-class-register-looking-camera-happy-pleased-smiling-cheerfully-sitting-school-desk-front-blackboard-classroom_141793-131614.jpg?_wi=1",
    imageAlt: "Dr. Muhammad Al-Qadi",
  },
  {
    id: "2",
    name: "Aisha Al-Rashid",
    handle: "University Librarian",
    testimonial: "A comprehensive digital archive that makes classical Arabic poetry accessible to new generations. Simply outstanding scholarship and presentation.",
    imageSrc: "http://img.b2bpic.net/free-photo/ancient-books-library-table_23-2147711433.jpg?_wi=1",
    imageAlt: "Aisha Al-Rashid",
  },
  {
    id: "3",
    name: "Hassan Abu Bakr",
    handle: "Cultural Heritage Director",
    testimonial: "The depth of historical context and the elegant design create an immersive experience. This is how cultural heritage should be shared.",
    imageSrc: "http://img.b2bpic.net/free-photo/travelling-iran_8327-271.jpg?_wi=1",
    imageAlt: "Hassan Abu Bakr",
  },
  {
    id: "4",
    name: "Dr. Layla Mansour",
    handle: "Poetry Critic & Author",
    testimonial: "The curated selections and scholarly annotations demonstrate a profound understanding of Arabic literary traditions. Highly recommended.",
    imageSrc: "http://img.b2bpic.net/free-photo/pirate-artifacts-arrangement-still-life_23-2150426415.jpg?_wi=1",
    imageAlt: "Dr. Layla Mansour",
  },
  {
    id: "5",
    name: "Omar Al-Aziz",
    handle: "Literary Researcher",
    testimonial: "Finally, a platform that honors the complexity and beauty of classical Arabic verse. A must-visit for anyone passionate about literature.",
    imageSrc: "http://img.b2bpic.net/free-photo/view-ancient-paper-scroll-writing-documenting_23-2151751756.jpg?_wi=1",
    imageAlt: "Omar Al-Aziz",
  },
  {
    id: "6",
    name: "Dr. Noor Al-Hayyan",
    handle: "Islamic Studies Professor",
    testimonial: "The historical accuracy combined with aesthetic presentation makes this an essential educational tool. Bravo to the entire team.",
    imageSrc: "http://img.b2bpic.net/free-photo/medieval-historical-rendering-turkish-man_23-2151060340.jpg?_wi=1",
    imageAlt: "Dr. Noor Al-Hayyan",
  },
];

const faqs = [
  {
    id: "1",
    title: "What is the Mu'allaqat and why is it important?",
    content: "The Mu'allaqat (Hanging Poems) are seven celebrated pre-Islamic Arabic poems traditionally hung in the Kaaba in Mecca. They represent the pinnacle of pre-Islamic poetry and showcase the linguistic perfection and literary sophistication of ancient Arabic. These poems are foundational to understanding classical Arabic poetry and Arab cultural identity.",
  },
  {
    id: "2",
    title: "How does Arabic poetry differ across historical eras?",
    content: "Each era brought distinct innovations: Pre-Islamic poetry emphasized tribal honor and desert life; Islamic era poetry incorporated spiritual themes; Umayyad poetry refined court aesthetics; Abbasid poetry achieved unprecedented intellectual freedom and innovation; Andalusian poetry developed unique cultural synthesis; and Ottoman era poetry maintained classical traditions while introducing new forms influenced by Persian and Turkish influences.",
  },
  {
    id: "3",
    title: "Who was Al-Mutanabbi and why is he significant?",
    content: "Al-Mutanabbi (915-965 CE) was one of the greatest Arabic poets of the Abbasid era, known for his ambitious spirit and claim to prophethood (giving him his name meaning 'the one who claims to be a prophet'). His works combine political panegyric with profound philosophical themes, and his poetry is celebrated for its technical mastery and innovative use of language, influencing Arabic literature for centuries.",
  },
  {
    id: "4",
    title: "How can I use these poems in academic research?",
    content: "Our platform provides scholarly annotations, historical context, and high-quality texts suitable for academic citation. We recommend consulting the original Arabic texts along with respected English translations. Each poem entry includes information about its author, era, themes, and cultural significance to support your research. For formal citations, always reference the original manuscripts and scholarly editions.",
  },
  {
    id: "5",
    title: "What makes Andalusian poetry unique?",
    content: "Andalusian poetry developed in Islamic Spain (711-1492 CE) and represents a unique cultural synthesis of Arabic, Berber, Romance, and Jewish traditions. It introduced new forms like the Zajal (colloquial verse) and developed distinct themes around court life, wine, love, and the beauty of landscape. The Andalusian tradition influenced both Arabic and European poetry and represents one of history's greatest examples of cultural cross-pollination.",
  },
  {
    id: "6",
    title: "Are there English translations available?",
    content: "Yes, we provide recommendations for respected English translations of major works and poets. However, many nuances of classical Arabic poetry are lost in translation, so we encourage learning classical Arabic to fully appreciate the original verse. Our platform includes original Arabic texts alongside carefully selected translations to provide both accessibility and authenticity.",
  },
];

const footerColumns = [
  {
    title: "Explore",
    items: [
      { label: "Home", href: "/" },
      { label: "Historical Eras", href: "/eras" },
      { label: "Greatest Poets", href: "/poets" },
      { label: "Masterpiece Poems", href: "/poems" },
    ],
  },
  {
    title: "Resources",
    items: [
      { label: "Poetry Insights", href: "/contact" },
      { label: "FAQ", href: "/" },
      { label: "Scholarly Articles", href: "#" },
      { label: "Research Tools", href: "#" },
    ],
  },
  {
    title: "Connect",
    items: [
      { label: "About Us", href: "/about" },
      { label: "Contact", href: "/contact" },
      { label: "Subscribe", href: "#" },
      { label: "Privacy Policy", href: "#" },
    ],
  },
];

export default function HomePage() {
  return (
    <ThemeProvider
      defaultButtonVariant="expand-hover"
      defaultTextAnimation="reveal-blur"
      borderRadius="soft"
      contentWidth="medium"
      sizing="largeSmallSizeLargeTitles"
      background="noise"
      cardStyle="gradient-bordered"
      primaryButtonStyle="primary-glow"
      secondaryButtonStyle="radial-glow"
      headingFontWeight="light"
    >
      <div id="nav" data-section="nav">
        <NavbarStyleApple
          brandName="Arabic Poetry"
          navItems={navItems.map(item => ({
            name: item.name,
            id: item.id.startsWith('/') ? item.id : `#${item.id}`,
          }))}
        />
      </div>

      <div id="hero" data-section="hero">
        <HeroBillboardCarousel
          title="The Timeless Voice of Arabic Poetry"
          description="Journey through five magnificent eras of Arabic literature, from pre-Islamic tribal verse to the refined courts of the Ottoman Empire. Discover the greatest poets and their immortal works."
          tag="Literary Heritage"
          tagIcon={BookOpen}
          background={{ variant: "sparkles-gradient" }}
          buttons={heroButtons}
          mediaItems={heroMediaItems}
        />
      </div>

      <div id="eras" data-section="eras">
        <FeatureBento
          title="Five Golden Eras of Arabic Poetry"
          description="Explore the distinct characteristics, themes, and innovations that defined each period of Arabic poetic tradition."
          tag="Historical Periods"
          tagIcon={Clock}
          textboxLayout="default"
          animationType="slide-up"
          useInvertedBackground={false}
          features={eraFeatures}
        />
      </div>

      <div id="timeline" data-section="timeline">
        <MetricCardOne
          title="Poetry Through The Millennia"
          description="Key milestones and achievements in Arabic poetic history spanning nearly two thousand years of literary excellence."
          tag="Historical Timeline"
          tagIcon={Calendar}
          textboxLayout="default"
          animationType="slide-up"
          useInvertedBackground={true}
          gridVariant="uniform-all-items-equal"
          metrics={metrics}
        />
      </div>

      <div id="testimonials" data-section="testimonials">
        <TestimonialCardSix
          title="Trusted by Scholars & Institutions"
          description="Hear from leading academics, cultural institutions, and poetry enthusiasts about the value of our platform."
          tag="Expert Voices"
          tagIcon={Star}
          textboxLayout="default"
          animationType="slide-up"
          useInvertedBackground={true}
          testimonials={testimonials}
        />
      </div>

      <div id="faq" data-section="faq">
        <FaqBase
          title="Frequently Asked Questions"
          description="Get answers to common questions about Arabic poetry, our collections, and how to navigate the platform."
          tag="Help & Support"
          tagIcon={HelpCircle}
          textboxLayout="default"
          useInvertedBackground={false}
          faqsAnimation="slide-up"
          faqs={faqs}
        />
      </div>

      <div id="contact" data-section="contact">
        <ContactText
          text="Join our community of poets, scholars, and enthusiasts dedicated to preserving and celebrating Arabic literary heritage. Share your insights, contribute research, or simply deepen your appreciation for this timeless art form."
          animationType="reveal-blur"
          background={{ variant: "sparkles-gradient" }}
          useInvertedBackground={true}
          buttons={[
            { text: "Get In Touch", href: "/contact" },
            { text: "Subscribe to Updates", href: "#" },
          ]}
        />
      </div>

      <div id="footer" data-section="footer">
        <FooterBase
          logoText="Arabic Poetry"
          copyrightText="© 2025 Arabic Poetry Heritage. Preserving literary traditions since antiquity."
          columns={footerColumns}
        />
      </div>
    </ThemeProvider>
  );
}