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, Shield } from "lucide-react"

export const metadata = {
  title: "Privacy Policy - Factor Sciences",
  description: "Privacy policy and data protection practices for Factor Sciences digital educational services platform"
}

export default function PrivacyPolicy() {
  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">
              <Shield 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)]">
              Privacy Policy
            </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">

                {/* Introduction */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">Introduction</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    Factor Sciences ("we," "us," "our," or "Company") is committed to protecting your privacy and handling your
                    personal information with care and transparency. This Privacy Policy explains how we collect, use,
                    disclose, and safeguard your information when you use our digital educational services platform (the "Platform").
                  </p>
                  <p className="text-muted-foreground leading-relaxed">
                    By using the Platform, you consent to the data practices described in this Privacy Policy. If you do not agree
                    with this Privacy Policy, please do not access or use the Platform.
                  </p>
                </section>

                <Separator />

                {/* Section 1 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">1. Information We Collect</h2>

                  <h3 className="text-xl font-semibold mb-3 text-foreground">1.1 Personal Information</h3>
                  <p className="text-muted-foreground leading-relaxed mb-3">
                    We collect personal information that you voluntarily provide when registering for our services:
                  </p>
                  <ul className="space-y-2 text-muted-foreground ml-6 mb-4">
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Full name, date of birth, and contact information (email address, phone number)</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Account credentials (username, password)</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Billing and payment information (credit card details, billing address)</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>State of residence and jurisdiction information for compliance purposes</span>
                    </li>
                  </ul>

                  <h3 className="text-xl font-semibold mb-3 text-foreground">1.2 Service Information</h3>
                  <p className="text-muted-foreground leading-relaxed mb-3">
                    In connection with our services, we may collect:
                  </p>
                  <ul className="space-y-2 text-muted-foreground ml-6 mb-4">
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Information related to your service preferences and goals</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Information shared during educational sessions with professionals</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Documentation you upload or share with our team</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Notes and records created during sessions</span>
                    </li>
                  </ul>

                  <h3 className="text-xl font-semibold mb-3 text-foreground">1.3 Technical and Usage Information</h3>
                  <p className="text-muted-foreground leading-relaxed mb-3">
                    We automatically collect certain information when you use our Platform:
                  </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>Device information (IP address, browser type, operating system)</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Usage data (pages visited, time spent, features accessed)</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Cookies and similar tracking technologies for session management and analytics</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Log files and error reports for platform maintenance and improvement</span>
                    </li>
                  </ul>
                </section>

                <Separator />

                {/* Section 2 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">2. How We Use Your Information</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    We use the information we collect for the following purposes:
                  </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><strong className="text-foreground">Service Delivery:</strong> To provide educational services, administrative support, and access to informational resources</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Account Management:</strong> To create and maintain your user account, authenticate access, and manage your preferences</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Payment Processing:</strong> To process transactions, prevent fraud, and maintain billing records</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Communication:</strong> To send service-related notifications, appointment reminders, and respond to inquiries</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Platform Improvement:</strong> To analyze usage patterns, improve functionality, and enhance user experience</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Legal Compliance:</strong> To comply with applicable laws, regulations, and professional standards</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Security:</strong> To protect against unauthorized access, maintain platform integrity, and ensure data security</span>
                    </li>
                  </ul>
                </section>

                <Separator />

                {/* Section 3 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">3. How We Share Your Information</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    We do not sell your personal information. We may share your information only in the following circumstances:
                  </p>

                  <h3 className="text-xl font-semibold mb-3 text-foreground">3.1 Service Professionals</h3>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    Your information may be shared with qualified professionals who provide educational services
                    through our Platform. These providers are bound by confidentiality obligations.
                  </p>

                  <h3 className="text-xl font-semibold mb-3 text-foreground">3.2 Service Providers</h3>
                  <p className="text-muted-foreground leading-relaxed mb-3">
                    We work with trusted third-party service providers who assist us with:
                  </p>
                  <ul className="space-y-2 text-muted-foreground ml-6 mb-4">
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Payment processing and verification services</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Cloud hosting and data storage services</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Communication platforms (email, SMS notifications)</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Analytics and platform performance monitoring</span>
                    </li>
                  </ul>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    These service providers are contractually obligated to use your information only for the purposes we specify
                    and to maintain appropriate security measures.
                  </p>

                  <h3 className="text-xl font-semibold mb-3 text-foreground">3.3 Legal Requirements</h3>
                  <p className="text-muted-foreground leading-relaxed mb-3">
                    We may disclose your information when required to do so by law, including:
                  </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>In response to valid legal processes (subpoenas, court orders, government requests)</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>To protect the rights, property, or safety of Factor Sciences, our users, or the public</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>To prevent or investigate fraud, security issues, or illegal activity</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>In connection with professional reporting obligations (e.g., mandatory reporting of harm)</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. Data Security</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    We implement administrative, technical, and physical security measures designed to protect your information,
                    following industry best practices:
                  </p>
                  <ul className="space-y-2 text-muted-foreground ml-6 mb-4">
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Encryption:</strong> Data transmission over HTTPS/TLS protocols and encryption of sensitive data at rest</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Access Controls:</strong> Role-based access restrictions, multi-factor authentication, and password requirements</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Monitoring:</strong> Regular security assessments, intrusion detection, and audit logging</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Employee Training:</strong> Privacy and security training for all personnel with access to user data</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Incident Response:</strong> Procedures for detecting, responding to, and reporting security breaches</span>
                    </li>
                  </ul>
                  <div className="p-4 bg-primary/5 border-l-4 border-l-primary rounded-r-lg">
                    <p className="text-sm text-muted-foreground">
                      While we implement industry-standard security practices, no method of electronic storage or transmission is
                      100% secure. We cannot guarantee absolute security but are committed to protecting your information using
                      reasonable and appropriate safeguards.
                    </p>
                  </div>
                </section>

                <Separator />

                {/* Section 5 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">5. Data Retention</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    We retain your personal information for as long as necessary to fulfill the purposes outlined in
                    this Privacy Policy, unless a longer retention period is required or permitted by law.
                  </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><strong className="text-foreground">Active Accounts:</strong> Information is retained while your account is active and for reasonable periods afterward</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Service Records:</strong> Information related to services may be retained for reasonable periods as required by applicable regulations</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Financial Records:</strong> Payment and transaction records are retained as required by tax and financial regulations</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Legal Obligations:</strong> Certain information may be retained longer to comply with legal, regulatory, or professional requirements</span>
                    </li>
                  </ul>
                </section>

                <Separator />

                {/* Section 6 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">6. Your Privacy Rights</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    You have certain rights regarding your personal information:
                  </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><strong className="text-foreground">Access:</strong> Request access to the personal information we hold about you</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Correction:</strong> Request correction of inaccurate or incomplete information</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Deletion:</strong> Request deletion of your personal information, subject to legal and regulatory retention requirements</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Data Portability:</strong> Request a copy of your information in a structured, commonly used format</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Opt-Out:</strong> Unsubscribe from marketing communications (service-related messages may still be sent)</span>
                    </li>
                  </ul>
                  <p className="text-muted-foreground leading-relaxed mt-4">
                    To exercise these rights, please contact us at <a href="mailto:privacy@factorsciences.com" className="text-primary hover:underline">privacy@factorsciences.com</a>.
                    We will respond to verified requests within 30 days.
                  </p>
                </section>

                <Separator />

                {/* Section 7 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">7. Cookies and Tracking Technologies</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    We use cookies and similar technologies to enhance platform functionality and collect usage information:
                  </p>
                  <ul className="space-y-2 text-muted-foreground ml-6 mb-4">
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Essential Cookies:</strong> Required for authentication, security, and basic platform operation</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Functional Cookies:</strong> Remember your preferences and settings</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Analytics Cookies:</strong> Collect aggregated usage statistics to improve the Platform</span>
                    </li>
                  </ul>
                  <p className="text-muted-foreground leading-relaxed">
                    You can control cookies through your browser settings. Disabling certain cookies may limit platform functionality.
                  </p>
                </section>

                <Separator />

                {/* Section 8 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">8. Children's Privacy</h2>
                  <p className="text-muted-foreground leading-relaxed">
                    Our Platform is not intended for individuals under 18 years of age. We do not knowingly collect personal
                    information from children. If we discover that we have collected information from a child under 18, we will
                    delete it promptly. Parents or guardians who believe we may have collected information from a minor should
                    contact us immediately.
                  </p>
                </section>

                <Separator />

                {/* Section 9 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">9. Third-Party Links</h2>
                  <p className="text-muted-foreground leading-relaxed">
                    Our Platform may contain links to third-party websites or services that are not operated by Factor Sciences.
                    We are not responsible for the privacy practices of these third parties. We encourage you to review the
                    privacy policies of any external sites you visit.
                  </p>
                </section>

                <Separator />

                {/* Section 10 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">10. Changes to This Privacy Policy</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    We may update this Privacy Policy from time to time to reflect changes in our practices, technologies, legal
                    requirements, or other factors. When we make material changes, we will:
                  </p>
                  <ul className="space-y-2 text-muted-foreground ml-6 mb-4">
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Update the "Last Updated" date at the top of this policy</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Notify you via email or platform notification</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Provide a reasonable period for you to review the changes before they take effect</span>
                    </li>
                  </ul>
                  <p className="text-muted-foreground leading-relaxed">
                    Your continued use of the Platform after changes are posted constitutes acceptance of the updated Privacy Policy.
                  </p>
                </section>

                <Separator />

                {/* Section 11 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">11. Contact Information</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    For questions, concerns, or requests regarding this Privacy Policy or our data practices, please contact:
                  </p>
                  <div className="p-4 bg-muted/30 rounded-lg">
                    <p className="text-foreground font-medium mb-2">Factor Sciences Privacy Team</p>
                    <p className="text-sm text-muted-foreground">Email: <a href="mailto:privacy@factorsciences.com" className="text-primary hover:underline">privacy@factorsciences.com</a></p>
                    <p className="text-sm text-muted-foreground">Phone: +1 (818) 253-6096</p>
                    <p className="text-sm text-muted-foreground">Address: Factor Sciences, Sheridan, Wyoming</p>
                    <p className="text-sm text-muted-foreground mt-2">Response Time: We respond to privacy inquiries within 10 business days</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="/terms">Terms of Service</Link>
              </Button>
              <Button asChild variant="ghost" size="sm">
                <Link href="/refund">Refund Policy</Link>
              </Button>
            </div>
          </div>
        </div>
      </main>
    </div>
  )
}
