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 { ScrollText, Users, FileX, Copyright, Shield, Gavel, FileText, MessageCircle } from 'lucide-react'

export const metadata: Metadata = generateMetadata({
  title: 'Legal Agreement - SiliconPin',
  description:
    'Review SiliconPin\'s legal agreement for using our services. Find information about your legal rights and obligations.',
})

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

  const terminationReasons = [
    'You breach any provision of this Agreement',
    'You fail to pay any amounts due to SiliconPin',
    'Your use of the Services poses a security risk',
    'Providing the Services to you becomes unlawful',
    'Your use of the Services adversely impacts SiliconPin\'s systems or other customers'
  ]

  const customerWarranties = [
    'You have the legal capacity to enter into this Agreement',
    'Your use of the Services will comply with all applicable laws and regulations',
    'Your Content does not infringe or misappropriate any third party\'s intellectual property rights',
    'Your Content does not contain any material that is defamatory, obscene, or otherwise unlawful'
  ]

  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">Legal Agreement</h1>
          <p className="text-xl text-muted-foreground max-w-3xl mx-auto">
            Terms of our legal relationship
          </p>
          <div className="mt-4">
            <Badge variant="outline" className="text-sm">
              <ScrollText className="w-4 h-4 mr-2" />
              Last Updated: {lastUpdated}
            </Badge>
          </div>
        </div>

        <div className="space-y-8">
          {/* TLDR Section */}
          <Card className="border-green-200 dark:border-green-800">
            <CardHeader>
              <CardTitle className="text-2xl flex items-center text-green-600">
                <MessageCircle className="w-6 h-6 mr-2" />
                TLDR;
              </CardTitle>
            </CardHeader>
            <CardContent className="space-y-4">
              <div className="bg-green-50 dark:bg-green-950/10 p-4 rounded-lg border border-green-200 dark:border-green-800">
                <p className="text-green-800 dark:text-green-200 leading-relaxed">
                  We are trying to create some digital freedom together. We avoid any vendor locking - for you and us.
                  Some of us from DWD Consultancy Services, having quite experience manipulating data and data resilience.
                  Still we advise to keep a backup of your data periodically and use our automated backup and snapshot services 
                  (even AWS/GCP don't take data responsibility). You are responsible for your content, and we are responsible for our services.
                </p>
              </div>
              
              <p className="text-muted-foreground leading-relaxed">
                If something goes wrong, we will try to fix it. For SLA we will refund or we will part ways.
                We are based in India, and Indian law applies to this agreement. We find some law funny and useless like the cookie acknowledgement.
              </p>
              
              <p className="text-muted-foreground leading-relaxed font-medium">
                We strongly feel just to be reasonable and fair to each other.
              </p>
              
              <hr className="my-4" />
              
              <p className="text-muted-foreground leading-relaxed text-sm">
                This Legal Agreement ("Agreement") is a binding contract between you ("Customer" or "you") and SiliconPin 
                ("Company", "we", or "us") governing your use of our hosting services and related products (collectively, the "Services"). 
                By using our Services, you acknowledge that you have read, understood, and agree to be bound by this Agreement.
              </p>
            </CardContent>
          </Card>

          {/* Relationship of Parties */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <Users className="w-6 h-6 mr-2 text-blue-600" />
                Relationship of Parties
              </CardTitle>
            </CardHeader>
            <CardContent className="space-y-4">
              <p className="text-muted-foreground leading-relaxed">
                The relationship between you and SiliconPin is that of an independent contractor. Nothing in this Agreement 
                shall be construed as creating a partnership, joint venture, agency, employment, or fiduciary relationship 
                between the parties.
              </p>
              <p className="text-muted-foreground leading-relaxed">
                You acknowledge that SiliconPin has no control over the content of information transmitted by you through our 
                Services and that SiliconPin does not examine the use to which you put the Services or the nature of the content 
                or information you are transmitting.
              </p>
            </CardContent>
          </Card>

          {/* Term and Termination */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <FileX className="w-6 h-6 mr-2 text-red-600" />
                Term and Termination
              </CardTitle>
            </CardHeader>
            <CardContent className="space-y-6">
              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-3">2.1 Term</h3>
                <p className="text-muted-foreground leading-relaxed">
                  This Agreement begins on the date you first use our Services and continues until terminated as described herein.
                </p>
              </div>

              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-3">2.2 Termination by Customer</h3>
                <p className="text-muted-foreground leading-relaxed">
                  You may terminate this Agreement at any time by canceling your account through your control panel or by 
                  contacting our customer support. Upon termination, you will be responsible for all fees incurred up to the 
                  date of termination.
                </p>
              </div>

              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-3">2.3 Termination by SiliconPin</h3>
                <p className="text-muted-foreground mb-3">
                  SiliconPin may terminate this Agreement at any time if:
                </p>
                <div className="space-y-2">
                  {terminationReasons.map((reason, index) => (
                    <div 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 className="text-muted-foreground">{reason}</span>
                    </div>
                  ))}
                </div>
              </div>
            </CardContent>
          </Card>

          {/* Intellectual Property */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <Copyright className="w-6 h-6 mr-2 text-purple-600" />
                Intellectual Property
              </CardTitle>
            </CardHeader>
            <CardContent className="space-y-6">
              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-3">3.1 Your Content</h3>
                <p className="text-muted-foreground leading-relaxed">
                  You retain all right, title, and interest in and to any content that you create, upload, post, transmit, 
                  or otherwise make available through the Services ("Your Content"). By using our Services, you grant SiliconPin 
                  a non-exclusive, worldwide, royalty-free license to use, store, and copy Your Content solely for the purpose 
                  of providing the Services to you.
                </p>
              </div>

              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-3">3.2 SiliconPin's Intellectual Property</h3>
                <p className="text-muted-foreground leading-relaxed">
                  All intellectual property rights in the Services, including but not limited to software, logos, trademarks, 
                  and documentation, are owned by SiliconPin or its licensors. Nothing in this Agreement transfers any of 
                  SiliconPin's intellectual property rights to you.
                </p>
              </div>
            </CardContent>
          </Card>

          {/* Warranties and Disclaimers */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <Shield className="w-6 h-6 mr-2 text-orange-600" />
                Warranties and Disclaimers
              </CardTitle>
            </CardHeader>
            <CardContent className="space-y-6">
              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-3">4.1 Customer Warranties</h3>
                <p className="text-muted-foreground mb-3">
                  You represent and warrant that:
                </p>
                <div className="space-y-2">
                  {customerWarranties.map((warranty, index) => (
                    <div key={index} className="flex items-start space-x-3">
                      <div className="w-2 h-2 bg-green-600 rounded-full mt-2 shrink-0"></div>
                      <span className="text-muted-foreground">{warranty}</span>
                    </div>
                  ))}
                </div>
              </div>

              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-3">4.2 Disclaimer of Warranties</h3>
                <div className="p-4 bg-orange-50 dark:bg-orange-950/10 rounded-lg border border-orange-200 dark:border-orange-800">
                  <p className="text-orange-800 dark:text-orange-200 leading-relaxed text-sm font-medium">
                    THE SERVICES ARE PROVIDED "AS IS" AND "AS AVAILABLE," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
                    INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, 
                    NON-INFRINGEMENT, AND ANY WARRANTY ARISING FROM COURSE OF DEALING OR USAGE OF TRADE. SILICONPIN DOES NOT 
                    WARRANT THAT THE SERVICES WILL BE UNINTERRUPTED, ERROR-FREE, OR COMPLETELY SECURE.
                  </p>
                </div>
              </div>
            </CardContent>
          </Card>

          {/* Limitation of Liability */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl">Limitation of Liability</CardTitle>
            </CardHeader>
            <CardContent className="space-y-4">
              <div className="p-4 bg-red-50 dark:bg-red-950/10 rounded-lg border border-red-200 dark:border-red-800">
                <p className="text-red-800 dark:text-red-200 leading-relaxed text-sm font-medium">
                  IN NO EVENT WILL SILICONPIN BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY INDIRECT, CONSEQUENTIAL, EXEMPLARY, 
                  INCIDENTAL, SPECIAL, OR PUNITIVE DAMAGES, INCLUDING LOST PROFIT, LOST REVENUE, LOSS OF DATA, OR OTHER DAMAGES 
                  ARISING FROM YOUR USE OF THE SERVICES, EVEN IF SILICONPIN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
                </p>
              </div>
              
              <p className="text-muted-foreground leading-relaxed">
                NOTWITHSTANDING ANYTHING TO THE CONTRARY, SILICONPIN'S LIABILITY TO YOU FOR ANY CAUSE WHATSOEVER AND REGARDLESS 
                OF THE FORM OF THE ACTION, WILL AT ALL TIMES BE LIMITED TO THE AMOUNT PAID, IF ANY, BY YOU TO SILICONPIN FOR THE 
                SERVICES DURING THE PERIOD OF THREE (3) MONTHS PRIOR TO ANY CAUSE OF ACTION ARISING.
              </p>
            </CardContent>
          </Card>

          {/* Indemnification */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl">Indemnification</CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-muted-foreground leading-relaxed">
                You agree to defend, indemnify, and hold harmless SiliconPin and its officers, directors, employees, and agents 
                from and against any and all claims, damages, obligations, losses, liabilities, costs, or debt, and expenses 
                (including but not limited to attorney's fees) arising from: (i) your use of and access to the Services; 
                (ii) your violation of any term of this Agreement; (iii) your violation of any third-party right, including 
                without limitation any copyright, property, or privacy right; or (iv) any claim that Your Content caused damage to a third party.
              </p>
            </CardContent>
          </Card>

          {/* Dispute Resolution */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <Gavel className="w-6 h-6 mr-2 text-blue-600" />
                Dispute Resolution
              </CardTitle>
            </CardHeader>
            <CardContent className="space-y-6">
              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-3">7.1 Governing Law</h3>
                <p className="text-muted-foreground leading-relaxed">
                  This Agreement shall be governed by and construed in accordance with the laws of India, without regard to 
                  its conflict of law provisions.
                </p>
              </div>

              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-3">7.2 Arbitration</h3>
                <p className="text-muted-foreground leading-relaxed">
                  Any dispute arising out of or in connection with this Agreement, including any question regarding its existence, 
                  validity, or termination, shall be referred to and finally resolved by arbitration under the rules of the 
                  Indian Arbitration and Conciliation Act, 1996, which rules are deemed to be incorporated by reference into this clause. 
                  The number of arbitrators shall be one. The seat, or legal place, of arbitration shall be Kolkata, India. 
                  The language to be used in the arbitral proceedings shall be English.
                </p>
              </div>
            </CardContent>
          </Card>

          {/* General Provisions */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <FileText className="w-6 h-6 mr-2 text-gray-600" />
                General Provisions
              </CardTitle>
            </CardHeader>
            <CardContent className="space-y-6">
              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-3">8.1 Entire Agreement</h3>
                <p className="text-muted-foreground leading-relaxed">
                  This Agreement constitutes the entire agreement between you and SiliconPin regarding the Services and 
                  supersedes all prior agreements and understandings, whether written or oral.
                </p>
              </div>

              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-3">8.2 Severability</h3>
                <p className="text-muted-foreground leading-relaxed">
                  If any provision of this Agreement is found to be unenforceable or invalid, that provision will be limited 
                  or eliminated to the minimum extent necessary so that this Agreement will otherwise remain in full force and effect.
                </p>
              </div>

              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-3">8.3 Assignment</h3>
                <p className="text-muted-foreground leading-relaxed">
                  You may not assign or transfer this Agreement without SiliconPin's prior written consent. SiliconPin may 
                  assign or transfer this Agreement without your consent.
                </p>
              </div>

              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-3">8.4 No Waiver</h3>
                <p className="text-muted-foreground leading-relaxed">
                  The failure of SiliconPin to enforce any right or provision of this Agreement will not be deemed a waiver 
                  of such right or provision.
                </p>
              </div>
            </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 this Legal Agreement, please contact us:
              </p>
              <div className="space-y-2 text-muted-foreground">
                <p>
                  Email:{' '}
                  <a href="mailto:contact@siliconpin.com" className="text-green-600 hover:underline font-medium">
                    contact@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 Assistance?"
            description="Have questions about this agreement or need clarification on any legal terms? Our team is here to help"
            buttonText="Contact Legal Team"
            buttonHref="mailto:contact@siliconpin.com"
          />
        </div>
      </main>
      <Footer />
    </div>
  )
}