import Link from "next/link"
import { Button } from "@/components/ui/button"
import { Card, CardContent } from "@/components/ui/card"
import { Separator } from "@/components/ui/separator"
import { ArrowLeft, FileText } from "lucide-react"

export const metadata = {
  title: "Terms of Service - Factor Sciences",
  description: "Terms and conditions for using Factor Sciences digital telehealth services platform"
}

export default function TermsOfService() {
  return (
    <div className="min-h-screen bg-background">
      {/* Header */}
      <header className="sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
        <div className="container flex h-16 items-center max-w-6xl mx-auto px-4">
          <Button asChild variant="ghost" size="sm">
            <Link href="/" className="gap-2">
              <ArrowLeft className="size-4" />
              Back to Home
            </Link>
          </Button>
        </div>
      </header>

      {/* Content */}
      <main className="py-12 md:py-20">
        <div className="container max-w-4xl mx-auto px-4">
          {/* Hero */}
          <div className="text-center mb-12">
            <div className="inline-flex items-center gap-2 text-primary mb-4">
              <FileText className="size-6 icon-glow-primary" />
            </div>
            <h1 className="text-4xl md:text-5xl font-bold tracking-tight text-foreground mb-4 font-[family-name:var(--font-display)]">
              Terms of Service
            </h1>
            <p className="text-muted-foreground">
              Last Updated: December 30, 2024
            </p>
          </div>

          {/* Content Card */}
          <Card className="shadow-elevated border-gradient">
            <CardContent className="pt-8 pb-8">
              <div className="prose prose-sm max-w-none text-foreground space-y-8">

                {/* Section 1 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">1. Acceptance of Terms</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    By accessing or using the Factor Sciences platform ("Platform"), you agree to be bound by these Terms of Service ("Terms").
                    If you do not agree to these Terms, you may not access or use the Platform.
                  </p>
                  <p className="text-muted-foreground leading-relaxed">
                    These Terms constitute a legally binding agreement between you ("User," "you," or "your") and Factor Sciences
                    ("Company," "we," "us," or "our").
                  </p>
                </section>

                <Separator />

                {/* Section 2 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">2. Description of Services</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    Factor Sciences is a digital platform that provides:
                  </p>
                  <ul className="space-y-2 text-muted-foreground ml-6">
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Digital telehealth consultations with licensed healthcare professionals</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Educational wellness resources and informational materials</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Documentation review and administrative coordination services</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Client onboarding and professional consultation sessions</span>
                    </li>
                  </ul>
                  <div className="mt-4 p-4 bg-primary/5 border-l-4 border-l-primary rounded-r-lg">
                    <p className="text-sm font-semibold text-foreground mb-2">Important Notice:</p>
                    <p className="text-sm text-muted-foreground">
                      All services are digital and non-physical. We do not sell, ship, or dispense medications, prescriptions,
                      injectables, peptides, compounds, or any physical medical goods.
                    </p>
                  </div>
                </section>

                <Separator />

                {/* Section 3 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">3. Eligibility</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    To use the Platform, you must:
                  </p>
                  <ul className="space-y-2 text-muted-foreground ml-6">
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Be at least 18 years of age</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Have the legal capacity to enter into binding agreements</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Provide accurate and complete information during registration</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Comply with all applicable laws and regulations</span>
                    </li>
                  </ul>
                </section>

                <Separator />

                {/* Section 4 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">4. Payment Terms</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    <strong className="text-foreground">Payment Processing:</strong> All payments are processed securely at the time of checkout.
                    Charges occur immediately upon service purchase before access is granted.
                  </p>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    <strong className="text-foreground">Payment Methods:</strong> We accept major credit cards and other payment methods as indicated
                    during checkout. All transactions are processed through secure, PCI-compliant payment processors.
                  </p>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    <strong className="text-foreground">Pricing:</strong> Prices for services are listed in U.S. Dollars (USD) and may be subject
                    to change. Any price changes will not affect services already purchased.
                  </p>
                  <p className="text-muted-foreground leading-relaxed">
                    <strong className="text-foreground">No Recurring Charges:</strong> Unless you explicitly purchase a subscription service,
                    charges are one-time only. Subscription terms will be clearly disclosed prior to purchase.
                  </p>
                </section>

                <Separator />

                {/* Section 5 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">5. Service Limitations and Disclaimers</h2>
                  <div className="p-5 bg-destructive/5 border border-destructive/20 rounded-lg mb-4">
                    <p className="text-sm font-semibold text-destructive mb-3">Critical Disclaimers:</p>
                    <ul className="space-y-2 text-sm text-muted-foreground">
                      <li className="flex items-start gap-2">
                        <span className="text-destructive font-bold mt-0.5">•</span>
                        <span>Factor Sciences does NOT provide medical diagnoses, treatment, cures, or prevention of medical conditions</span>
                      </li>
                      <li className="flex items-start gap-2">
                        <span className="text-destructive font-bold mt-0.5">•</span>
                        <span>We do NOT sell, dispense, or ship medications, prescriptions, or pharmaceutical products</span>
                      </li>
                      <li className="flex items-start gap-2">
                        <span className="text-destructive font-bold mt-0.5">•</span>
                        <span>We do NOT provide injectables, peptides, compounds, or any physical medical goods</span>
                      </li>
                      <li className="flex items-start gap-2">
                        <span className="text-destructive font-bold mt-0.5">•</span>
                        <span>Our services do NOT replace or substitute for in-person medical care from your physician</span>
                      </li>
                      <li className="flex items-start gap-2">
                        <span className="text-destructive font-bold mt-0.5">•</span>
                        <span>No guarantees are made regarding medical outcomes, health improvements, or treatment results</span>
                      </li>
                    </ul>
                  </div>
                  <p className="text-muted-foreground leading-relaxed">
                    All information and services provided are for educational and informational purposes only. You should always consult
                    your primary care physician or qualified healthcare provider before making healthcare decisions.
                  </p>
                </section>

                <Separator />

                {/* Section 6 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">6. User Responsibilities</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    You agree to:
                  </p>
                  <ul className="space-y-2 text-muted-foreground ml-6">
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Provide accurate, current, and complete information</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Maintain the confidentiality of your account credentials</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Use the Platform only for lawful purposes</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Not share access to purchased services with unauthorized parties</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Comply with all applicable healthcare privacy laws</span>
                    </li>
                  </ul>
                </section>

                <Separator />

                {/* Section 7 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">7. Intellectual Property</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    All content on the Platform, including text, graphics, logos, images, and software, is the property of Factor Sciences
                    or its licensors and is protected by copyright, trademark, and other intellectual property laws.
                  </p>
                  <p className="text-muted-foreground leading-relaxed">
                    You may not reproduce, distribute, modify, or create derivative works from any content without our express written permission.
                  </p>
                </section>

                <Separator />

                {/* Section 8 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">8. Privacy and Data Protection</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    Your use of the Platform is also governed by our Privacy Policy. By using the Platform, you consent to the collection,
                    use, and disclosure of your information as described in the Privacy Policy.
                  </p>
                  <p className="text-muted-foreground leading-relaxed">
                    We implement security practices aligned with HIPAA standards for protecting health information.
                  </p>
                </section>

                <Separator />

                {/* Section 9 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">9. Limitation of Liability</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    TO THE MAXIMUM EXTENT PERMITTED BY LAW, FACTORY SCIENCES SHALL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
                    CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR ANY LOSS OF PROFITS OR REVENUES, WHETHER INCURRED DIRECTLY OR INDIRECTLY,
                    OR ANY LOSS OF DATA, USE, GOODWILL, OR OTHER INTANGIBLE LOSSES.
                  </p>
                  <p className="text-muted-foreground leading-relaxed">
                    Our total liability shall not exceed the amount you paid for the specific service giving rise to the claim.
                  </p>
                </section>

                <Separator />

                {/* Section 10 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">10. Termination</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    We reserve the right to suspend or terminate your access to the Platform at any time, with or without notice,
                    for any reason, including violation of these Terms.
                  </p>
                  <p className="text-muted-foreground leading-relaxed">
                    Upon termination, your right to use the Platform will immediately cease, though certain provisions of these Terms
                    will survive termination.
                  </p>
                </section>

                <Separator />

                {/* Section 11 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">11. Governing Law</h2>
                  <p className="text-muted-foreground leading-relaxed">
                    These Terms shall be governed by and construed in accordance with the laws of the State of Delaware, United States,
                    without regard to its conflict of law provisions. Any disputes arising from these Terms shall be resolved in the
                    courts of Delaware.
                  </p>
                </section>

                <Separator />

                {/* Section 12 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">12. Changes to Terms</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    We reserve the right to modify these Terms at any time. We will notify users of material changes by posting the
                    updated Terms on the Platform with a new "Last Updated" date.
                  </p>
                  <p className="text-muted-foreground leading-relaxed">
                    Your continued use of the Platform after changes are posted constitutes acceptance of the modified Terms.
                  </p>
                </section>

                <Separator />

                {/* Section 13 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">13. Contact Information</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    For questions or concerns about these Terms of Service, please contact:
                  </p>
                  <div className="p-4 bg-muted/30 rounded-lg">
                    <p className="text-foreground font-medium mb-2">Factor Sciences</p>
                    <p className="text-sm text-muted-foreground">Email: support@factorysciences.com</p>
                    <p className="text-sm text-muted-foreground">Phone: +1 (800) 555-1234</p>
                    <p className="text-sm text-muted-foreground">Business Hours: Monday - Friday, 9:00 AM - 6:00 PM EST</p>
                  </div>
                </section>

              </div>
            </CardContent>
          </Card>

          {/* Footer Navigation */}
          <div className="mt-8 flex flex-col sm:flex-row gap-4 justify-between items-center">
            <Button asChild variant="outline">
              <Link href="/">Return to Home</Link>
            </Button>
            <div className="flex gap-4">
              <Button asChild variant="ghost" size="sm">
                <Link href="/privacy">Privacy Policy</Link>
              </Button>
              <Button asChild variant="ghost" size="sm">
                <Link href="/refund">Refund Policy</Link>
              </Button>
              <Button asChild variant="ghost" size="sm">
                <Link href="/hipaa">HIPAA Notice</Link>
              </Button>
            </div>
          </div>
        </div>
      </main>
    </div>
  )
}
