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 { FileText, Shield, Users, CreditCard, AlertTriangle, Scale } from 'lucide-react'

export const metadata: Metadata = generateMetadata({
  title: 'Terms of Service - SiliconPin',
  description:
    'Review SiliconPin\'s Terms of Service for using our hosting services. Find information about service usage, account management, and legal obligations.',
})

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

  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">Terms of Service</h1>
          <p className="text-xl text-muted-foreground max-w-3xl mx-auto">
            Please read these terms carefully before using our services
          </p>
          <div className="mt-4">
            <Badge variant="outline" className="text-sm">
              <FileText className="w-4 h-4 mr-2" />
              Last Updated: {lastUpdated}
            </Badge>
          </div>
        </div>

        <div className="space-y-8">
          {/* Introduction */}
          <Card>
            <CardContent className="pt-6">
              <p className="text-muted-foreground leading-relaxed">
                Welcome to SiliconPin. By accessing or using our services, you agree to be bound by these Terms and Conditions. 
                If you disagree with any part of these terms, you may not access or use our services.
              </p>
            </CardContent>
          </Card>

          {/* Service Terms */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <Shield className="w-6 h-6 mr-2 text-blue-600" />
                Service Terms
              </CardTitle>
            </CardHeader>
            <CardContent className="space-y-4">
              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-2">1.1 Service Description</h3>
                <p className="text-muted-foreground leading-relaxed">
                  SiliconPin provides web hosting, application hosting, and related services. We reserve the right to modify, 
                  suspend, or discontinue any aspect of our services at any time.
                </p>
              </div>

              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-2">1.2 Service Level Agreement (SLA)</h3>
                <p className="text-muted-foreground leading-relaxed">
                  SiliconPin aims to provide 99.9% uptime for our services. In the event that we fail to meet this commitment, 
                  you may be eligible for service credits as outlined in our SLA.
                </p>
              </div>

              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-2">1.3 Service Limitations</h3>
                <p className="text-muted-foreground leading-relaxed">
                  Our services are subject to certain limitations, including but not limited to bandwidth, storage, and 
                  computational resources. These limitations are specified in your hosting plan.
                </p>
              </div>
            </CardContent>
          </Card>

          {/* Account Terms */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <Users className="w-6 h-6 mr-2 text-purple-600" />
                Account Terms
              </CardTitle>
            </CardHeader>
            <CardContent className="space-y-4">
              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-2">2.1 Account Creation</h3>
                <p className="text-muted-foreground leading-relaxed">
                  To use our services, you must create an account with accurate, complete, and up-to-date information. 
                  You are responsible for maintaining the security of your account and password.
                </p>
              </div>

              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-2">2.2 Account Termination</h3>
                <p className="text-muted-foreground leading-relaxed">
                  SiliconPin reserves the right to suspend or terminate your account if you violate these Terms and Conditions, 
                  engage in illegal activities, or if your usage negatively impacts our services or other users.
                </p>
              </div>

              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-2">2.3 Account Security</h3>
                <p className="text-muted-foreground leading-relaxed">
                  You are responsible for all activities that occur under your account. You must immediately notify SiliconPin 
                  of any unauthorized use of your account or any other breach of security.
                </p>
              </div>
            </CardContent>
          </Card>

          {/* Acceptable Use Policy */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <AlertTriangle className="w-6 h-6 mr-2 text-orange-600" />
                Acceptable Use Policy
              </CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-muted-foreground leading-relaxed mb-4">
                You agree not to use our services for any purpose that is illegal, harmful, or prohibited by these Terms and Conditions. 
                Prohibited activities include but are not limited to:
              </p>
              <ul className="space-y-2 text-muted-foreground">
                {[
                  'Distribution of malware or other malicious software',
                  'Phishing or attempting to gain unauthorized access to other systems',
                  'Hosting content that infringes on intellectual property rights',
                  'Sending unsolicited mass emails (spam)',
                  'Hosting illegal content or engaging in illegal activities',
                  'Overusing server resources in a way that disrupts service for other users'
                ].map((item, index) => (
                  <li key={index} className="flex items-start space-x-3">
                    <div className="w-2 h-2 bg-red-600 rounded-full mt-2 shrink-0"></div>
                    <span>{item}</span>
                  </li>
                ))}
              </ul>
            </CardContent>
          </Card>

          {/* Payment Terms */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <CreditCard className="w-6 h-6 mr-2 text-green-600" />
                Payment Terms
              </CardTitle>
            </CardHeader>
            <CardContent className="space-y-4">
              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-2">4.1 Billing Cycle</h3>
                <p className="text-muted-foreground leading-relaxed">
                  Services are billed according to the plan you select. Payment is due at the beginning of each billing cycle.
                </p>
              </div>

              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-2">4.2 Late Payments</h3>
                <p className="text-muted-foreground leading-relaxed">
                  If payment is not received by the due date, SiliconPin reserves the right to suspend or terminate services 
                  until payment is made. A late fee may be applied to overdue accounts.
                </p>
              </div>

              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-2">4.3 Refunds</h3>
                <p className="text-muted-foreground leading-relaxed">
                  Refunds are governed by our Refund Policy. Please refer to the{' '}
                  <a href="/refund-policy" className="text-green-600 hover:underline font-medium">
                    Refund Policy
                  </a>{' '}
                  for details.
                </p>
              </div>
            </CardContent>
          </Card>

          {/* Intellectual Property */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl">Intellectual Property</CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-muted-foreground leading-relaxed mb-4">
                SiliconPin respects intellectual property rights and expects our users to do the same. You retain ownership 
                of your content hosted on our services, but you grant SiliconPin the right to access and use this content 
                as necessary to provide our services.
              </p>
              <p className="text-muted-foreground leading-relaxed">
                SiliconPin's name, logo, and other trademarks are the property of SiliconPin and may not be used without 
                prior written permission.
              </p>
            </CardContent>
          </Card>

          {/* Limitation of Liability */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl">Limitation of Liability</CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-muted-foreground leading-relaxed mb-4">
                To the maximum extent permitted by law, SiliconPin shall not be liable for any indirect, incidental, special, 
                consequential, or punitive damages, including without limitation, loss of profits, data, use, goodwill, or 
                other intangible losses, resulting from:
              </p>
              <ul className="space-y-2 text-muted-foreground">
                {[
                  'Your use or inability to use our services',
                  'Any unauthorized access to or use of our servers and/or any personal information stored therein',
                  'Any interruption or cessation of transmission to or from our services',
                  'Any bugs, viruses, trojan horses, or the like that may be transmitted to or through our service'
                ].map((item, index) => (
                  <li key={index} className="flex items-start space-x-3">
                    <div className="w-2 h-2 bg-orange-600 rounded-full mt-2 shrink-0"></div>
                    <span>{item}</span>
                  </li>
                ))}
              </ul>
            </CardContent>
          </Card>

          {/* Changes to Terms */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl">Changes to Terms</CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-muted-foreground leading-relaxed">
                SiliconPin reserves the right to modify these Terms and Conditions at any time. We will notify users of any 
                significant changes. Your continued use of our services after such modifications constitutes your acceptance 
                of the new Terms and Conditions.
              </p>
            </CardContent>
          </Card>

          {/* Governing Law */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <Scale className="w-6 h-6 mr-2 text-blue-600" />
                Governing Law
              </CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-muted-foreground leading-relaxed">
                These Terms and Conditions shall be governed by and construed in accordance with the laws of India, 
                without regard to its conflict of law provisions.
              </p>
            </CardContent>
          </Card>

          {/* Contact Information */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl">Contact Information</CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-muted-foreground leading-relaxed mb-4">
                If you have any questions about these Terms and Conditions, please contact us:
              </p>
              <div className="space-y-2 text-muted-foreground">
                <p>
                  Email:{' '}
                  <a href="mailto:support@siliconpin.com" className="text-green-600 hover:underline font-medium">
                    support@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="Need Legal Clarification?"
            description="Have questions about our terms? Our support team is here to help with any legal or service-related inquiries"
            buttonText="Contact Support"
            buttonHref="/contact"
          />
        </div>
      </main>
      <Footer />
    </div>
  )
}