import { ServiceHeroImage } from '@/components/ui/service-hero-image'
import { Header } from '@/components/layout/header'
import { Footer } from '@/components/layout/footer'
import { ScrollReveal } from '@/components/ui/scroll-reveal'
import Link from 'next/link'
import {
  Cloud,
  ArrowRight,
  CheckCircle2,
  TrendingUp,
  ArrowUpRight,
  Shield,
  Zap,
  RefreshCw,
  FileText,
  BarChart3,
  Clock,
  AlertTriangle,
  Target,
  Layers,
  GitBranch,
  Activity,
  Search,
} from 'lucide-react'

export const metadata = {
  title: 'Cloud Migration Services - Drish Infra',
  description:
    'Seamless cloud migration with zero downtime. Assessment, planning, execution, and optimization for AWS, Azure, and GCP migrations.',
}

/* ══════════════════════════════════════════════════ */
/*  PAGE  –  Cloud Migration                          */
/*  10 Unique Sections                               */
/* ══════════════════════════════════════════════════ */
export default function CloudMigrationPage() {
  return (
    <main className="min-h-screen bg-[#f8fafc] text-slate-900">
      <Header />

      {/* ─── SECTION 1 · Hero — Migration Pathway Visual ── */}
      <section className="relative overflow-hidden bg-gradient-to-br from-slate-950 via-blue-950 to-blue-900 text-white pt-14 pb-20 lg:pt-16 lg:pb-28">
        <div className="absolute inset-0 opacity-[0.03]" style={{ backgroundImage: 'linear-gradient(45deg, #3b82f6 1px, transparent 1px), linear-gradient(-45deg, #3b82f6 1px, transparent 1px)', backgroundSize: '40px 40px' }} />
        <div className="relative max-w-7xl mx-auto px-6 lg:px-8">
          <div className="grid lg:grid-cols-2 gap-12 items-center">
            <div className="text-center lg:text-left">
              <div className="inline-flex items-center gap-2 bg-blue-500/10 border border-blue-500/20 rounded-full px-4 py-1.5 mb-6">
                <ArrowUpRight className="w-3.5 h-3.5 text-blue-400" />
                <span className="text-xs font-semibold text-blue-300 uppercase tracking-wider">Cloud Migration</span>
              </div>
              <h1 className="text-4xl lg:text-5xl xl:text-6xl font-extrabold leading-[1.1] mb-6">
                Migrate to Cloud <span className="bg-gradient-to-r from-blue-400 to-blue-500 bg-clip-text text-transparent">Without the Pain</span>
              </h1>
              <p className="text-lg text-slate-300 leading-relaxed mb-8 max-w-xl">
                500+ successful migrations. Zero data loss. Minimal downtime. Our structured 6-phase methodology eliminates the risk from cloud migration.
              </p>
              <div className="flex justify-center lg:justify-start flex-wrap gap-4">
                <Link href="/contact" className="inline-flex items-center gap-2 bg-gradient-to-r from-blue-500 to-blue-600 hover:from-blue-400 hover:to-blue-500 text-white font-bold text-sm px-6 py-3 rounded-xl shadow-lg shadow-blue-500/25 hover:shadow-blue-400/40 transition-all duration-300 hover:scale-105">
                  Free Migration Assessment <ArrowRight className="w-4 h-4" />
                </Link>
                <Link href="#methodology" className="inline-flex items-center gap-2 border border-white/20 hover:border-blue-400/40 text-white/80 hover:text-white font-semibold text-sm px-6 py-3 rounded-xl transition-all duration-300">
                  Our Methodology
                </Link>
              </div>
            </div>
            {/* Hero Image */}
            <div className="block order-first lg:order-last">
              <ServiceHeroImage label="Cloud Migration" stats={[{ value: '500+', label: 'Migrations' }, { value: 'Zero', label: 'Downtime' }, { value: '30%', label: 'Cost Saved' }]}>
              <div className="w-16 h-16 rounded-2xl bg-gradient-to-br from-blue-500 to-blue-600 flex items-center justify-center shadow-lg shadow-blue-500/20">
                <Cloud className="w-8 h-8 text-white" />
              </div>
            </ServiceHeroImage>
            </div>
          </div>
        </div>
      </section>

      {/* ─── SECTION 2 · Migration Stats ──────────── */}
      <ScrollReveal>
      <section className="py-12 bg-gradient-to-r from-slate-950 via-blue-950 to-blue-900">
        <div className="max-w-7xl mx-auto px-6 lg:px-8">
          <div className="grid grid-cols-2 md:grid-cols-4 gap-8">
            {[
              { number: '500+', label: 'Migrations Completed', sub: 'Across all cloud providers' },
              { number: '0', label: 'Data Loss Incidents', sub: 'Zero across all migrations' },
              { number: '99.9%', label: 'On-Time Delivery', sub: 'Projects completed on schedule' },
              { number: '40%', label: 'Avg. Cost Reduction', sub: 'Post-migration savings' },
            ].map((m, i) => (
              <div key={i} className="text-center">
                <p className="text-3xl lg:text-4xl font-extrabold text-white mb-1">{m.number}</p>
                <p className="text-sm font-semibold text-blue-300">{m.label}</p>
                <p className="text-xs text-slate-400 mt-1">{m.sub}</p>
              </div>
            ))}
          </div>
        </div>
      </section>
      </ScrollReveal>

      {/* ─── SECTION 3 · 6-Phase Methodology ──────── */}
      <ScrollReveal delay={100}>
      <section id="methodology" className="py-12 lg:py-16">
        <div className="max-w-7xl mx-auto px-6 lg:px-8">
          <div className="text-center mb-12">
            <p className="text-xs font-bold text-blue-600 uppercase tracking-wider mb-3">Our Methodology</p>
            <h2 className="text-3xl lg:text-4xl font-extrabold mb-4">The Drish Infra 6-Phase Migration Framework</h2>
            <p className="text-slate-500 max-w-2xl mx-auto">A battle-tested framework refined over 500+ migrations. Every step is designed to eliminate risk and ensure success.</p>
          </div>
          <div className="grid sm:grid-cols-2 lg:grid-cols-3 gap-6">
            {[
              { phase: '01', title: 'Discovery & Assessment', desc: 'Inventory all workloads, dependencies, performance baselines, and licensing. Identify migration candidates.', icon: Search, duration: '1-2 weeks' },
              { phase: '02', title: 'Strategy & Planning', desc: 'Choose 6R strategy (rehost, replatform, refactor, repurchase, retire, retain) for each workload.', icon: Target, duration: '1 week' },
              { phase: '03', title: 'Architecture Design', desc: 'Design target cloud architecture — networking, security, IAM, and service selection.', icon: Layers, duration: '1-2 weeks' },
              { phase: '04', title: 'Proof of Concept', desc: 'Migrate a non-critical workload end-to-end to validate approach, tooling, and team readiness.', icon: Zap, duration: '1-2 weeks' },
              { phase: '05', title: 'Migration Execution', desc: 'Phased migration with cutover windows, rollback plans, and real-time monitoring.', icon: GitBranch, duration: '2-8 weeks' },
              { phase: '06', title: 'Optimization & Handoff', desc: 'Post-migration tuning, cost optimization, documentation, and team training.', icon: TrendingUp, duration: '2-4 weeks' },
            ].map((s, i) => (
              <div key={i} className="bg-white rounded-2xl border border-slate-200 p-6 hover:shadow-lg transition-all duration-300 relative">
                <div className="absolute top-4 right-4 text-xs font-bold text-blue-400 bg-blue-50 px-2.5 py-1 rounded-full">{s.duration}</div>
                <p className="text-xs font-bold text-blue-500 uppercase tracking-wider mb-2">Phase {s.phase}</p>
                <h3 className="font-bold text-lg mb-2">{s.title}</h3>
                <p className="text-sm text-slate-500 leading-relaxed">{s.desc}</p>
              </div>
            ))}
          </div>
        </div>
      </section>
      </ScrollReveal>

      {/* ─── SECTION 4 · 6R Strategy ──────────────── */}
      <ScrollReveal>
      <section className="py-12 lg:py-16 bg-gradient-to-b from-white to-slate-50">
        <div className="max-w-7xl mx-auto px-6 lg:px-8">
          <div className="text-center mb-12">
            <p className="text-xs font-bold text-blue-600 uppercase tracking-wider mb-3">Migration Strategies</p>
            <h2 className="text-3xl lg:text-4xl font-extrabold mb-4">The 6R Framework</h2>
            <p className="text-slate-500 max-w-2xl mx-auto">Not every workload should be containerized. We pick the right strategy for each application.</p>
          </div>
          <div className="grid sm:grid-cols-2 lg:grid-cols-3 gap-6">
            {[
              { r: 'Rehost', aka: 'Lift & Shift', desc: 'Move as-is to cloud VMs. Fastest migration path with minimal code changes.', effort: 'Low', benefit: 'Quick win' },
              { r: 'Replatform', aka: 'Lift & Optimize', desc: 'Move to managed services — RDS instead of self-managed MySQL, for example.', effort: 'Medium', benefit: 'Better performance' },
              { r: 'Refactor', aka: 'Re-architect', desc: 'Redesign for cloud-native — microservices, serverless, containers.', effort: 'High', benefit: 'Maximum agility' },
              { r: 'Repurchase', aka: 'SaaS Switch', desc: 'Replace custom apps with SaaS — Salesforce, Workday, etc.', effort: 'Medium', benefit: 'Lower TCO' },
              { r: 'Retire', aka: 'Decommission', desc: 'Turn off workloads no longer needed. Save on licensing and operations.', effort: 'None', benefit: 'Cost savings' },
              { r: 'Retain', aka: 'Keep On-Prem', desc: 'Some workloads stay on-prem due to latency, compliance, or dependency.', effort: 'None', benefit: 'Risk avoidance' },
            ].map((item, i) => (
              <div key={i} className="bg-white rounded-2xl border border-slate-200 p-6 hover:shadow-lg transition-all duration-300">
                <div className="flex items-center justify-between mb-3">
                  <h3 className="font-bold text-lg text-blue-600">{item.r}</h3>
                  <span className="text-[10px] font-bold text-slate-400 bg-slate-100 px-2 py-0.5 rounded-full">{item.aka}</span>
                </div>
                <p className="text-sm text-slate-500 leading-relaxed mb-4">{item.desc}</p>
                <div className="flex gap-3">
                  <span className="text-xs font-bold text-blue-500 bg-blue-50 px-2.5 py-1 rounded-full">Effort: {item.effort}</span>
                  <span className="text-xs font-bold text-blue-500 bg-blue-50 px-2.5 py-1 rounded-full">{item.benefit}</span>
                </div>
              </div>
            ))}
          </div>
        </div>
      </section>
      </ScrollReveal>

      {/* ─── SECTION 5 · TCO Comparison ────────────── */}
      <ScrollReveal>
      <section className="py-12 lg:py-16">
        <div className="max-w-7xl mx-auto px-6 lg:px-8">
          <div className="grid lg:grid-cols-2 gap-12 items-center">
            <div>
              <p className="text-xs font-bold text-blue-600 uppercase tracking-wider mb-3">Cost Comparison</p>
              <h2 className="text-3xl lg:text-4xl font-extrabold mb-6">On-Prem vs Cloud TCO</h2>
              <p className="text-slate-500 leading-relaxed">
                We build detailed TCO models comparing your current on-prem costs against projected cloud costs — including migration investment and ongoing operations.
              </p>
            </div>
            <div className="bg-white rounded-3xl border border-slate-200 p-8 shadow-xl">
              <h3 className="font-bold text-lg mb-6">5-Year TCO Comparison</h3>
              {[
                { label: 'Hardware Procurement', onPrem: '$800K', cloud: '$0', saving: true },
                { label: 'Software Licensing', onPrem: '$400K', cloud: '$120K', saving: true },
                { label: 'Data Center (Power/Cooling)', onPrem: '$300K', cloud: '$0', saving: true },
                { label: 'IT Staff (FTEs)', onPrem: '$1.2M', cloud: '$480K', saving: true },
                { label: 'Cloud Services', onPrem: '$0', cloud: '$600K', saving: false },
                { label: 'Migration Cost (One-time)', onPrem: '$0', cloud: '$150K', saving: false },
              ].map((item, i) => (
                <div key={i} className="flex items-center justify-between py-3 border-b border-slate-100 last:border-0">
                  <span className="text-sm text-slate-600 flex-1">{item.label}</span>
                  <span className="text-sm font-bold text-blue-500 w-20 text-right">{item.onPrem}</span>
                  <span className="text-sm font-bold text-blue-500 w-20 text-right">{item.cloud}</span>
                </div>
              ))}
              <div className="flex items-center justify-between pt-4 border-t-2 border-slate-300">
                <span className="text-sm font-bold text-slate-900">Total 5-Year TCO</span>
                <span className="text-sm font-bold text-blue-600 w-20 text-right">$2.7M</span>
                <span className="text-sm font-bold text-blue-600 w-20 text-right">$1.35M</span>
              </div>
              <div className="mt-4 bg-blue-50 rounded-xl p-4 text-center">
                <p className="text-2xl font-extrabold text-blue-600">50% Savings</p>
                <p className="text-xs text-slate-500">$1.35M saved over 5 years</p>
              </div>
            </div>
          </div>
        </div>
      </section>
      </ScrollReveal>

      {/* ─── SECTION 6 · Risk Mitigation ──────────── */}
      <ScrollReveal>
      <section className="py-12 lg:py-16 bg-gradient-to-b from-white to-slate-50">
        <div className="max-w-7xl mx-auto px-6 lg:px-8">
          <div className="text-center mb-12">
            <p className="text-xs font-bold text-blue-600 uppercase tracking-wider mb-3">Risk Mitigation</p>
            <h2 className="text-3xl lg:text-4xl font-extrabold mb-4">We Eliminate Migration Risk</h2>
          </div>
          <div className="grid sm:grid-cols-2 lg:grid-cols-4 gap-6">
            {[
              { title: 'Pre-Migration Testing', desc: 'Full cutover rehearsals in staging environments before touching production.', icon: Shield },
              { title: 'Rollback Plans', desc: 'Every migration step has a documented rollback procedure. Instant recovery if needed.', icon: RefreshCw },
              { title: 'Data Validation', desc: 'Automated checksums and integrity verification at every stage of data transfer.', icon: CheckCircle2 },
              { title: 'Monitoring & Alerts', desc: 'Real-time dashboards during migration with instant alerts on any anomalies.', icon: Activity },
            ].map((item, i) => {
              const Icon = item.icon
              return (
                <div key={i} className="bg-white rounded-2xl border border-slate-200 p-6 hover:shadow-lg transition-all duration-300 text-center">
                  <div className="w-12 h-12 rounded-xl bg-blue-50 flex items-center justify-center mx-auto mb-4">
                    <Icon className="w-6 h-6 text-blue-600" />
                  </div>
                  <h3 className="font-bold mb-2">{item.title}</h3>
                  <p className="text-sm text-slate-500">{item.desc}</p>
                </div>
              )
            })}
          </div>
        </div>
      </section>
      </ScrollReveal>

      {/* ─── SECTION 7 · Migration Types ──────────── */}
      <ScrollReveal delay={100}>
      <section className="py-12 lg:py-16">
        <div className="max-w-7xl mx-auto px-6 lg:px-8">
          <div className="text-center mb-12">
            <p className="text-xs font-bold text-blue-600 uppercase tracking-wider mb-3">Migration Types</p>
            <h2 className="text-3xl lg:text-4xl font-extrabold mb-4">Every Migration Scenario, Covered</h2>
          </div>
          <div className="grid sm:grid-cols-2 lg:grid-cols-3 gap-6">
            {[
              { title: 'Data Center Migration', desc: 'Full DC consolidation or closure. Move everything to cloud with decommissioning of physical assets.', icon: Layers },
              { title: 'Application Migration', desc: 'Individual app migration with dependency mapping, testing, and cutover.', icon: GitBranch },
              { title: 'Database Migration', desc: 'Schema conversion, data transfer, and performance validation for database platforms.', icon: BarChart3 },
              { title: 'Mainframe Modernization', desc: 'Transform legacy mainframe workloads into modern cloud-native applications.', icon: RefreshCw },
              { title: 'Multi-Cloud Strategy', desc: 'Distribute workloads across multiple cloud providers for resilience and optimization.', icon: Cloud },
              { title: 'Hybrid Cloud Setup', desc: 'Extend on-premises to cloud with secure connectivity, unified management, and burst capabilities.', icon: Target },
            ].map((item, i) => {
              const Icon = item.icon
              return (
                <div key={i} className="bg-white rounded-2xl border border-slate-200 p-6 hover:shadow-lg transition-all duration-300">
                  <div className="w-11 h-11 rounded-xl bg-blue-50 flex items-center justify-center mb-4">
                    <Icon className="w-5 h-5 text-blue-600" />
                  </div>
                  <h3 className="font-bold mb-2">{item.title}</h3>
                  <p className="text-sm text-slate-500 leading-relaxed">{item.desc}</p>
                </div>
              )
            })}
          </div>
        </div>
      </section>
      </ScrollReveal>

      {/* ─── SECTION 8 · Tools & Automation ────────── */}
      <ScrollReveal>
      <section className="py-12 lg:py-16 bg-gradient-to-b from-white to-slate-50">
        <div className="max-w-7xl mx-auto px-6 lg:px-8">
          <div className="grid lg:grid-cols-2 gap-12 items-center">
            <div>
              <p className="text-xs font-bold text-blue-600 uppercase tracking-wider mb-3">Tools & Automation</p>
              <h2 className="text-3xl lg:text-4xl font-extrabold mb-6">Automated Migration Toolchain</h2>
              <p className="text-slate-500 leading-relaxed mb-8">
                We use industry-leading migration tools and custom automation to accelerate timelines and reduce human error.
              </p>
            </div>
            <div className="grid grid-cols-2 gap-4">
              {[
                'AWS Migration Hub',
                'Azure Migrate',
                'Google Migrate for Compute',
                'CloudEndure / MGN',
                'AWS DMS',
                'Azure Database Migration',
                'Terraform (IaC)',
                'Custom Python Scripts',
              ].map((tool, i) => (
                <div key={i} className="flex items-center gap-2.5 bg-white rounded-xl border border-slate-200 px-4 py-3 hover:border-blue-200 hover:bg-blue-50/30 transition-all duration-200">
                  <CheckCircle2 className="w-4 h-4 text-blue-500 flex-shrink-0" />
                  <span className="text-sm text-slate-700 font-medium">{tool}</span>
                </div>
              ))}
            </div>
          </div>
        </div>
      </section>
      </ScrollReveal>

      {/* ─── SECTION 9 · Client Success ────────────── */}
      <ScrollReveal delay={100}>
      <section className="py-12 lg:py-16">
        <div className="max-w-7xl mx-auto px-6 lg:px-8">
          <div className="text-center mb-12">
            <p className="text-xs font-bold text-blue-600 uppercase tracking-wider mb-3">Client Success</p>
            <h2 className="text-3xl lg:text-4xl font-extrabold mb-4">Migrations That Delivered</h2>
          </div>
          <div className="grid md:grid-cols-2 gap-8">
            {[
              { company: 'RetailEdge Corp', before: '3 data centers, 200+ physical servers', after: 'AWS multi-AZ, 80% fewer servers', timeline: '12 weeks', saving: '$1.2M/yr savings', challenge: 'Needed to exit colocation contracts and modernize legacy e-commerce platform.' },
              { company: 'MedVault Health', before: 'On-prem VMware cluster, 500TB storage', after: 'Azure hybrid with Azure Stack HCI', timeline: '16 weeks', saving: 'HIPAA compliant from day 1', challenge: 'Regulatory requirements mandated specific data residency and encryption standards.' },
            ].map((story, i) => (
              <div key={i} className="bg-white rounded-2xl border border-slate-200 p-8 hover:shadow-xl transition-all duration-300">
                <h3 className="font-bold text-lg mb-4">{story.company}</h3>
                <div className="space-y-3 mb-4">
                  <div className="flex items-start gap-3">
                    <div className="w-6 h-6 rounded-full bg-blue-100 flex items-center justify-center flex-shrink-0 mt-0.5">
                      <span className="text-xs font-bold text-blue-500">B</span>
                    </div>
                    <p className="text-sm text-slate-600">{story.before}</p>
                  </div>
                  <div className="flex items-start gap-3">
                    <div className="w-6 h-6 rounded-full bg-blue-100 flex items-center justify-center flex-shrink-0 mt-0.5">
                      <span className="text-xs font-bold text-blue-500">A</span>
                    </div>
                    <p className="text-sm text-slate-600">{story.after}</p>
                  </div>
                </div>
                <div className="flex gap-3">
                  <span className="text-xs font-bold text-blue-500 bg-blue-50 px-3 py-1 rounded-full">{story.timeline}</span>
                  <span className="text-xs font-bold text-blue-500 bg-blue-50 px-3 py-1 rounded-full">{story.saving}</span>
                </div>
              </div>
            ))}
          </div>
        </div>
      </section>
      </ScrollReveal>

      {/* ─── SECTION 10 · CTA ─────────────────────── */}
      <ScrollReveal>
      <section className="py-12 lg:py-16 bg-gradient-to-br from-slate-950 via-blue-950 to-blue-900">
        <div className="max-w-4xl mx-auto px-6 lg:px-8 text-center">
          <div className="inline-flex items-center gap-2 bg-blue-500/10 border border-blue-500/20 rounded-full px-4 py-1.5 mb-6">
            <Cloud className="w-3.5 h-3.5 text-blue-400" />
            <span className="text-xs font-semibold text-blue-300 uppercase tracking-wider">Migration Experts</span>
          </div>
          <h2 className="text-3xl lg:text-5xl font-extrabold text-white mb-6">
            Ready to Start Your Cloud Migration?
          </h2>
          <p className="text-lg text-slate-300 mb-10 max-w-2xl mx-auto">
            Get a free migration assessment — including workload inventory, 6R strategy recommendations, and a detailed TCO comparison.
          </p>
          <div className="flex flex-wrap justify-center gap-4">
            <Link href="/contact" className="inline-flex items-center gap-2 bg-gradient-to-r from-blue-500 to-blue-600 hover:from-blue-400 hover:to-blue-500 text-white font-bold px-8 py-4 rounded-xl shadow-lg shadow-blue-500/25 hover:shadow-blue-400/40 transition-all duration-300 hover:scale-105">
              Free Migration Assessment <ArrowRight className="w-4 h-4" />
            </Link>
            <Link href="/contact" className="inline-flex items-center gap-2 border border-white/20 hover:border-blue-400/40 text-white/80 hover:text-white font-semibold px-8 py-4 rounded-xl transition-all duration-300">
              Talk to a Migration Architect
            </Link>
          </div>
          <p className="text-xs text-slate-400 mt-8">No commitment · Assessment in 5 days · NDA available</p>
        </div>
      </section>
      </ScrollReveal>

      <Footer />
    </main>
  )
}
