"use client";

import { useTranslations, useLocale } from 'next-intl';
import { motion, useScroll, useTransform, useInView, useSpring, AnimatePresence } from 'framer-motion';
import { useRef, useState, useEffect } from 'react';
import Image from 'next/image';

export default function EntrepreneurJourney() {
  const t = useTranslations('entrepreneurJourney');
  const locale = useLocale();
  const containerRef = useRef<HTMLElement>(null);
  const [activeStep, setActiveStep] = useState<number>(0);
  const [isMobile, setIsMobile] = useState(false);
  const [hoveredStep, setHoveredStep] = useState<number | null>(null); 
  const [hoveredTitle, setHoveredTitle] = useState(false);

  // Ekran boyutu tespit işlemi
  useEffect(() => {
    const checkScreenSize = () => {
      setIsMobile(window.innerWidth < 768);
    };
    
    checkScreenSize();
    window.addEventListener('resize', checkScreenSize);
    return () => window.removeEventListener('resize', checkScreenSize);
  }, []);

  // Yolculuğun adımları
  const journeySteps = [
    {
      id: 'application',
      icon: '/icons/application.svg',
      color: 'from-blue-500 to-blue-600',
      colorAlt: 'bg-blue-500',
      illustration: '/illustrations/application.svg',
    },
    {
      id: 'evaluation',
      icon: '/icons/evaluation.svg',
      color: 'from-indigo-500 to-indigo-600',
      colorAlt: 'bg-indigo-500',
      illustration: '/illustrations/evaluation.svg',
    },
    {
      id: 'acceleration',
      icon: '/icons/acceleration.svg',
      color: 'from-violet-500 to-violet-600',
      colorAlt: 'bg-violet-500',
      illustration: '/illustrations/acceleration.svg',
    },
    {
      id: 'mentorship',
      icon: '/icons/mentorship.svg',
      color: 'from-purple-500 to-purple-600',
      colorAlt: 'bg-purple-500',
      illustration: '/illustrations/mentorship.svg',
    },
    {
      id: 'investment',
      icon: '/icons/investment.svg',
      color: 'from-fuchsia-500 to-fuchsia-600',
      colorAlt: 'bg-fuchsia-500',
      illustration: '/illustrations/investment.svg',
    },
    {
      id: 'graduation',
      icon: '/icons/graduation.svg',
      color: 'from-pink-500 to-pink-600',
      colorAlt: 'bg-pink-500',
      illustration: '/illustrations/graduation.svg',
    },
  ];

  // Her adımın görünürlüğünü izleyen ref'ler
  const stepRefs = useRef<(HTMLDivElement | null)[]>(Array(journeySteps.length).fill(null));

  // Paralaks için scroll pozisyonlarını izleme
  const { scrollYProgress } = useScroll({
    target: containerRef,
    offset: ["start end", "end start"]
  });
  
  // Yaylı scroll ilerlemesi - daha yumuşak animasyonlar için
  const smoothScrollProgress = useSpring(scrollYProgress, {
    stiffness: 100,
    damping: 30,
    restDelta: 0.001
  });

  // Çeşitli paralaks efektleri için dönüşümler
  const backgroundY = useTransform(smoothScrollProgress, [0, 1], ['0%', '30%']);
  const midgroundY = useTransform(smoothScrollProgress, [0, 1], ['0%', '20%']);
  const foregroundY = useTransform(smoothScrollProgress, [0, 1], ['0%', '10%']);
  
  // Arka plan dairelerinin hareketi
  const circle1Y = useTransform(smoothScrollProgress, [0, 1], ['0%', '25%']);
  const circle2Y = useTransform(smoothScrollProgress, [0, 1], ['0%', '-15%']);
  const circle3Y = useTransform(smoothScrollProgress, [0, 1], ['0%', '35%']);
  
  // Metin ve başlık paralaks efektleri
  const titleY = useTransform(smoothScrollProgress, [0, 0.2], ['0%', '-8%']);
  const subtitleY = useTransform(smoothScrollProgress, [0, 0.2], ['0%', '-5%']);
  
  // Çizgi için paralaks dönüşümleri
  const lineScaleY = useTransform(smoothScrollProgress, [0, 0.3, 1], [0.5, 1, 1.5]);
  const lineOpacity = useTransform(smoothScrollProgress, [0, 0.1, 0.9, 1], [0.3, 1, 1, 0.3]);
  
  // Opaklık geçişleri
  const sectionOpacity = useTransform(smoothScrollProgress, [0, 0.1, 0.9, 1], [0.8, 1, 1, 0.8]);

  // Kaydırmaya bağlı olarak aktif adımı belirleme
  useEffect(() => {
    const handleScroll = () => {
      if (!containerRef.current) return;
      
      const container = containerRef.current;
      const containerRect = container.getBoundingClientRect();
      const containerCenter = containerRect.top + containerRect.height / 2;
      
      // Hangi adımın merkeze en yakın olduğunu bul
      let closestIndex = 0;
      let closestDistance = Infinity;
      
      stepRefs.current.forEach((stepRef, index) => {
        if (!stepRef) return;
        
        const stepRect = stepRef.getBoundingClientRect();
        const stepCenter = stepRect.top + stepRect.height / 2;
        const distance = Math.abs(stepCenter - containerCenter);
        
        if (distance < closestDistance) {
          closestDistance = distance;
          closestIndex = index;
        }
      });
      
      setActiveStep(closestIndex);
    };
    
    window.addEventListener('scroll', handleScroll);
    return () => window.removeEventListener('scroll', handleScroll);
  }, []);

  // Adıma tıklandığında o adıma kaydırma
  const scrollToStep = (index: number) => {
    const stepRef = stepRefs.current[index];
    if (!stepRef) return;
    
    const stepRect = stepRef.getBoundingClientRect();
    const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
    const targetScrollPosition = scrollTop + stepRect.top - window.innerHeight / 3;
    
    window.scrollTo({
      top: targetScrollPosition,
      behavior: 'smooth'
    });
    
    setActiveStep(index);
  };

  // Animasyon varyantları
  const containerVariants = {
    hidden: { opacity: 0 },
    visible: {
      opacity: 1,
      transition: {
        staggerChildren: 0.1,
        delayChildren: 0.3
      }
    }
  };

  const itemVariants = {
    hidden: { opacity: 0, y: 20 },
    visible: {
      opacity: 1,
      y: 0,
      transition: {
        duration: 0.5,
        ease: [0.22, 1, 0.36, 1]
      }
    }
  };

  // Hover efektleri için varyantlar
  const hoverCardVariants = {
    hover: {
      scale: 1.05,
      boxShadow: "0 20px 30px -10px rgba(0, 0, 0, 0.5)",
      borderColor: "rgba(255, 255, 255, 0.2)",
      transition: {
        type: "spring",
        stiffness: 300,
        damping: 15
      }
    }
  };

  const hoverIllustrationVariants = {
    hover: {
      scale: 1.1,
      rotate: 5,
      boxShadow: "0 20px 30px -10px rgba(0, 0, 0, 0.5)",
      transition: {
        type: "spring",
        stiffness: 200,
        damping: 15
      }
    }
  };

  const titleHoverVariants = {
    hover: {
      textShadow: "0 0 8px rgba(59, 130, 246, 0.7)",
      letterSpacing: "0.5px",
      transition: {
        type: "spring",
        stiffness: 300,
        damping: 10
      }
    }
  };

  return (
    <section id="entrepreneur-journey" ref={containerRef} className="relative py-20 bg-gradient-to-b from-slate-800 to-slate-900 overflow-hidden">
      {/* Paralaks arka plan katmanları */}
      <div className="absolute inset-0 overflow-hidden pointer-events-none">
        {/* En uzak arka plan katmanı - en yavaş hareket eder */}
        <motion.div 
          className="absolute inset-0 bg-grid-white/[0.02]"
          style={{ y: backgroundY }}
        ></motion.div>
        
        {/* Orta mesafedeki arka plan katmanları */}
        <motion.div 
          className="absolute top-0 left-0 w-full h-1/2 bg-gradient-to-b from-blue-900/20 to-transparent"
          style={{ y: midgroundY }}
        ></motion.div>
        <motion.div 
          className="absolute bottom-0 left-0 w-full h-1/2 bg-gradient-to-t from-indigo-900/20 to-transparent"
          style={{ y: midgroundY, scale: lineScaleY }}
        ></motion.div>
        
        {/* Hareketli gradyan efektleri */}
        <motion.div 
          className="absolute top-1/3 -left-20 w-60 h-60 bg-blue-600/10 rounded-full blur-3xl"
          style={{ y: circle1Y }}
        ></motion.div>
        <motion.div 
          className="absolute bottom-1/3 -right-20 w-80 h-80 bg-indigo-600/10 rounded-full blur-3xl"
          style={{ y: circle2Y }}
        ></motion.div>
        <motion.div
          className="absolute top-2/3 left-1/4 w-40 h-40 bg-violet-600/10 rounded-full blur-3xl"
          style={{ y: circle3Y }}
        ></motion.div>
        
        {/* Animasyonlu dekoratif çizgiler */}
        <motion.div 
          className="absolute h-full w-px opacity-20 left-1/2 md:left-[250px] lg:left-1/3 top-0 bg-gradient-to-b from-transparent via-white to-transparent cursor-pointer"
          style={{ 
            y: foregroundY,
            scaleY: lineScaleY,
            opacity: lineOpacity
          }}
          whileHover={{
            opacity: 0.8,
            width: "3px",
            filter: "drop-shadow(0 0 8px rgba(255, 255, 255, 0.8))"
          }}
        />
      </div>
      
      <motion.div 
        className="container mx-auto px-4 sm:px-6 lg:px-8 relative"
        style={{ opacity: sectionOpacity }}
      >
        <motion.div
          className="text-center mb-16"
          initial={{ opacity: 0, y: 20 }}
          whileInView={{ opacity: 1, y: 0 }}
          viewport={{ once: true, margin: "-10%" }}
          transition={{ duration: 0.7, ease: "easeOut" }}
        >
          <motion.h2 
            className="text-3xl md:text-4xl lg:text-5xl font-bold mb-6 bg-clip-text text-transparent bg-gradient-to-r from-white to-blue-200 inline-block cursor-pointer"
            style={{ y: titleY }}
            initial={{ opacity: 0, y: 20 }}
            whileInView={{ opacity: 1, y: 0 }}
            viewport={{ once: true, margin: "-10%" }}
            transition={{ duration: 0.5, delay: 0.1 }}
            variants={titleHoverVariants}
            whileHover="hover"
            onHoverStart={() => setHoveredTitle(true)}
            onHoverEnd={() => setHoveredTitle(false)}
          >
            {t('title')}
            <AnimatePresence>
              {hoveredTitle && (
                <motion.div 
                  className="absolute bottom-0 left-0 h-1 w-full bg-gradient-to-r from-blue-500 to-indigo-500 rounded-full"
                  initial={{ width: 0, opacity: 0 }}
                  animate={{ width: "100%", opacity: 1 }}
                  exit={{ width: 0, opacity: 0 }}
                  transition={{ duration: 0.3 }}
                />
              )}
            </AnimatePresence>
          </motion.h2>
          
          <motion.div 
            className="w-24 h-1.5 bg-gradient-to-r from-blue-600 to-indigo-600 mx-auto rounded-full mb-8"
            initial={{ opacity: 0, width: 0 }}
            whileInView={{ opacity: 1, width: 96 }}
            viewport={{ once: true, margin: "-10%" }}
            transition={{ duration: 0.6, delay: 0.3 }}
            whileHover={{
              width: 150,
              height: 8,
              filter: "brightness(1.2) drop-shadow(0 0 8px rgba(79, 70, 229, 0.5))"
            }}
          />
          
          <motion.p 
            className="max-w-3xl mx-auto text-gray-300 text-lg"
            style={{ y: subtitleY }}
            initial={{ opacity: 0 }}
            whileInView={{ opacity: 1 }}
            viewport={{ once: true, margin: "-10%" }}
            transition={{ duration: 0.7, delay: 0.4 }}
            whileHover={{
              color: "#ffffff",
              textShadow: "0 0 10px rgba(255, 255, 255, 0.3)"
            }}
          >
            {t('subtitle')}
          </motion.p>
          
          {/* Kaydırma ipucu */}
          <motion.div
            className="flex items-center justify-center mt-8 text-gray-400 cursor-pointer"
            initial={{ opacity: 0, y: 10 }}
            animate={{ opacity: 1, y: 0 }}
            transition={{ 
              duration: 1,
              repeat: Infinity,
              repeatType: "reverse"
            }}
            whileHover={{
              scale: 1.1,
              color: "#ffffff"
            }}
          >
            <span className="mr-2 text-sm">{t('scrollHint')}</span>
            <svg className="w-5 h-5 animate-bounce" fill="none" viewBox="0 0 24 24" stroke="currentColor">
              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M19 14l-7 7m0 0l-7-7m7 7V3" />
            </svg>
          </motion.div>
        </motion.div>
        
        {/* Ana içerik - Yolculuk Zaman Çizelgesi */}
        <div className="relative">
          {/* Orta çizgi - Sadece tablet ve desktop görünümünde */}
          {!isMobile && (
            <motion.div 
              className="hidden md:block absolute left-1/2 transform -translate-x-1/2 w-0.5 h-full bg-gradient-to-b from-blue-500/30 via-indigo-500/30 to-purple-500/30 rounded-full cursor-pointer"
              style={{ 
                scaleY: lineScaleY,
                opacity: lineOpacity
              }}
              whileHover={{
                width: "6px",
                opacity: 0.8,
                filter: "drop-shadow(0 0 8px rgba(99, 102, 241, 0.8))",
                background: "linear-gradient(to bottom, rgba(59, 130, 246, 0.8), rgba(99, 102, 241, 0.8), rgba(139, 92, 246, 0.8))"
              }}
            ></motion.div>
          )}
          
          {/* Adımlar */}
          <div className="space-y-24 md:space-y-40 relative mt-10">
            {journeySteps.map((step, index) => {
              const isEven = index % 2 === 0;
              const isHovered = hoveredStep === index;
              
              // Her adım için farklı hareket oranlı paralaks hesaplama
              const stepScrollProgress = useTransform(
                smoothScrollProgress, 
                [Math.max(0, (index / journeySteps.length) - 0.2), (index + 1) / journeySteps.length], 
                [0, 1]
              );
              
              const stepOpacity = useTransform(
                stepScrollProgress,
                [0, 0.2, 0.8, 1],
                [0.5, 1, 1, 0.5]
              );
              
              // Kart ve resimlerin ters yönlü hareketi
              const cardX = useTransform(
                stepScrollProgress,
                [0, 1],
                [isEven ? '-5%' : '5%', isEven ? '0%' : '0%']
              );
              
              const illustrationX = useTransform(
                stepScrollProgress,
                [0, 1],
                [isEven ? '5%' : '-5%', isEven ? '0%' : '0%']
              );
              
              return (
                <motion.div
                  key={step.id}
                  className={`relative ${isMobile ? '' : (isEven ? 'md:text-right' : 'md:text-left')}`}
                  ref={(el) => { stepRefs.current[index] = el; }}
                  initial="hidden"
                  whileInView="visible"
                  viewport={{ once: false, amount: 0.3 }}
                  variants={containerVariants}
                  style={{ opacity: stepOpacity }}
                  onMouseEnter={() => setHoveredStep(index)}
                  onMouseLeave={() => setHoveredStep(null)}
                >
                  {/* Konnektör noktası */}
                  {!isMobile && (
                    <div className={`hidden md:flex absolute top-0 ${isEven ? 'md:right-0 md:translate-x-1/2' : 'md:left-0 md:-translate-x-1/2'} transform -translate-y-1/2 items-center justify-center z-10`}>
                      <motion.div 
                        className={`w-16 h-16 rounded-full bg-gradient-to-br ${step.color} flex items-center justify-center shadow-lg ${activeStep === index ? 'scale-110 ring-4 ring-white/10' : ''} cursor-pointer`}
                        variants={itemVariants}
                        whileHover={{ 
                          scale: 1.2,
                          filter: "brightness(1.2)",
                          boxShadow: "0 0 20px rgba(255, 255, 255, 0.3)" 
                        }}
                        initial={{ opacity: 0, scale: 0.8 }}
                        animate={{ opacity: 1, scale: activeStep === index ? 1.1 : 1 }}
                        transition={{ duration: 0.3 }}
                        onClick={() => scrollToStep(index)}
                      >
                        <span className="text-xl font-bold text-white">{index + 1}</span>
                      </motion.div>
                    </div>
                  )}
                  
                  {/* İçerik kartı */}
                  <div className={`grid grid-cols-1 ${isMobile ? '' : 'md:grid-cols-2'} gap-8 items-center`}>
                    {/* İçerik - Mobilde her zaman yukarıdadır, desktop/tablet için sırasına göre değişir */}
                    <motion.div 
                      className={`${isMobile ? 'order-1' : (isEven ? 'md:order-1' : 'md:order-2')}`}
                      style={{ x: cardX }}
                    >
                      <motion.div 
                        className={`bg-gradient-to-br from-slate-800/80 to-slate-900/80 backdrop-blur-sm rounded-2xl p-6 md:p-8 border border-slate-700/50 shadow-xl relative overflow-hidden cursor-pointer transition-colors`}
                        variants={itemVariants}
                        whileHover={hoverCardVariants.hover}
                        animate={isHovered ? { borderColor: "rgba(255, 255, 255, 0.3)" } : {}}
                      >
                        {/* Adım numarası süslemesi */}
                        <div className="absolute -top-6 -left-6 w-16 h-16 bg-gradient-to-br from-slate-700/20 to-slate-800/20 rounded-full flex items-center justify-center text-slate-500 font-bold text-4xl opacity-50">
                          {index + 1}
                        </div>
                        
                        {/* İçerik başlık ve açıklama */}
                        <div className="relative z-10">
                          <div className="flex items-center mb-4">
                            <motion.div 
                              className={`w-12 h-12 rounded-xl bg-gradient-to-br ${step.color} p-2.5 flex items-center justify-center shadow-lg mr-4`}
                              whileHover={{ 
                                scale: 1.15, 
                                rotate: 10,
                                filter: "brightness(1.2)"
                              }}
                            >
                              <svg className="w-full h-full text-white" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
                                {index === 0 && <path d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />}
                                {index === 1 && <path d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4" />}
                                {index === 2 && <path d="M13 10V3L4 14h7v7l9-11h-7z" />}
                                {index === 3 && <path d="M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z" />}
                                {index === 4 && <path d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />}
                                {index === 5 && <path d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" />}
                              </svg>
                            </motion.div>
                            
                            <motion.h3 
                              className="text-xl font-semibold text-white"
                              whileHover={{
                                textShadow: "0 0 8px rgba(255, 255, 255, 0.5)",
                                letterSpacing: "0.5px"
                              }}
                            >
                              {t(`steps.${step.id}.title`)}
                            </motion.h3>
                          </div>
                          
                          <motion.p 
                            className="text-gray-300 leading-relaxed"
                            whileHover={{
                              color: "#ffffff"
                            }}
                          >
                            {t(`steps.${step.id}.description`)}
                          </motion.p>
                        </div>
                        
                        {/* Animasyonlu arka plan süslemesi */}
                        <motion.div 
                          className={`absolute -bottom-16 -right-16 w-64 h-64 bg-gradient-to-tl ${step.color} opacity-5 rounded-full blur-3xl`}
                          animate={isHovered ? {
                            opacity: 0.15,
                            scale: 1.2,
                            rotate: 15
                          } : {
                            opacity: 0.05,
                            scale: 1,
                            rotate: 0
                          }}
                          transition={{ duration: 0.5 }}
                        ></motion.div>
                      </motion.div>
                    </motion.div>
                    
                    {/* İllüstrasyon - Mobilde her zaman alttadır, desktop/tablet için sırasına göre değişir */}
                    <motion.div 
                      className={`${isMobile ? 'order-2' : (isEven ? 'md:order-2' : 'md:order-1')}`}
                      style={{ x: illustrationX }}
                    >
                      <motion.div
                        className="flex items-center justify-center"
                        variants={itemVariants}
                      >
                        {/* İllüstrasyon yerine renkli daire ve sembol */}
                        <motion.div 
                          className={`w-56 h-56 md:w-72 md:h-72 rounded-full bg-gradient-to-br ${step.color} bg-opacity-10 backdrop-blur-sm flex items-center justify-center relative overflow-hidden shadow-lg border border-white/5 cursor-pointer`}
                          whileHover={hoverIllustrationVariants.hover}
                          animate={isHovered ? {
                            borderColor: "rgba(255, 255, 255, 0.3)",
                            boxShadow: "0 10px 30px rgba(0, 0, 0, 0.2), inset 0 0 10px rgba(255, 255, 255, 0.1)"
                          } : {}}
                        >
                          {/* Görsel yerine sembol içeren daire */}
                          <motion.div 
                            className="w-36 h-36 md:w-48 md:h-48 bg-white/5 rounded-full flex items-center justify-center"
                            whileHover={{
                              backgroundColor: "rgba(255, 255, 255, 0.1)",
                              scale: 1.05
                            }}
                          >
                            <motion.svg 
                              className="w-24 h-24 md:w-28 md:h-28 text-white" 
                              viewBox="0 0 24 24" 
                              fill="none" 
                              stroke="currentColor" 
                              strokeWidth="1"
                              whileHover={{
                                scale: 1.1,
                                filter: "drop-shadow(0 0 8px rgba(255, 255, 255, 0.5))"
                              }}
                            >
                              {index === 0 && <path d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />}
                              {index === 1 && <path d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4" />}
                              {index === 2 && <path d="M13 10V3L4 14h7v7l9-11h-7z" />}
                              {index === 3 && <path d="M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z" />}
                              {index === 4 && <path d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />}
                              {index === 5 && <path d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" />}
                            </motion.svg>
                          </motion.div>
                          
                          {/* Dekoratif arka plan efekti */}
                          <div className="absolute inset-0 bg-grid-white/[0.05]"></div>
                          
                          {/* Adım numarası */}
                          <motion.div 
                            className="absolute top-5 right-5 w-10 h-10 rounded-full bg-white/10 flex items-center justify-center text-white font-bold"
                            whileHover={{
                              scale: 1.2,
                              backgroundColor: "rgba(255, 255, 255, 0.2)",
                              boxShadow: "0 0 10px rgba(255, 255, 255, 0.3)"
                            }}
                          >
                            {index + 1}
                          </motion.div>
                          
                          {/* Işık efekti */}
                          <motion.div 
                            className="absolute -inset-0.5 bg-gradient-to-r from-transparent via-white/10 to-transparent blur-sm"
                            animate={isHovered ? {
                              opacity: 0.8,
                              backgroundImage: "linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent)"
                            } : {}}
                          ></motion.div>
                          
                          {/* Paralaks efekti için iç içe hareket eden halkalar */}
                          <motion.div
                            className="absolute inset-0 rounded-full border border-white/10"
                            style={{
                              scale: useTransform(stepScrollProgress, [0, 1], [0.8, 1.2]),
                              opacity: useTransform(stepScrollProgress, [0, 0.5, 1], [0.2, 0.8, 0.2])
                            }}
                            animate={isHovered ? {
                              borderColor: "rgba(255, 255, 255, 0.5)",
                              borderWidth: "2px"
                            } : {}}
                          ></motion.div>
                          <motion.div
                            className="absolute inset-4 rounded-full border border-white/10"
                            style={{
                              scale: useTransform(stepScrollProgress, [0, 1], [0.9, 1.1]),
                              opacity: useTransform(stepScrollProgress, [0, 0.5, 1], [0.3, 0.9, 0.3])
                            }}
                            animate={isHovered ? {
                              borderColor: "rgba(255, 255, 255, 0.3)",
                              borderWidth: "2px",
                              rotate: 15
                            } : {}}
                          ></motion.div>
                          
                          {/* Hover durumunda ekstra parıltı animasyonu */}
                          <AnimatePresence>
                            {isHovered && (
                              <motion.div
                                className="absolute inset-0 rounded-full"
                                initial={{ opacity: 0 }}
                                animate={{ 
                                  opacity: 1,
                                  background: `radial-gradient(circle, transparent 30%, ${step.colorAlt}40 70%, transparent 100%)`
                                }}
                                exit={{ opacity: 0 }}
                                transition={{ duration: 0.5 }}
                              />
                            )}
                          </AnimatePresence>
                        </motion.div>
                      </motion.div>
                    </motion.div>
                  </div>
                </motion.div>
              );
            })}
          </div>
        </div>
      </motion.div>
      
      {/* Kaydırmalı gezinme stilleri */}
      <style jsx global>{`
        .hide-scrollbar {
          -ms-overflow-style: none;
          scrollbar-width: none;
        }
        
        .hide-scrollbar::-webkit-scrollbar {
          display: none;
        }
        
        /* İllüstrasyon pozisyon iyileştirmesi için */
        @media (min-width: 768px) {
          .illustration-container {
            transform: translateY(-50%);
          }
        }
        
        /* Paralaks efektleri için */
        .parallax-layer {
          will-change: transform;
          transform: translateZ(0);
        }
        
        /* Hover efektleri için */
        .hover-glow {
          transition: all 0.3s ease;
        }
        
        .hover-glow:hover {
          filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
        }
      `}</style>
    </section>
  );
} 