"use client";

import { useTranslations, useLocale } from 'next-intl';
import { motion } from 'framer-motion';
import { useState, useRef } from 'react';
import Link from 'next/link';

export default function TargetAudience() {
  const t = useTranslations('targetAudience');
  const locale = useLocale();
  const containerRef = useRef<HTMLDivElement>(null);
  
  // Hedef kitle kriterleri
  const audienceCriteria = [
    {
      id: 'product-ready',
      icon: (
        <svg className="w-8 h-8 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
          <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z" />
        </svg>
      ),
      title: t('criteria.productReady.title'),
      description: t('criteria.productReady.description')
    },
    {
      id: 'revenue-stage',
      icon: (
        <svg className="w-8 h-8 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
          <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M9 14l6-6m-5.5.5h.01m4.99 5h.01M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16l3.5-2 3.5 2 3.5-2 3.5 2zM10 8.5a.5.5 0 11-1 0 .5.5 0 011 0zm5 5a.5.5 0 11-1 0 .5.5 0 011 0z" />
        </svg>
      ),
      title: t('criteria.revenueStage.title'),
      description: t('criteria.revenueStage.description')
    },
    {
      id: 'scalable',
      icon: (
        <svg className="w-8 h-8 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
          <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" />
        </svg>
      ),
      title: t('criteria.scalable.title'),
      description: t('criteria.scalable.description')
    },
    {
      id: 'innovative',
      icon: (
        <svg className="w-8 h-8 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
          <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" />
        </svg>
      ),
      title: t('criteria.innovative.title'),
      description: t('criteria.innovative.description')
    }
  ];

  // GM2 Avantajları
  const gm2Benefits = [
    {
      icon: (
        <svg className="w-8 h-8 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
          <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
        </svg>
      ),
      title: locale === 'tr' ? 'Global Network' : 'Global Network',
      description: locale === 'tr' ? 'MÜSİAD\'ın 80\'den fazla ülkedeki şubeleri ve temsilcilikleri ile uluslararası pazarlara erişim imkanı.' : 'Access to international markets with MUSIAD\'s branches and representatives in more than 80 countries.'
    },
    {
      icon: (
        <svg className="w-8 h-8 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
          <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} 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" />
        </svg>
      ),
      title: locale === 'tr' ? 'Yatırım Fırsatları' : 'Investment Opportunities',
      description: locale === 'tr' ? 'MÜSİAD üyeleri ve yatırımcı ağı ile girişiminiz için finansal destek bulma imkanı.' : 'Opportunity to find financial support for your venture with MUSIAD members and investor network.'
    },
    {
      icon: (
        <svg className="w-8 h-8 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
          <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
        </svg>
      ),
      title: locale === 'tr' ? 'Teknoloji Desteği' : 'Technology Support',
      description: locale === 'tr' ? 'Yüksek değerde teknoloji araçları ve hizmetlerine erişim sağlayan paket.' : 'A high-value package providing access to technology tools and services.'
    }
  ];

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

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

  return (
    <section id="target-audience" className="relative py-20 bg-gradient-to-b from-slate-800 to-slate-900 overflow-hidden" ref={containerRef}>
      {/* Dekoratif arka plan öğeleri */}
      <div className="absolute inset-0 overflow-hidden pointer-events-none">
        <div className="absolute top-0 right-0 w-[800px] h-[800px] bg-blue-600/5 rounded-full blur-3xl transform translate-x-1/3 -translate-y-1/2"></div>
        <div className="absolute bottom-0 left-0 w-[600px] h-[600px] bg-indigo-600/10 rounded-full blur-3xl transform -translate-x-1/3 translate-y-1/2"></div>
        
        {/* Izgara arka plan deseni */}
        <div className="absolute inset-0 bg-grid-white/[0.03]"></div>
        
        {/* Dekoratif çizgiler */}
        <motion.div 
          className="absolute top-1/4 left-0 w-1/2 h-px bg-gradient-to-r from-transparent via-blue-500/20 to-transparent"
          animate={{ 
            opacity: [0.3, 0.5, 0.3],
            scaleX: [0.9, 1.1, 0.9],
          }}
          transition={{ duration: 8, repeat: Infinity, ease: "easeInOut" }}
        />
        <motion.div 
          className="absolute bottom-1/4 right-0 w-1/2 h-px bg-gradient-to-r from-transparent via-indigo-500/20 to-transparent"
          animate={{ 
            opacity: [0.3, 0.5, 0.3],
            scaleX: [0.9, 1.1, 0.9],
          }}
          transition={{ duration: 8, repeat: Infinity, ease: "easeInOut", delay: 4 }}
        />
      </div>
      
      <div className="container mx-auto px-4 sm:px-6 lg:px-8 relative">
        <motion.div
          className="text-center mb-16"
          initial={{ opacity: 0, y: 20 }}
          whileInView={{ opacity: 1, y: 0 }}
          viewport={{ once: false, 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"
            initial={{ opacity: 0, y: 20 }}
            whileInView={{ opacity: 1, y: 0 }}
            viewport={{ once: false, margin: "-10%" }}
            transition={{ duration: 0.5, delay: 0.1 }}
          >
            {t('title')}
          </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: false, margin: "-10%" }}
            transition={{ duration: 0.6, delay: 0.3 }}
          />
          
          <motion.p 
            className="max-w-3xl mx-auto text-gray-300 text-lg"
            initial={{ opacity: 0 }}
            whileInView={{ opacity: 1 }}
            viewport={{ once: false, margin: "-10%" }}
            transition={{ duration: 0.7, delay: 0.4 }}
          >
            {t('subtitle')}
          </motion.p>
        </motion.div>
        
        {/* Ana içerik - İki sütunlu yapı */}
        <div className="grid grid-cols-1 lg:grid-cols-2 gap-12 items-start">
          {/* Sol taraf - Kimler Başvurmalı */}
          <motion.div
            variants={containerVariants}
            initial="hidden"
            whileInView="visible"
            viewport={{ once: false, margin: "-5%" }}
            className="space-y-8"
          >
            {audienceCriteria.map((criterion) => (
              <motion.div 
                key={criterion.id}
                variants={itemVariants}
                className="bg-white/5 backdrop-blur-sm rounded-xl border border-white/10 p-6 transform transition-all hover:translate-y-[-5px] hover:shadow-lg"
              >
                <div className="flex items-start space-x-5">
                  <div className="flex-shrink-0 w-16 h-16 rounded-lg bg-gradient-to-br from-blue-600 to-indigo-600 flex items-center justify-center">
                    {criterion.icon}
                  </div>
                  <div>
                    <h3 className="text-xl font-semibold text-white mb-2">{criterion.title}</h3>
                    <p className="text-gray-300">{criterion.description}</p>
                  </div>
                </div>
              </motion.div>
            ))}
          </motion.div>
          
          {/* Sağ taraf - GM2 Avantajları ve Başvuru Süreci */}
          <div className="space-y-10">
            {/* GM2 Avantajları */}
            <motion.div 
              className="bg-white/5 backdrop-blur-sm rounded-xl border border-white/10 p-8"
              initial={{ opacity: 0, y: 20 }}
              whileInView={{ opacity: 1, y: 0 }}
              viewport={{ once: false, margin: "-5%" }}
              transition={{ duration: 0.7, delay: 0.2 }}
            >
              <div className="flex items-center justify-between mb-6">
                <h3 className="text-2xl font-semibold text-white">{locale === 'tr' ? 'GM2 Avantajları' : 'GM2 Benefits'}</h3>
                <div className="flex items-center justify-center w-12 h-12 rounded-full bg-gradient-to-r from-blue-600 to-indigo-600">
                  <motion.div
                    initial={{ scale: 0.8, opacity: 0 }}
                    whileInView={{ scale: 1, opacity: 1 }}
                    transition={{ duration: 0.5 }}
                    className="text-xl font-bold text-white"
                  >
                    GM2
                  </motion.div>
                </div>
              </div>
              
              <div className="space-y-6">
                {gm2Benefits.map((benefit, index) => (
                  <div 
                    key={index} 
                    className="flex items-start space-x-4 p-4 bg-gradient-to-r from-blue-600/10 to-indigo-600/10 rounded-lg border border-blue-500/20 hover:bg-blue-600/20 transition-colors"
                  >
                    <div className="flex-shrink-0 w-12 h-12 rounded-lg bg-gradient-to-br from-blue-600 to-indigo-600 flex items-center justify-center">
                      {benefit.icon}
                    </div>
                    <div>
                      <h4 className="text-lg font-medium text-white mb-1">{benefit.title}</h4>
                      <p className="text-blue-200/80 text-sm">{benefit.description}</p>
                    </div>
                  </div>
                ))}
              </div>
            </motion.div>
            
            {/* İlerleme Süreci */}
            <motion.div 
              className="bg-white/5 backdrop-blur-sm rounded-xl border border-white/10 p-8"
              initial={{ opacity: 0, y: 20 }}
              whileInView={{ opacity: 1, y: 0 }}
              viewport={{ once: false, margin: "-5%" }}
              transition={{ duration: 0.7, delay: 0.3 }}
            >
              <h3 className="text-2xl font-semibold text-white mb-6">{t('processTitle')}</h3>
              <div className="space-y-4">
                <div className="relative pl-8">
                  <div className="absolute left-0 top-1.5 w-4 h-4 rounded-full bg-blue-600/50 border-2 border-blue-500"></div>
                  <div className="absolute left-2 top-7 w-[1px] h-10 bg-gradient-to-b from-blue-500 to-blue-500/0"></div>
                  <h4 className="text-lg font-medium text-white">{t('process.step1.title')}</h4>
                  <p className="text-gray-300 mt-1">{t('process.step1.description')}</p>
                </div>
                <div className="relative pl-8">
                  <div className="absolute left-0 top-1.5 w-4 h-4 rounded-full bg-blue-600/50 border-2 border-blue-500"></div>
                  <div className="absolute left-2 top-7 w-[1px] h-10 bg-gradient-to-b from-blue-500 to-blue-500/0"></div>
                  <h4 className="text-lg font-medium text-white">{t('process.step2.title')}</h4>
                  <p className="text-gray-300 mt-1">{t('process.step2.description')}</p>
                </div>
                <div className="relative pl-8">
                  <div className="absolute left-0 top-1.5 w-4 h-4 rounded-full bg-blue-600/50 border-2 border-blue-500"></div>
                  <h4 className="text-lg font-medium text-white">{t('process.step3.title')}</h4>
                  <p className="text-gray-300 mt-1">{t('process.step3.description')}</p>
                </div>
              </div>
            </motion.div>
          </div>
        </div>
        
        {/* CTA Bölümü */}
        <motion.div 
          className="mt-16 text-center"
          initial={{ opacity: 0, y: 20 }}
          whileInView={{ opacity: 1, y: 0 }}
          viewport={{ once: false }}
          transition={{ duration: 0.7, delay: 0.4 }}
        >
          <div className="p-8 md:p-10 bg-gradient-to-br from-blue-900/30 to-indigo-900/30 backdrop-blur-md rounded-2xl border border-white/10">
            <h3 className="text-2xl md:text-3xl font-semibold text-white mb-4">
              {t('cta.title')}
            </h3>
            <p className="max-w-2xl mx-auto text-gray-300 mb-8">
              {t('cta.description')}
            </p>
            
            <a 
              href="https://gm2.ifollow.com.tr/register" 
              target="_blank" 
              rel="noopener noreferrer"
              className="inline-block"
            >
              <motion.button
                className="px-8 py-3.5 rounded-full bg-gradient-to-r from-blue-600 to-indigo-600 text-white font-medium inline-flex items-center group"
                whileHover={{ scale: 1.03, boxShadow: "0 10px 25px -5px rgba(59, 130, 246, 0.4)" }}
                whileTap={{ scale: 0.97 }}
                transition={{ duration: 0.2 }}
              >
                <span>{t('cta.button')}</span>
                <svg className="w-5 h-5 ml-2 transform group-hover:translate-x-1 transition-transform" viewBox="0 0 24 24" fill="none" stroke="currentColor">
                  <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M14 5l7 7m0 0l-7 7m7-7H3" />
                </svg>
              </motion.button>
            </a>
          </div>
        </motion.div>
      </div>
    </section>
  );
} 