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,
  Shield,
  Zap,
  RefreshCw,
  DollarSign,
  BarChart3,
  Activity,
  Settings,
  Server,
  Database,
  Network,
  Globe,
  Clock,
  Lock,
  Layers,
} from 'lucide-react'

export const metadata = {
  title: 'Cloud Operations (CloudOps) - Drish Infra',
  description:
    'End-to-end cloud operations management. Cost optimization, performance tuning, security compliance, and 24/7 monitoring for your cloud environment.',
}

export default function CloudOperationsPage() {
  return (
    <main className="min-h-screen bg-[#f8fafc] text-slate-900">
      <Header />

      {/* ─── SECTION 1 · Hero — Dark with Operations Dashboard ── */}
      <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.04]" style={{ backgroundImage: 'radial-gradient(circle at 1px 1px, #60a5fa 1px, transparent 0)', backgroundSize: '28px 28px' }} />
        <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="max-w-3xl mx-auto text-center lg:text-left">
            <div className="w-14 h-14 rounded-2xl bg-gradient-to-br from-blue-400 to-blue-500 flex items-center justify-center mb-6 shadow-lg shadow-blue-500/30">
              <Settings className="w-7 h-7 text-white" />
            </div>
            <h1 className="text-4xl lg:text-5xl xl:text-6xl font-extrabold leading-[1.1] mb-6">
              Cloud Operations That <span className="bg-gradient-to-r from-blue-400 to-blue-500 bg-clip-text text-transparent">Keep You Running</span>
            </h1>
            <p className="text-lg text-slate-300 leading-relaxed mb-8 max-w-2xl">
              Once you are in the cloud, the real work begins. Our CloudOps team manages, monitors, optimizes, and secures your cloud environment 24/7 so it delivers on its promise.
            </p>
            <div className="flex justify-center lg:justify-start flex-wrap gap-4 mb-10">
              <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">
                Get CloudOps Assessment <ArrowRight className="w-4 h-4" />
              </Link>
            </div>
            {/* Ops metrics strip */}
            <div className="grid grid-cols-3 gap-4">
              {[
                { val: '$4.2M', label: 'Cloud Spend Optimized' },
                { val: '99.99%', label: 'Environment Uptime' },
                { val: '<5 min', label: 'Incident Response' },
              ].map((m, i) => (
                <div key={i} className="bg-white/5 backdrop-blur border border-white/10 rounded-xl px-4 py-3 text-center">
                  <p className="text-xl font-extrabold text-white">{m.val}</p>
                  <p className="text-[10px] text-slate-400 uppercase tracking-wider">{m.label}</p>
                </div>
              ))}
            </div>
            </div>
            <div className="block order-first lg:order-last">
              <ServiceHeroImage label="Cloud Operations" stats={[{ value: '$4.2M', label: 'Spend Optimized' }, { value: '99.99%', label: 'Uptime' }, { value: '<5 min', label: 'Incident Response' }]}>
              <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 · CloudOps Services ─────────── */}
      <ScrollReveal>
      <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">What We Do</p>
            <h2 className="text-3xl lg:text-4xl font-extrabold mb-4">Full-Spectrum CloudOps</h2>
            <p className="text-slate-500 max-w-2xl mx-auto">From day-to-day operations to strategic optimization, we handle every aspect of cloud operations.</p>
          </div>
          <div className="grid sm:grid-cols-2 lg:grid-cols-3 gap-6">
            {[
              { title: 'Cloud Monitoring', desc: '24/7 monitoring of all cloud resources with intelligent alerting and automated remediation.', icon: Activity },
              { title: 'Cost Management', desc: 'FinOps practices — budget alerts, rightsizing, reserved instances, and waste elimination.', icon: DollarSign },
              { title: 'Security Operations', desc: 'Continuous security posture management, vulnerability scanning, and incident response.', icon: Shield },
              { title: 'Performance Optimization', desc: 'Auto-tuning, caching strategies, CDN management, and database optimization.', icon: Zap },
              { title: 'Compliance & Governance', desc: 'Policy-as-code, audit trails, and compliance reporting for SOC 2, HIPAA, PCI-DSS.', icon: Lock },
              { title: 'Incident Management', desc: 'Automated runbooks, escalation procedures, and post-incident analysis.', icon: Clock },
            ].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 3 · Cost Optimization ─────────── */}
      <ScrollReveal delay={100}>
      <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">FinOps Practice</p>
              <h2 className="text-3xl lg:text-4xl font-extrabold mb-6">Cloud Cost Optimization</h2>
              <p className="text-slate-500 leading-relaxed mb-8">
                Our FinOps team continuously identifies savings opportunities — from reserved instances and savings plans to right-sizing and spot fleets.
              </p>
            </div>
            <div className="bg-white rounded-3xl border border-slate-200 p-8 shadow-xl">
              <h3 className="font-bold text-lg mb-6">Monthly Cost Optimization</h3>
              {[
                { month: 'Jan', spend: '$48K', saved: '$12K' },
                { month: 'Feb', spend: '$45K', saved: '$15K' },
                { month: 'Mar', spend: '$42K', saved: '$18K' },
                { month: 'Apr', spend: '$38K', saved: '$22K' },
                { month: 'May', spend: '$35K', saved: '$25K' },
                { month: 'Jun', spend: '$32K', saved: '$28K' },
              ].map((m, i) => (
                <div key={i} className="flex items-center gap-4 mb-3 last:mb-0">
                  <span className="text-sm font-medium text-slate-600 w-8">{m.month}</span>
                  <div className="flex-1">
                    <div className="h-6 bg-blue-100 rounded-full overflow-hidden relative">
                      <div className="h-full bg-blue-500 rounded-full" style={{ width: `${100 - parseInt(m.saved.replace('$', '').replace('K', '')) * 2}%` }} />
                    </div>
                  </div>
                  <span className="text-xs font-bold text-blue-600 w-16 text-right">-{m.saved}</span>
                </div>
              ))}
              <div className="mt-4 pt-4 border-t border-slate-100 text-center">
                <p className="text-xl font-extrabold text-blue-600">$120K Saved in 6 Months</p>
              </div>
            </div>
          </div>
        </div>
      </section>
      </ScrollReveal>

      {/* ─── SECTION 4 · Multi-Cloud Management ────── */}
      <ScrollReveal>
      <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">Multi-Cloud</p>
            <h2 className="text-3xl lg:text-4xl font-extrabold mb-4">Unified Multi-Cloud Management</h2>
          </div>
          <div className="grid sm:grid-cols-2 lg:grid-cols-3 gap-6">
            {[
              { provider: 'AWS', services: ['EC2, ECS, Lambda', 'RDS, DynamoDB', 'S3, CloudFront', 'VPC, Route53'], color: 'from-blue-500 to-blue-600' },
              { provider: 'Microsoft Azure', services: ['Virtual Machines, AKS', 'Azure SQL, Cosmos DB', 'Blob CDN', 'VNet, DNS'], color: 'from-blue-500 to-blue-600' },
              { provider: 'Google Cloud', services: ['GCE, GKE', 'Cloud SQL, Bigtable', 'Cloud Storage, CDN', 'VPC, Cloud DNS'], color: 'from-blue-500 to-blue-600' },
            ].map((cloud, i) => (
              <div key={i} className="bg-white rounded-2xl border border-slate-200 p-6 hover:shadow-lg transition-all duration-300">
                <div className={`w-12 h-12 rounded-xl bg-gradient-to-br ${cloud.color} flex items-center justify-center mb-4 shadow-lg`}>
                  <Cloud className="w-6 h-6 text-white" />
                </div>
                <h3 className="font-bold text-lg mb-3">{cloud.provider}</h3>
                <ul className="space-y-2">
                  {cloud.services.map((s, j) => (
                    <li key={j} className="flex items-center gap-2 text-sm text-slate-600">
                      <CheckCircle2 className="w-4 h-4 text-blue-500 flex-shrink-0" />
                      {s}
                    </li>
                  ))}
                </ul>
              </div>
            ))}
          </div>
        </div>
      </section>
      </ScrollReveal>

      {/* ─── SECTION 5 · Operational Metrics ────────── */}
      <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: '50K+', label: 'Cloud Resources Managed', sub: 'Across all clients' },
              { number: '$8M+', label: 'Annual Cloud Savings', sub: 'Delivered to clients' },
              { number: '15 min', label: 'Avg. Response Time', sub: 'Critical incidents' },
              { number: '99.99%', label: 'SLA Compliance', sub: 'Across all contracts' },
            ].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 6 · SLA Tiers ─────────────────── */}
      <ScrollReveal delay={100}>
      <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">Service Levels</p>
            <h2 className="text-3xl lg:text-4xl font-extrabold mb-4">CloudOps SLA Tiers</h2>
          </div>
          <div className="grid md:grid-cols-3 gap-8">
            {[
              { tier: 'Standard', response: '4 hours', coverage: 'Business hours', includes: ['Daily monitoring reports', 'Weekly optimization reviews', 'Monthly cost analysis', 'Email support'], price: 'From $3K/mo' },
              { tier: 'Premium', response: '1 hour', coverage: '24/7/365', includes: ['Real-time monitoring', 'Auto-remediation', 'Daily cost optimization', 'Dedicated account manager', '4-hour response SLA'], price: 'From $8K/mo', popular: true },
              { tier: 'Enterprise', response: '15 min', coverage: '24/7/365 + On-site', includes: ['All Premium features', 'Embedded engineer', 'Quarterly business reviews', 'Board-level reporting', 'Custom runbooks'], price: 'Custom' },
            ].map((t, i) => (
              <div key={i} className={`relative rounded-2xl border-2 p-8 transition-all duration-300 hover:-translate-y-1 ${t.popular ? 'border-blue-500 bg-gradient-to-b from-blue-50/50 to-white shadow-xl shadow-blue-500/10' : 'border-slate-200 bg-white hover:shadow-xl'}`}>
                {t.popular && <div className="absolute -top-3.5 left-1/2 -translate-x-1/2 bg-gradient-to-r from-blue-500 to-blue-600 text-white text-[10px] font-bold uppercase tracking-wider px-4 py-1 rounded-full">Most Popular</div>}
                <p className="text-xs font-bold text-blue-600 uppercase tracking-wider mb-2">{t.tier}</p>
                <p className="text-2xl font-extrabold text-slate-900 mb-1">{t.price}</p>
                <div className="flex gap-4 mb-6">
                  <span className="text-xs text-slate-500">Response: <strong className="text-slate-700">{t.response}</strong></span>
                  <span className="text-xs text-slate-500">Coverage: <strong className="text-slate-700">{t.coverage}</strong></span>
                </div>
                <ul className="space-y-2.5 mb-8">
                  {t.includes.map((f, j) => (
                    <li key={j} className="flex items-start gap-2 text-sm text-slate-600">
                      <CheckCircle2 className="w-4 h-4 text-blue-500 mt-0.5 flex-shrink-0" />
                      {f}
                    </li>
                  ))}
                </ul>
                <Link href="/contact" className={`block text-center font-bold text-sm py-3 rounded-xl transition-all duration-300 ${t.popular ? 'bg-gradient-to-r from-blue-500 to-blue-600 text-white shadow-lg' : 'bg-slate-100 text-slate-700 hover:bg-slate-200'}`}>
                  Get Started
                </Link>
              </div>
            ))}
          </div>
        </div>
      </section>
      </ScrollReveal>

      {/* ─── SECTION 7 · Automation & Tooling ──────── */}
      <ScrollReveal>
      <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">Automation</p>
            <h2 className="text-3xl lg:text-4xl font-extrabold mb-4">Automated CloudOps Toolchain</h2>
          </div>
          <div className="grid grid-cols-2 md:grid-cols-4 gap-4">
            {[
              'Terraform', 'Ansible', 'CloudFormation', 'Pulumi',
              'Prometheus', 'Grafana', 'Datadog', 'New Relic',
              'PagerDuty', 'Opsgenie', 'Sentry', 'StatusPage',
              'AWS Config', 'Azure Policy', 'GCP SCC', 'Prisma Cloud',
            ].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>
      </section>
      </ScrollReveal>

      {/* ─── SECTION 8 · Benefits ──────────────────── */}
      <ScrollReveal delay={100}>
      <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">Why Outsource CloudOps</p>
              <h2 className="text-3xl lg:text-4xl font-extrabold mb-6">Focus on Your Product, Not Your Cloud</h2>
            </div>
            <div className="space-y-5">
              {[
                { title: '24/7 Expert Coverage', desc: 'Cloud-certified engineers watching your environment around the clock.', icon: Clock },
                { title: 'Cost Predictability', desc: 'Fixed monthly fees instead of surprise cloud bills.', icon: DollarSign },
                { title: 'Faster Incident Resolution', desc: 'Automated runbooks and escalation procedures for sub-15-minute response.', icon: Zap },
                { title: 'Continuous Optimization', desc: 'Monthly right-sizing, reserved instance planning, and architecture reviews.', icon: TrendingUp },
              ].map((item, i) => {
                const Icon = item.icon
                return (
                  <div key={i} className="flex gap-4 items-start">
                    <div className="w-11 h-11 rounded-xl bg-gradient-to-br from-blue-500 to-blue-600 flex items-center justify-center flex-shrink-0 shadow-lg shadow-blue-500/15">
                      <Icon className="w-5 h-5 text-white" />
                    </div>
                    <div>
                      <h3 className="font-bold text-slate-900 mb-1">{item.title}</h3>
                      <p className="text-sm text-slate-500">{item.desc}</p>
                    </div>
                  </div>
                )
              })}
            </div>
          </div>
        </div>
      </section>
      </ScrollReveal>

      {/* ─── SECTION 9 · Client Results ────────────── */}
      <ScrollReveal>
      <section className="py-12 lg:py-16">
        <div className="max-w-7xl mx-auto px-6 lg:px-8">
          <div className="grid md:grid-cols-3 gap-8">
            {[
              { company: 'FinServe Corp', result: 'Cloud spend reduced from $180K/mo to $95K/mo', metric: '47% Cost Reduction', detail: 'Reserved instances, right-sizing, and spot fleet optimization across AWS and Azure.' },
              { company: 'HealthCloud Inc.', result: 'Achieved HIPAA and SOC 2 compliance in cloud', metric: '100% Compliance', detail: 'Policy-as-code implementation with AWS Config and Azure Policy.' },
              { company: 'RetailMax Online', result: '99.99% uptime during Black Friday with auto-scaling', metric: '99.99% Uptime', detail: 'Multi-AZ architecture handling 10× traffic spikes automatically.' },
            ].map((story, i) => (
              <div key={i} className="bg-white rounded-2xl border border-slate-200 p-6 hover:shadow-xl transition-all duration-300">
                <p className="font-bold mb-2">{story.company}</p>
                <p className="text-sm font-semibold text-blue-600 mb-2">{story.result}</p>
                <p className="text-xs text-slate-500 mb-4">{story.detail}</p>
                <div className="text-center pt-3 border-t border-slate-100">
                  <p className="text-lg font-extrabold text-blue-600">{story.metric}</p>
                </div>
              </div>
            ))}
          </div>
        </div>
      </section>
      </ScrollReveal>

      {/* ─── SECTION 10 · CTA ─────────────────────── */}
      <ScrollReveal delay={100}>
      <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">
            <Settings className="w-3.5 h-3.5 text-blue-400" />
            <span className="text-xs font-semibold text-blue-300 uppercase tracking-wider">CloudOps Experts</span>
          </div>
          <h2 className="text-3xl lg:text-5xl font-extrabold text-white mb-6">
            Let Us Run Your Cloud While You Build Your Product
          </h2>
          <p className="text-lg text-slate-300 mb-10 max-w-2xl mx-auto">
            Get a free cloud operations assessment — including cost optimization report, security posture review, and SLA recommendations.
          </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 CloudOps 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 CloudOps Engineer
            </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>
  )
}
