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

export const metadata = {
  title: "Refund Policy - Factor Sciences",
  description: "Refund and cancellation policy for Factor Sciences digital educational services"
}

export default function RefundPolicy() {
  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">
              <RotateCcw 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)]">
              Refund 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)]">Overview</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    This Refund Policy outlines the terms and conditions under which Factor Sciences ("we," "us," "our," or "Company")
                    issues refunds for services purchased through our digital educational services platform (the "Platform"). Please read this
                    policy carefully before making a purchase.
                  </p>
                  <div className="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 orders require payment verification before fulfillment. Payments are submitted via Zelle or CashApp. Due to the digital nature of our services,
                      refund eligibility is subject to specific conditions outlined below.
                    </p>
                  </div>
                </section>

                <Separator />

                {/* Section 1 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">1. General Refund Policy</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    Factor Sciences provides digital services including educational sessions, informational resources, and
                    administrative support. Because our services are delivered digitally and access is granted immediately upon
                    payment, refunds are handled on a case-by-case basis according to the following guidelines.
                  </p>

                  <h3 className="text-xl font-semibold mb-3 text-foreground">1.1 Service Categories</h3>
                  <p className="text-muted-foreground leading-relaxed mb-3">
                    Our refund policy varies based on the type of service purchased:
                  </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">One-Time Sessions:</strong> Single educational sessions</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Service Packages:</strong> Bundles of multiple sessions or services</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Subscription Services:</strong> Recurring access to services or educational materials</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Educational Resources:</strong> Access to digital content, courses, or materials</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. Refund Eligibility</h2>

                  <h3 className="text-xl font-semibold mb-3 text-foreground">2.1 Pre-Service Cancellations</h3>
                  <p className="text-muted-foreground leading-relaxed mb-3">
                    <strong className="text-foreground">Full Refund Eligibility:</strong> You may be eligible for a full refund if:
                  </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>You cancel your scheduled session at least 48 hours before the appointment time</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>The service has not yet been accessed or delivered</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>You have not downloaded or accessed any educational materials included in your purchase</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Technical issues on our end prevented service delivery and we cannot reschedule within a reasonable timeframe</span>
                    </li>
                  </ul>

                  <h3 className="text-xl font-semibold mb-3 text-foreground">2.2 Late Cancellations</h3>
                  <p className="text-muted-foreground leading-relaxed mb-3">
                    <strong className="text-foreground">Partial Refund or Credit:</strong> Cancellations made less than 48 hours before a scheduled session:
                  </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>24-48 hours before: Eligible for 50% refund or full credit toward future services</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Less than 24 hours: Generally not eligible for refund; credit toward rescheduling may be offered at our discretion</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>No-show (missed appointment): No refund or credit provided</span>
                    </li>
                  </ul>

                  <h3 className="text-xl font-semibold mb-3 text-foreground">2.3 Post-Service Refunds</h3>
                  <p className="text-muted-foreground leading-relaxed mb-3">
                    After a service has been delivered, refunds are generally not provided. However, we will consider refund requests on a case-by-case basis for:
                  </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">Technical Failures:</strong> Severe technical issues that prevented meaningful service delivery</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Service Quality:</strong> Documented professional misconduct or egregious service quality issues</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Billing Errors:</strong> Charges that were clearly erroneous or duplicate</span>
                    </li>
                  </ul>
                  <p className="text-muted-foreground leading-relaxed">
                    Dissatisfaction with session content or educational recommendations is not grounds for a refund,
                    as sessions are informational and educational in nature.
                  </p>
                </section>

                <Separator />

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

                  <h3 className="text-xl font-semibold mb-3 text-foreground">3.1 Monthly Subscriptions</h3>
                  <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>You may cancel your subscription at any time through your account settings</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Cancellations take effect at the end of the current billing period</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>No refunds are provided for partial months or unused portions of the subscription period</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>You will retain access to subscription benefits until the end of your paid period</span>
                    </li>
                  </ul>

                  <h3 className="text-xl font-semibold mb-3 text-foreground">3.2 Annual Subscriptions</h3>
                  <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">First 30 Days:</strong> Full refund available if canceled within 30 days of initial purchase and minimal usage (defined as fewer than 2 sessions or less than 10% of resources accessed)</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">After 30 Days:</strong> Pro-rated refund may be considered for the unused portion, minus a $50 administrative fee and the value of services already consumed</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Renewals:</strong> Auto-renewal charges may be refunded if you request cancellation within 7 days of the renewal charge</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. Service Packages</h2>
                  <p className="text-muted-foreground leading-relaxed mb-3">
                    For service packages (e.g., "3 Session Package" or "Wellness Bundle"):
                  </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">Before First Use:</strong> Full refund available if requested before any services in the package are accessed</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Partial Use:</strong> Refund calculated based on unused services at the standard single-service price (you will not receive the package discount on used services)</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span><strong className="text-foreground">Expiration:</strong> Unused services in packages expire according to the terms provided at purchase (typically 6-12 months). No refunds for expired services.</span>
                    </li>
                  </ul>
                </section>

                <Separator />

                {/* Section 5 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">5. Non-Refundable Services</h2>
                  <p className="text-muted-foreground leading-relaxed mb-3">
                    The following are generally not eligible for refunds under any circumstances:
                  </p>
                  <ul className="space-y-2 text-muted-foreground ml-6">
                    <li className="flex items-start gap-2">
                      <span className="text-destructive font-bold mt-1">•</span>
                      <span>Digital educational materials that have been downloaded or accessed</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-destructive font-bold mt-1">•</span>
                      <span>Completed sessions where the service was delivered in full</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-destructive font-bold mt-1">•</span>
                      <span>Administrative fees, processing fees, or convenience charges</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-destructive font-bold mt-1">•</span>
                      <span>Services rendered by third-party providers through our platform (provider-specific refund policies may apply)</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-destructive font-bold mt-1">•</span>
                      <span>Promotional or discounted services marked as "final sale" or "non-refundable" at time of purchase</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. How to Request a Refund</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    To request a refund, please follow these steps:
                  </p>

                  <h3 className="text-xl font-semibold mb-3 text-foreground">Step 1: Submit a Request</h3>
                  <p className="text-muted-foreground leading-relaxed mb-3">
                    Contact our customer support team within 14 days of the charge or service delivery:
                  </p>
                  <div className="p-4 bg-muted/30 rounded-lg mb-4">
                    <p className="text-sm text-muted-foreground mb-1"><strong className="text-foreground">Email:</strong> refunds@factorsciences.com</p>
                    <p className="text-sm text-muted-foreground mb-1"><strong className="text-foreground">Phone:</strong> +1 (818) 253-6096</p>
                    <p className="text-sm text-muted-foreground"><strong className="text-foreground">Subject Line:</strong> "Refund Request - [Your Name] - [Order Number]"</p>
                  </div>

                  <h3 className="text-xl font-semibold mb-3 text-foreground">Step 2: Provide Required Information</h3>
                  <p className="text-muted-foreground leading-relaxed mb-3">
                    Include the following in your refund request:
                  </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>Your full name and account email address</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Order number or transaction ID</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Date of purchase and amount charged</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Service or package name</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Detailed reason for refund request</span>
                    </li>
                    <li className="flex items-start gap-2">
                      <span className="text-primary mt-1">•</span>
                      <span>Any supporting documentation (screenshots, correspondence, etc.)</span>
                    </li>
                  </ul>

                  <h3 className="text-xl font-semibold mb-3 text-foreground">Step 3: Review Process</h3>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    Our team will review your request and respond within 5-7 business days. We may contact you for additional
                    information or clarification. Refund decisions are made at Factor Sciences' sole discretion based on the
                    circumstances and this policy.
                  </p>

                  <h3 className="text-xl font-semibold mb-3 text-foreground">Step 4: Refund Processing</h3>
                  <p className="text-muted-foreground leading-relaxed">
                    If your refund is approved, it will be processed to your original payment method within 10 business days.
                    Depending on your financial institution, it may take an additional 5-10 business days for the refund to
                    appear in your account.
                  </p>
                </section>

                <Separator />

                {/* Section 7 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">7. Chargebacks and Disputes</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    We encourage you to contact us directly before initiating a chargeback with your payment provider. Chargebacks
                    can result in additional fees and complications.
                  </p>
                  <div className="p-5 bg-destructive/5 border border-destructive/20 rounded-lg">
                    <p className="text-sm font-semibold text-destructive mb-3">Important Notice About Chargebacks:</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>Initiating a chargeback instead of working with our support team may result in account suspension</span>
                      </li>
                      <li className="flex items-start gap-2">
                        <span className="text-destructive font-bold mt-0.5">•</span>
                        <span>Unwarranted chargebacks may be disputed with documentation of service delivery</span>
                      </li>
                      <li className="flex items-start gap-2">
                        <span className="text-destructive font-bold mt-0.5">•</span>
                        <span>We reserve the right to pursue recovery of chargeback fees and administrative costs</span>
                      </li>
                    </ul>
                  </div>
                </section>

                <Separator />

                {/* Section 8 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">8. Modifications to This Policy</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    Factor Sciences reserves the right to modify this Refund Policy at any time. Changes will be effective
                    immediately upon posting to the Platform with an updated "Last Updated" date.
                  </p>
                  <p className="text-muted-foreground leading-relaxed">
                    Refund requests will be evaluated according to the policy in effect at the time of the original purchase,
                    unless the updated policy is more favorable to the customer.
                  </p>
                </section>

                <Separator />

                {/* Section 9 */}
                <section>
                  <h2 className="text-2xl font-bold mb-4 text-foreground font-[family-name:var(--font-display)]">9. Contact Information</h2>
                  <p className="text-muted-foreground leading-relaxed mb-4">
                    For questions about this Refund Policy or to request a refund, please contact:
                  </p>
                  <div className="p-4 bg-muted/30 rounded-lg">
                    <p className="text-foreground font-medium mb-2">Factor Sciences Customer Support</p>
                    <p className="text-sm text-muted-foreground">Email: refunds@factorsciences.com</p>
                    <p className="text-sm text-muted-foreground">Phone: +1 (818) 253-6096</p>
                    <p className="text-sm text-muted-foreground">Business Hours: Monday - Friday, 9:00 AM - 6:00 PM EST</p>
                    <p className="text-sm text-muted-foreground mt-2">Response Time: Refund requests are reviewed within 5-7 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="/privacy">Privacy Policy</Link>
              </Button>
            </div>
          </div>
        </div>
      </main>
    </div>
  )
}
