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 { CreditCard, Clock, Ban, RefreshCcw, MessageSquare, CheckCircle } from 'lucide-react'

export const metadata: Metadata = generateMetadata({
  title: 'Refund Policy - SiliconPin',
  description:
    'Learn about SiliconPin\'s refund policy for our hosting services. Find information about eligibility, process, and timeline for refunds.',
})

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

  const refundEligibility = [
    {
      title: '1.1 Service Cancellation within 30 Days',
      description: 'If you are dissatisfied with our services for any reason, you may request a refund within 30 days of the initial purchase date. This is our "30-day satisfaction guarantee" and applies to first-time purchases of hosting plans.',
      icon: Clock,
      color: 'text-green-600'
    },
    {
      title: '1.2 Service Unavailability',
      description: 'If our service experiences extended downtime (exceeding our 99.9% uptime guarantee) within a billing period, you may be eligible for a prorated refund for the affected period. This will be calculated based on the duration of the downtime and the cost of your hosting plan.',
      icon: RefreshCcw,
      color: 'text-orange-600'
    },
    {
      title: '1.3 Service Termination by SiliconPin',
      description: 'If SiliconPin terminates your service for reasons other than violation of our Terms and Conditions, you may be eligible for a prorated refund for the unused portion of your current billing period.',
      icon: CheckCircle,
      color: 'text-blue-600'
    }
  ]

  const nonRefundableItems = [
    'Domain registration fees',
    'Setup fees',
    'Additional services or add-ons',
    'Services cancelled after the 30-day satisfaction guarantee period',
    'Services terminated due to violation of our Terms and Conditions',
    'Transaction fees or currency conversion charges'
  ]

  const contactMethods = [
    {
      method: 'Email',
      value: 'support@siliconpin.com',
      href: 'mailto:support@siliconpin.com'
    },
    {
      method: 'Phone',
      value: '+91-700-160-1485',
      href: 'tel:+917001601485'
    },
    {
      method: 'Contact Form',
      value: 'Website contact form',
      href: '/contact'
    }
  ]

  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">Refund Policy</h1>
          <p className="text-xl text-muted-foreground max-w-3xl mx-auto">
            Our commitment to fair and transparent refund procedures
          </p>
          <div className="mt-4">
            <Badge variant="outline" className="text-sm">
              <CreditCard 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">
                At SiliconPin, we strive to provide high-quality hosting services that meet our customers' expectations. 
                We understand that there may be circumstances where a refund is warranted, and we have established this 
                refund policy to outline the conditions and procedures for such situations.
              </p>
            </CardContent>
          </Card>

          {/* Eligibility for Refunds */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <CheckCircle className="w-6 h-6 mr-2 text-green-600" />
                Eligibility for Refunds
              </CardTitle>
            </CardHeader>
            <CardContent className="space-y-6">
              {refundEligibility.map((item, index) => {
                const Icon = item.icon
                return (
                  <div key={index} className="space-y-3">
                    <div className="flex items-center space-x-3">
                      <div className="p-2 rounded-lg bg-primary/10">
                        <Icon className={`w-5 h-5 ${item.color}`} />
                      </div>
                      <h3 className="text-lg font-semibold text-green-600">{item.title}</h3>
                    </div>
                    <p className="text-muted-foreground leading-relaxed pl-11">
                      {item.description}
                    </p>
                  </div>
                )
              })}
            </CardContent>
          </Card>

          {/* Non-Refundable Items */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <Ban className="w-6 h-6 mr-2 text-red-600" />
                Non-Refundable Items
              </CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-muted-foreground mb-4">
                The following items and circumstances are generally not eligible for refunds:
              </p>
              <div className="grid grid-cols-1 md:grid-cols-2 gap-3">
                {nonRefundableItems.map((item, 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">{item}</span>
                  </div>
                ))}
              </div>
            </CardContent>
          </Card>

          {/* Refund Process */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <RefreshCcw className="w-6 h-6 mr-2 text-blue-600" />
                Refund Process
              </CardTitle>
            </CardHeader>
            <CardContent className="space-y-6">
              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-3">3.1 Requesting a Refund</h3>
                <p className="text-muted-foreground mb-4">
                  To request a refund, please contact our customer support team through one of the following methods:
                </p>
                <div className="grid grid-cols-1 md:grid-cols-3 gap-4">
                  {contactMethods.map((contact, index) => (
                    <div key={index} className="p-4 border rounded-lg hover:border-green-600 transition-colors">
                      <div className="font-medium mb-2">{contact.method}</div>
                      <a 
                        href={contact.href}
                        className="text-green-600 hover:underline text-sm"
                      >
                        {contact.value}
                      </a>
                    </div>
                  ))}
                </div>
                <p className="text-muted-foreground mt-4">
                  Please include your account information, the service you wish to cancel, and the reason for your refund request.
                </p>
              </div>

              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-3">3.2 Processing Time</h3>
                <div className="flex items-start space-x-3 p-4 bg-blue-50 dark:bg-blue-950/10 rounded-lg border border-blue-200 dark:border-blue-800">
                  <Clock className="w-5 h-5 text-blue-600 mt-0.5" />
                  <div>
                    <p className="text-blue-800 dark:text-blue-200 font-medium mb-1">
                      7 Business Days Processing
                    </p>
                    <p className="text-sm text-blue-700 dark:text-blue-300">
                      We aim to process all refund requests within 7 business days of receiving the request. 
                      The actual time for the refunded amount to appear in your account may vary depending on your payment provider.
                    </p>
                  </div>
                </div>
              </div>

              <div>
                <h3 className="text-lg font-semibold text-green-600 mb-3">3.3 Refund Method</h3>
                <p className="text-muted-foreground leading-relaxed">
                  Refunds will be issued using the same payment method used for the original purchase. 
                  If this is not possible, we will work with you to find an alternative method.
                </p>
              </div>
            </CardContent>
          </Card>

          {/* Policy Modifications */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl">Policy Modifications</CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-muted-foreground leading-relaxed">
                SiliconPin reserves the right to modify this refund policy at any time. Any changes to this policy 
                will be posted on our website and will apply to purchases made after the date of modification.
              </p>
            </CardContent>
          </Card>

          {/* Contact Information */}
          <Card>
            <CardHeader>
              <CardTitle className="text-2xl flex items-center">
                <MessageSquare className="w-6 h-6 mr-2 text-purple-600" />
                Contact Us
              </CardTitle>
            </CardHeader>
            <CardContent>
              <p className="text-muted-foreground leading-relaxed mb-4">
                If you have any questions or concerns about our refund policy, please don't hesitate to 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 Help with a Refund?"
            description="Our support team is here to assist you with any refund requests or questions about our policy"
            buttonText="Contact Support"
            buttonHref="/contact"
          />
        </div>
      </main>
      <Footer />
    </div>
  )
}