"use client";

import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import NavbarStyleApple from '@/components/navbar/NavbarStyleApple/NavbarStyleApple';
import FeatureBento from '@/components/sections/feature/FeatureBento';
import BlogCardThree from '@/components/sections/blog/BlogCardThree';
import FaqBase from '@/components/sections/faq/FaqBase';
import FooterBase from '@/components/sections/footer/FooterBase';
import Link from "next/link";
import { Clock, Feather, Sparkles, Crown, Zap, Compass, BookMarked, BookMarked as BookMark } 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 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 eraBlogs = [
  {
    id: "1",
    category: "Historical Analysis",
    title: "The Mu'allaqat: Understanding Arabic Poetry's Greatest Works",
    excerpt: "Explore the seven hanging poems and their significance in pre-Islamic Arabian culture and poetry.",
    imageSrc: "http://img.b2bpic.net/free-photo/pirate-artifacts-arrangement-still-life_23-2150426415.jpg?_wi=2",
    imageAlt: "Mu'allaqat manuscripts",
    authorName: "Dr. Ahmad Al-Mansuri",
    authorAvatar: "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",
    date: "Jan 10, 2025",
  },
  {
    id: "2",
    category: "Era Development",
    title: "From Jahiliyyah to Islamic Poetry: A Cultural Transformation",
    excerpt: "Examine how Islamic values reshaped Arabic poetry and introduced new themes of spirituality and piety.",
    imageSrc: "http://img.b2bpic.net/free-photo/decorative-brick-wall-texture-background_23-2147960164.jpg?_wi=2",
    imageAlt: "Islamic era manuscripts",
    authorName: "Prof. Layla Hassan",
    authorAvatar: "http://img.b2bpic.net/free-photo/ancient-books-library-table_23-2147711433.jpg",
    date: "Jan 8, 2025",
  },
  {
    id: "3",
    category: "Literary Tradition",
    title: "The Abbasid Revolution: Innovation and Intellectual Freedom",
    excerpt: "Discover how the Abbasid Caliphate became the zenith of Arabic poetry with unprecedented creativity.",
    imageSrc: "http://img.b2bpic.net/free-photo/view-ancient-paper-scroll-writing-documenting_23-2151751744.jpg?_wi=2",
    imageAlt: "Abbasid manuscripts",
    authorName: "Dr. Fatima Al-Cordobi",
    authorAvatar: "http://img.b2bpic.net/free-photo/travelling-iran_8327-271.jpg",
    date: "Jan 5, 2025",
  },
];

const eraFaqs = [
  {
    id: "1",
    title: "What defines Pre-Islamic poetry (Jahiliyyah)?",
    content: "Pre-Islamic poetry is characterized by its oral tradition, themes of tribal pride, honor, courage in battle, and descriptions of desert life. The poets (called Jahiliyyah poets) were highly valued in Arabian society and their verses were memorized and recited. The most celebrated works are the Mu'allaqat (Hanging Poems), which showcase the linguistic perfection and poetic sophistication of the era.",
  },
  {
    id: "2",
    title: "How did the Abbasid era differ from earlier periods?",
    content: "The Abbasid era (750-1258 CE) marked a golden age of innovation and intellectual freedom. Unlike earlier periods, Abbasid poets enjoyed royal patronage, access to diverse cultural influences from conquered territories, and freedom to experiment with new themes and forms. The court became a center of literary production, and poets explored philosophy, science, love, wine, and satire with unprecedented depth and sophistication.",
  },
  {
    id: "3",
    title: "What makes Andalusian poetry unique?",
    content: "Andalusian poetry (711-1492 CE) in Islamic Spain represents a unique synthesis of Arabic, Berber, Romance, and Jewish traditions. Poets like Ibn Quzman pioneered the Zajal form (colloquial poetry) alongside classical Arabic verse. Themes centered on the beauty of Al-Andalus, courtly love, wine, and later, the poignant nostalgia of exile as Christian kingdoms advanced.",
  },
];

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: "/eras" },
      { 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 ErasPage() {
  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="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. Each era brought unique contributions to the rich tapestry of Arabic literature."
          tag="Historical Periods"
          tagIcon={Clock}
          textboxLayout="default"
          animationType="slide-up"
          useInvertedBackground={false}
          features={eraFeatures}
        />
      </div>

      <div id="blog" data-section="blog">
        <BlogCardThree
          blogs={eraBlogs}
          title="Deep Dives Into Each Era"
          description="Comprehensive analyses of each historical period, exploring the cultural, political, and artistic contexts that shaped poetic traditions."
          tag="Educational Resources"
          tagIcon={BookMark}
          textboxLayout="default"
          animationType="slide-up"
          useInvertedBackground={false}
        />
      </div>

      <div id="faq" data-section="faq">
        <FaqBase
          title="Era-Specific Questions"
          description="Learn more about the characteristics, innovations, and cultural significance of each era."
          textboxLayout="default"
          useInvertedBackground={false}
          faqsAnimation="slide-up"
          faqs={eraFaqs}
        />
      </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>
  );
}