import { Metadata } from 'next'
import { generateMetadata } from '@/lib/seo'
import { Header } from '@/components/header'
import { Footer } from '@/components/footer'
import { CustomSolutionCTA } from '@/components/ui/custom-solution-cta'
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
import { Badge } from '@/components/ui/badge'
import { Shield, Database, Eye, Users, FileText, Trash2 } from 'lucide-react'

export const metadata: Metadata = generateMetadata({
  title: 'Privacy Policy - SiliconPin',
  description:
    'Learn how SiliconPin collects, uses, and protects your personal information. Our privacy policy outlines our data practices and your rights.',
})

export default function PrivacyPage() {
  const lastUpdated = "March 18, 2025"

  const informationTypes = {
    personal: [
      'Name',
      'Email address',
      'Phone number',
      'Billing address',
      'Payment information',
      'Company information',
      'Account credentials'
    ],
    usage: [
      'Log files',
      'IP addresses',
      'Browser type',
      'Pages visited',
      'Time spent on pages',
      'Referring website addresses',
      'Resource usage statistics'
    ]
  }

  const dataUses = [
    'Providing, maintaining, and improving our services',
    'Processing and completing transactions',
    'Sending administrative information, such as service updates and security alerts',
    'Responding to your comments, questions, and requests',
    'Sending promotional materials and newsletters (with opt-out options)',
    'Monitoring and analyzing trends, usage, and activities',
    'Detecting, preventing, and addressing technical issues',
    'Complying with legal obligations'
  ]

  const userRights = [
    'Access',
    'Correction',
    'Deletion',
    'Objection',
    'Data portability',
    'Withdraw consent'
  ]

  const sharingScenarios = [
    {
      title: 'With Service Providers',
      description: 'We may share your information with third-party service providers who perform services on our behalf.'
    },
    {
      title: 'For Legal Reasons',
      description: 'We may disclose your information if required to do so by law.'
    },
    {
      title: 'Business Transfers',
      description: 'In the event of a merger or acquisition, your information may be transferred.'
    },
    {
      title: 'With Your Consent',
      description: 'We may share your information with your permission.'
    }
  ]

  return (
    <div className="min-h-screen bg-background">
      <Header />
      <main className="container max-w-4xl pt-24 pb-8">
        {/* Page Header */}
        <div className="text-center mb-12">
          <h1 className="text-4xl font-bold tracking-tight mb-4">Privacy Policy</h1>
          <p className="text-xl text-muted-foreground max-w-3xl mx-auto">
            How we collect, use, and protect your information
          </p>
          <div className="mt-4">
            <Badge variant="outline" className="text-sm">
              <Shield className="w-4 h-4 mr-2" />
              Last Updated: {lastUpdated}
            </Badge>
          </div>
        </div>

        <div className="space-y-8">
          {/* Introduction */}
          <Card>
            <CardContent className="pt-6 space-y-4">
              <p className="text-muted-foreground leading-relaxed">
                At SiliconPin, we are committed to protecting your privacy and ensuring the security of your personal information. 
                This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you use our hosting 
                services or visit our website.
              </p>
              <p className="text-muted-foreground leading-relaxed">
                Please read this Privacy Policy carefully. By accessing or using our services, you acknowledge that you have read, 
                understood, and agree to be bound by all the terms of this Privacy Policy.
              </p>
            </CardContent>
          </Card>

          {/* Information We Collect */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <Database className="w-6 h-6 mr-2 text-blue-600" />
                Information We Collect
              </CardTitle>
            </CardHeader>
            <CardContent className="space-y-6">
              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-3">1.1 Personal Information</h3>
                <p className="text-muted-foreground mb-3">
                  We may collect personal information that you provide directly to us, such as:
                </p>
                <div className="grid grid-cols-1 md:grid-cols-2 gap-2">
                  {informationTypes.personal.map((item, index) => (
                    <div key={index} className="flex items-center space-x-3">
                      <div className="w-2 h-2 bg-green-600 rounded-full shrink-0"></div>
                      <span className="text-muted-foreground">{item}</span>
                    </div>
                  ))}
                </div>
              </div>

              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-3">1.2 Usage Information</h3>
                <p className="text-muted-foreground mb-3">
                  We may collect information about how you use our services, including:
                </p>
                <div className="grid grid-cols-1 md:grid-cols-2 gap-2">
                  {informationTypes.usage.map((item, index) => (
                    <div key={index} className="flex items-center space-x-3">
                      <div className="w-2 h-2 bg-blue-600 rounded-full shrink-0"></div>
                      <span className="text-muted-foreground">{item}</span>
                    </div>
                  ))}
                </div>
              </div>

              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-3">1.3 Cookies and Similar Technologies</h3>
                <p className="text-muted-foreground leading-relaxed">
                  We use cookies and similar tracking technologies to track activity on our website and to hold certain information. 
                  Cookies are files with a small amount of data that may include an anonymous unique identifier. You can instruct your 
                  browser to refuse all cookies or to indicate when a cookie is being sent.
                </p>
              </div>
            </CardContent>
          </Card>

          {/* How We Use Your Information */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <Eye className="w-6 h-6 mr-2 text-purple-600" />
                How We Use Your Information
              </CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-muted-foreground mb-4">
                We may use the information we collect for various purposes, including:
              </p>
              <div className="space-y-2">
                {dataUses.map((use, index) => (
                  <div key={index} className="flex items-start space-x-3">
                    <div className="w-2 h-2 bg-purple-600 rounded-full mt-2 shrink-0"></div>
                    <span className="text-muted-foreground">{use}</span>
                  </div>
                ))}
              </div>
            </CardContent>
          </Card>

          {/* Information Sharing and Disclosure */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <Users className="w-6 h-6 mr-2 text-orange-600" />
                Information Sharing and Disclosure
              </CardTitle>
            </CardHeader>
            <CardContent className="space-y-4">
              <p className="text-muted-foreground">
                We may share your information in the following situations:
              </p>
              <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
                {sharingScenarios.map((scenario, index) => (
                  <div key={index} className="p-4 border rounded-lg">
                    <h4 className="font-semibold text-orange-600 mb-2">{scenario.title}</h4>
                    <p className="text-sm text-muted-foreground">{scenario.description}</p>
                  </div>
                ))}
              </div>
              <div className="mt-6 p-4 bg-green-50 dark:bg-green-950/10 rounded-lg border border-green-200 dark:border-green-800">
                <p className="text-sm text-green-800 dark:text-green-200 font-medium">
                  We do not sell, rent, or trade your personal information with third parties for their commercial purposes.
                </p>
              </div>
            </CardContent>
          </Card>

          {/* Data Security */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <Shield className="w-6 h-6 mr-2 text-green-600" />
                Data Security
              </CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-muted-foreground leading-relaxed">
                We implement appropriate technical and organizational measures to protect your personal information. However, 
                no method of transmission over the internet is 100% secure. While we strive to use commercially acceptable 
                means to protect your personal information, we cannot guarantee its absolute security.
              </p>
            </CardContent>
          </Card>

          {/* Data Retention */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl">Data Retention</CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-muted-foreground leading-relaxed">
                We will retain your personal information only for as long as is necessary for the purposes outlined in this 
                Privacy Policy. We will retain and use your information to the extent necessary to comply with our legal 
                obligations, resolve disputes, and enforce our policies.
              </p>
            </CardContent>
          </Card>

          {/* Your Rights */}
          <Card id="profile-delete">
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <FileText className="w-6 h-6 mr-2 text-blue-600" />
                Your Rights
              </CardTitle>
            </CardHeader>
            <CardContent className="space-y-4">
              <p className="text-muted-foreground">
                You may have certain rights regarding your personal information, such as:
              </p>
              <div className="grid grid-cols-2 md:grid-cols-3 gap-3">
                {userRights.map((right, index) => (
                  <div key={index} className="flex items-center space-x-2 p-3 bg-muted/50 rounded-lg">
                    <div className="w-2 h-2 bg-blue-600 rounded-full shrink-0"></div>
                    <span className="text-sm font-medium">{right}</span>
                  </div>
                ))}
              </div>
              <p className="text-muted-foreground mt-4">
                To exercise these rights, please contact us using the information provided at the end of this policy.
              </p>
            </CardContent>
          </Card>

          {/* Children's Privacy */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl">Children's Privacy</CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-muted-foreground leading-relaxed">
                Our services are not intended for children under 16. We do not knowingly collect personal information from 
                children under 16. If you are a parent or guardian and you are aware that your child has provided us with 
                personal information, please contact us so that we will be able to take necessary actions.
              </p>
            </CardContent>
          </Card>

          {/* Changes to This Privacy Policy */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl">Changes to This Privacy Policy</CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-muted-foreground leading-relaxed">
                We may update our Privacy Policy periodically. We will notify you of any changes by posting the new Privacy Policy 
                on this page and updating the "Last Updated" date. You are advised to review this Privacy Policy periodically for 
                any changes. Changes to this Privacy Policy are effective when they are posted on this page.
              </p>
            </CardContent>
          </Card>

          {/* Contact Information */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl">Contact Us</CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-muted-foreground leading-relaxed mb-4">
                If you have any questions about this Privacy Policy, please contact us:
              </p>
              <div className="space-y-2 text-muted-foreground">
                <p>
                  Email:{' '}
                  <a href="mailto:privacy@siliconpin.com" className="text-green-600 hover:underline font-medium">
                    privacy@siliconpin.com
                  </a>
                </p>
                <p>Phone: +91-700-160-1485</p>
                <p>
                  Address: 121 Lalbari, GourBongo Road<br />
                  Habra, West Bengal 743271<br />
                  India
                </p>
              </div>
            </CardContent>
          </Card>

          {/* CTA Section */}
          <CustomSolutionCTA
            title="Questions About Your Privacy?"
            description="Our privacy team is here to help with any questions about how we handle your data and protect your privacy"
            buttonText="Contact Privacy Team"
            buttonHref="mailto:privacy@siliconpin.com"
          />
        </div>
      </main>
      <Footer />
    </div>
  )
}