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 { FileCheck, ArrowRight, CheckCircle2, Shield, Lock, Globe, Layers, BarChart3, Target, Server, AlertTriangle, Users, Clock, Activity, Database, TrendingUp, Building2, ChevronRight, Award, TrendingDown, Ban } from 'lucide-react'

export const metadata = { title: 'Security Audits - Drish Infra', description: 'Comprehensive security audits for compliance, infrastructure, and applications. Expert audit teams with deep regulatory knowledge.' }

export default function SecurityAuditsPage() {
  return (
    <main className="min-h-screen bg-[#f8fafc] text-slate-900">
      <Header />

      {/* ─── SECTION 1 · Hero ──────────────────────────── */}
      <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: 'linear-gradient(90deg, #3b82f6 1px, transparent 1px), linear-gradient(180deg, #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="max-w-3xl mx-auto text-center lg:max-w-none">
            <div className="w-16 h-16 rounded-2xl bg-gradient-to-br from-blue-400 to-blue-500 flex items-center justify-center mx-auto mb-6 shadow-lg shadow-blue-500/30"><FileCheck className="w-8 h-8 text-white" /></div>
            <h1 className="text-4xl lg:text-5xl xl:text-6xl font-extrabold leading-[1.1] mb-6">Security Audits <span className="bg-gradient-to-r from-blue-400 to-blue-500 bg-clip-text text-transparent">You Can Trust</span></h1>
            <p className="text-lg text-slate-300 leading-relaxed mb-8 max-w-2xl mx-auto">Independent security audits by certified professionals. We assess your security posture against industry standards and regulatory requirements — providing actionable 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 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">Schedule Audit <ArrowRight className="w-4 h-4" /></Link>
            </div>
            </div>
            <div className="block order-first lg:order-last">
              <ServiceHeroImage label="Security Audits" stats={[{ value: 'ISO 27001', label: 'Certified' }, { value: 'SOC 2', label: 'Compliant' }, { value: '360°', label: 'Assessment' }]}>
              <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">
                <FileCheck className="w-8 h-8 text-white" />
              </div>
            </ServiceHeroImage>
            </div>
          </div>
        </div>
      </section>

      {/* ─── SECTION 2 · Stats Bar ─────────────────────── */}
      <ScrollReveal>
      <section className="py-16 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: 'Audits Completed', sub: 'Across all frameworks' },
              { number: '100%', label: 'Audit Pass Rate', sub: 'Clients achieve certification' },
              { number: 'CISSP/CISA', label: 'Certified Auditors', sub: 'Industry-leading expertise' },
              { number: '30 Days', label: 'Average Audit Duration', sub: 'Efficient and thorough' },
            ].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 · Split Image + Text ─────────────── */}
      <ScrollReveal delay={100}>
      <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-16 items-center">
            <div className="relative">
              <div className="aspect-[4/3] rounded-3xl overflow-hidden bg-gradient-to-br from-blue-100 to-blue-50 border border-blue-100">
                <img src="/placeholder.jpg" alt="Security Audit in Progress" className="w-full h-full object-cover" />
              </div>
              <div className="absolute -bottom-6 -right-6 bg-white rounded-2xl border border-slate-200 shadow-xl p-5 max-w-[220px]">
                <div className="flex items-center gap-2 mb-2">
                  <div className="w-2 h-2 rounded-full bg-red-500 animate-pulse" />
                  <span className="text-xs font-bold text-red-600 uppercase">Critical Finding</span>
                </div>
                <p className="text-2xl font-extrabold text-slate-900">45</p>
                <p className="text-xs text-slate-500">Control Gaps Found</p>
              </div>
            </div>
            <div>
              <p className="text-xs font-bold text-blue-600 uppercase tracking-wider mb-3">Why Security Audits Matter</p>
              <h2 className="text-3xl lg:text-4xl font-extrabold mb-6">Don't Wait for a Breach to Find Your Weaknesses</h2>
              <p className="text-slate-500 leading-relaxed mb-8">
                Most organizations discover security gaps only after a breach. Proactive audits identify vulnerabilities before attackers do — saving millions in potential damages and regulatory fines.
              </p>
              <div className="space-y-4">
                {[
                  { stat: '55%', label: 'Of organizations failed their last compliance audit', icon: AlertTriangle },
                  { stat: '$14.82M', label: 'Average cost of non-compliance in 2023', icon: TrendingDown },
                  { stat: '73%', label: 'Increase in regulatory penalties over the past 3 years', icon: Ban },
                ].map((item, i) => {
                  const Icon = item.icon
                  return (
                    <div key={i} className="flex items-start gap-4 bg-slate-50 rounded-xl p-4">
                      <div className="w-10 h-10 rounded-lg bg-blue-50 flex items-center justify-center flex-shrink-0">
                        <Icon className="w-5 h-5 text-blue-600" />
                      </div>
                      <div>
                        <p className="font-bold text-slate-900">{item.stat}</p>
                        <p className="text-sm text-slate-500">{item.label}</p>
                      </div>
                    </div>
                  )
                })}
              </div>
            </div>
          </div>
        </div>
      </section>
      </ScrollReveal>

      {/* ─── SECTION 4 · Service Grid ──────────────────── */}
      <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-16">
            <p className="text-xs font-bold text-blue-600 uppercase tracking-wider mb-3">Our Services</p>
            <h2 className="text-3xl lg:text-4xl font-extrabold mb-4">Comprehensive Audit Services</h2>
            <p className="text-slate-500 max-w-2xl mx-auto">From infrastructure to third-party risk — we audit every layer of your security posture.</p>
          </div>
          <div className="grid sm:grid-cols-2 lg:grid-cols-3 gap-6">
            {[
              { title: 'Infrastructure Audit', desc: 'Full assessment of servers, networks, firewalls, and cloud configurations against security baselines.', icon: Server, highlight: 'Full Stack' },
              { title: 'Application Audit', desc: 'Code review, architecture analysis, and security testing of web and mobile applications.', icon: Layers, highlight: 'OWASP Top 10' },
              { title: 'Cloud Audit', desc: 'AWS, Azure, GCP security posture assessment with CIS benchmark compliance checks.', icon: Globe, highlight: 'Multi-Cloud' },
              { title: 'Database Audit', desc: 'Access controls, encryption, patching, and configuration review for all database platforms.', icon: Database, highlight: 'Data-Centric' },
              { title: 'Policy Audit', desc: 'Review security policies, incident response plans, and operational procedures against standards.', icon: FileCheck, highlight: 'Governance' },
              { title: 'Third-Party Audit', desc: 'Assess vendor security practices, supply chain risk management, and contractual compliance.', icon: Target, highlight: 'Vendor Risk' },
            ].map((item, i) => {
              const Icon = item.icon
              return (
                <div key={i} className="group bg-white rounded-2xl border border-slate-200 p-6 hover:shadow-xl hover:border-blue-200 transition-all duration-300 hover:-translate-y-1">
                  <div className="flex items-center justify-between mb-4">
                    <div className="w-11 h-11 rounded-xl bg-blue-50 flex items-center justify-center group-hover:bg-blue-100 transition-colors">
                      <Icon className="w-5 h-5 text-blue-600" />
                    </div>
                    <span className="text-[10px] font-bold text-blue-600 bg-blue-50 px-2.5 py-1 rounded-full">{item.highlight}</span>
                  </div>
                  <h3 className="font-bold text-lg mb-2">{item.title}</h3>
                  <p className="text-sm text-slate-500 leading-relaxed">{item.desc}</p>
                  <div className="mt-4 pt-4 border-t border-slate-100">
                    <Link href="/contact" className="text-sm font-semibold text-blue-600 hover:text-blue-700 flex items-center gap-1 transition-colors">
                      Learn more <ChevronRight className="w-3.5 h-3.5" />
                    </Link>
                  </div>
                </div>
              )
            })}
          </div>
        </div>
      </section>
      </ScrollReveal>

      {/* ─── SECTION 5 · Comparison Table ──────────────── */}
      <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-16">
            <p className="text-xs font-bold text-blue-600 uppercase tracking-wider mb-3">Comparison</p>
            <h2 className="text-3xl lg:text-4xl font-extrabold mb-4">With vs Without Professional Audit</h2>
            <p className="text-slate-500 max-w-2xl mx-auto">See what organizations without professional audits face versus those with expert audit support.</p>
          </div>
          <div className="bg-white rounded-3xl border border-slate-200 overflow-hidden shadow-xl">
            <div className="grid grid-cols-3 bg-slate-50 border-b border-slate-200">
              <div className="p-5 font-bold text-sm text-slate-600">Metric</div>
              <div className="p-5 font-bold text-sm text-center text-red-600 bg-red-50/50">Without Audit</div>
              <div className="p-5 font-bold text-sm text-center text-blue-600 bg-blue-50/50">With Drish Audit</div>
            </div>
            {[
              { metric: 'Compliance Gaps', without: 'Unknown / Discovered too late', with: 'Identified and remediated pre-audit' },
              { metric: 'Risk Identification', without: 'Reactive — after incidents occur', with: 'Proactive — before threats exploit' },
              { metric: 'Audit Readiness', without: 'Months of scrambling', with: 'Always audit-ready' },
              { metric: 'Documentation', without: 'Incomplete / Outdated', with: 'Comprehensive & current' },
              { metric: 'Remediation', without: 'Ad-hoc / No roadmap', with: 'Prioritized action plan' },
              { metric: 'Regulatory Penalties', without: 'Up to $14.82M average', with: 'Zero non-compliance fines' },
              { metric: 'Board Confidence', without: 'Low / Uncertain posture', with: 'Full visibility & reporting' },
              { metric: 'Certification Speed', without: '6-18 months', with: '8-12 weeks avg' },
            ].map((row, i) => (
              <div key={i} className={`grid grid-cols-3 border-b border-slate-100 last:border-0 ${i % 2 === 0 ? 'bg-white' : 'bg-slate-50/50'}`}>
                <div className="p-5 font-semibold text-sm text-slate-700">{row.metric}</div>
                <div className="p-5 text-sm text-center text-red-500 font-medium">{row.without}</div>
                <div className="p-5 text-sm text-center text-blue-600 font-bold">{row.with}</div>
              </div>
            ))}
          </div>
        </div>
      </section>
      </ScrollReveal>

      {/* ─── SECTION 6 · Market Growth + Stats ─────────── */}
      <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-16 items-center">
            <div>
              <p className="text-xs font-bold text-blue-600 uppercase tracking-wider mb-3">Market Insights</p>
              <h2 className="text-3xl lg:text-4xl font-extrabold mb-6">The Audit Market Is Growing Fast</h2>
              <p className="text-slate-500 leading-relaxed mb-8">
                The global security audit market is projected to reach <strong className="text-slate-900">$12.8 billion by 2028</strong>, growing at 11.3% CAGR. Organizations are investing heavily in compliance-driven audit programs to avoid costly penalties.
              </p>
              <div className="space-y-4">
                {[
                  { label: 'Audit Outsourcing Growth', value: '68%', width: '68%' },
                  { label: 'Cloud Audit Adoption', value: '74%', width: '74%' },
                  { label: 'Automated Evidence Collection', value: '52%', width: '52%' },
                  { label: 'Compliance-Driven Budget Increase', value: '81%', width: '81%' },
                ].map((bar, i) => (
                  <div key={i}>
                    <div className="flex justify-between mb-1">
                      <span className="text-sm font-semibold text-slate-700">{bar.label}</span>
                      <span className="text-sm font-bold text-blue-600">{bar.value}</span>
                    </div>
                    <div className="h-2.5 bg-slate-100 rounded-full overflow-hidden">
                      <div className="h-full bg-gradient-to-r from-blue-500 to-blue-600 rounded-full" style={{ width: bar.width }} />
                    </div>
                  </div>
                ))}
              </div>
            </div>
            <div className="grid grid-cols-2 gap-4">
              <div className="bg-white rounded-2xl border border-slate-200 p-6 text-center hover:shadow-lg transition-all duration-300">
                <div className="w-12 h-12 rounded-xl bg-blue-50 flex items-center justify-center mx-auto mb-3"><TrendingUp className="w-6 h-6 text-blue-600" /></div>
                <p className="text-3xl font-extrabold text-slate-900 mb-1">$12.8B</p>
                <p className="text-xs text-slate-500">Audit Market by 2028</p>
              </div>
              <div className="bg-white rounded-2xl border border-slate-200 p-6 text-center hover:shadow-lg transition-all duration-300">
                <div className="w-12 h-12 rounded-xl bg-blue-50 flex items-center justify-center mx-auto mb-3"><Activity className="w-6 h-6 text-blue-600" /></div>
                <p className="text-3xl font-extrabold text-slate-900 mb-1">11.3%</p>
                <p className="text-xs text-slate-500">Annual Growth Rate</p>
              </div>
              <div className="bg-white rounded-2xl border border-slate-200 p-6 text-center hover:shadow-lg transition-all duration-300">
                <div className="w-12 h-12 rounded-xl bg-blue-50 flex items-center justify-center mx-auto mb-3"><Building2 className="w-6 h-6 text-blue-600" /></div>
                <p className="text-3xl font-extrabold text-slate-900 mb-1">500+</p>
                <p className="text-xs text-slate-500">Audits Completed</p>
              </div>
              <div className="bg-white rounded-2xl border border-slate-200 p-6 text-center hover:shadow-lg transition-all duration-300">
                <div className="w-12 h-12 rounded-xl bg-blue-50 flex items-center justify-center mx-auto mb-3"><Users className="w-6 h-6 text-blue-600" /></div>
                <p className="text-3xl font-extrabold text-slate-900 mb-1">100%</p>
                <p className="text-xs text-slate-500">Audit Pass Rate</p>
              </div>
            </div>
          </div>
        </div>
      </section>
      </ScrollReveal>

      {/* ─── SECTION 7 · Framework Showcase ────────────── */}
      <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-16">
            <p className="text-xs font-bold text-blue-600 uppercase tracking-wider mb-3">Frameworks</p>
            <h2 className="text-3xl lg:text-4xl font-extrabold mb-4">Audit for Every Major Framework</h2>
            <p className="text-slate-500 max-w-2xl mx-auto">From SOC 2 to PCI-DSS — we guide you through every step of the certification journey.</p>
          </div>
          <div className="grid md:grid-cols-3 gap-8">
            {[
              { framework: 'SOC 2 Type II', timeline: '8-12 Weeks', steps: ['Scope Definition', 'Control Mapping', 'Evidence Collection', 'Readiness Assessment', 'Formal Audit', 'Certification'], popular: true },
              { framework: 'ISO 27001', timeline: '10-14 Weeks', steps: ['Gap Analysis', 'ISMS Development', 'Risk Assessment', 'Control Implementation', 'Internal Audit', 'Certification Audit'], popular: false },
              { framework: 'PCI-DSS', timeline: '6-10 Weeks', steps: ['Scope Determination', 'SAQ / ROC', 'Vulnerability Scan', 'Penetration Test', 'Remediation', 'QSA Validation'], popular: false },
            ].map((fw, i) => (
              <div key={i} className={`relative rounded-2xl border-2 p-8 transition-all duration-300 hover:-translate-y-1 ${fw.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'}`}>
                {fw.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 whitespace-nowrap">Most Popular</div>}
                <p className="text-xs font-bold text-blue-600 uppercase tracking-wider mb-2">{fw.framework}</p>
                <p className="text-lg font-extrabold text-slate-900 mb-1">{fw.timeline}</p>
                <p className="text-sm text-slate-500 mb-6">Typical audit timeline</p>
                <div className="space-y-3 mb-8">
                  {fw.steps.map((step, j) => (
                    <div key={j} className="flex items-center gap-3">
                      <div className="w-6 h-6 rounded-full bg-blue-50 flex items-center justify-center flex-shrink-0">
                        <span className="text-[10px] font-bold text-blue-600">{j + 1}</span>
                      </div>
                      <span className="text-sm text-slate-600">{step}</span>
                    </div>
                  ))}
                </div>
                <Link href="/contact" className={`block text-center font-bold text-sm py-3 rounded-xl transition-all duration-300 ${fw.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 8 · Client Results ────────────────── */}
      <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-16">
            <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">Real Results from Our Audits</h2>
          </div>
          <div className="grid md:grid-cols-3 gap-6">
            {[
              { company: 'FinServe Global', industry: 'Banking', result: 'Achieved SOC 2 Type II in 12 weeks', detail: 'Comprehensive audit identified 45 control gaps. Our team helped implement all controls and achieve certification ahead of schedule.', metric: 'SOC 2 Certified', roi: '$2.3M saved' },
              { company: 'MedTech Corp', industry: 'Healthcare', result: 'Passed HIPAA audit with zero critical findings', detail: 'Pre-audit assessment identified potential compliance gaps. Remediation prior to official audit resulted in a clean report with no deficiencies.', metric: 'HIPAA Compliant', roi: '$800K audit savings' },
              { company: 'RetailMax', industry: 'E-Commerce', result: 'PCI-DSS Level 1 certification in 10 weeks', detail: 'Full PCI-DSS scope assessment, vulnerability remediation, and QSA engagement. Achieved Level 1 certification for processing 5M+ transactions annually.', metric: 'PCI-DSS Level 1', roi: '$1.5M fraud prevented' },
            ].map((story, i) => (
              <div key={i} className="bg-white rounded-2xl border border-slate-200 p-8 hover:shadow-xl transition-all duration-300">
                <div className="flex items-center justify-between mb-4">
                  <h3 className="font-bold text-lg">{story.company}</h3>
                  <span className="text-[10px] font-bold text-blue-600 bg-blue-50 px-2.5 py-1 rounded-full">{story.industry}</span>
                </div>
                <p className="text-sm font-semibold text-blue-600 mb-2">{story.result}</p>
                <p className="text-sm text-slate-500 mb-4 leading-relaxed">{story.detail}</p>
                <div className="flex items-center justify-between pt-4 border-t border-slate-100">
                  <p className="text-sm font-extrabold text-blue-600">{story.metric}</p>
                  <span className="text-xs font-bold text-green-600 bg-green-50 px-2.5 py-1 rounded-full">{story.roi}</span>
                </div>
              </div>
            ))}
          </div>
        </div>
      </section>
      </ScrollReveal>

      {/* ─── SECTION 9 · 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"><FileCheck className="w-3.5 h-3.5 text-blue-400" /><span className="text-xs font-semibold text-blue-300 uppercase tracking-wider">Certified Auditors</span></div>
          <h2 className="text-3xl lg:text-5xl font-extrabold text-white mb-6">Achieve Compliance with Confidence</h2>
          <p className="text-lg text-slate-300 mb-10 max-w-2xl mx-auto">Get a free compliance gap assessment — identify where you stand before your official audit.</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 Gap 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 an Auditor</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>
  )
}
