import React from "react";
import { motion } from "framer-motion";
import {
  Shield,
  Scale,
  FileText,
  CheckCircle2,
  Users,
  CreditCard,
  UserCheck,
  Gift,
  Lock,
  AlertTriangle,
  FileWarning,
  FileEdit,
  Gavel,
} from "lucide-react";

const TermsAndConditions: React.FC = () => {
  const sections = [
    {
      title: "1. Acceptance of Terms",
      content:
        "By accessing or using ExamInfra, you agree to be bound by these Terms and Conditions. If you do not agree with any part of these terms, you must not use our platform. These Terms apply to all users using our services.",
      icon: CheckCircle2,
    },
    {
      title: "2. User Accounts",
      content:
        "Users are responsible for maintaining the confidentiality of their account credentials. Any activity performed under your account is your responsibility. You must notify us immediately in case of unauthorized access or security breach. Institutions and staff are responsible for managing accounts associated with their organization.",
      icon: Shield,
    },
    {
      title: "3. User Roles and Access",
      content:
        "ExamInfra supports the following user types: Students (Can register independently or through an institution and access tests), Staff (Can manage students, create questions, and conduct tests), and Institutions (Can oversee staff, manage students, and monitor performance). Access to platform features is based on the assigned role.",
      icon: Users,
    },
    {
      title: "4. Educational Use",
      content:
        "ExamInfra is intended strictly for educational and exam preparation purposes. Users agree not to engage in illegal activities, attempt to hack, disrupt, or misuse the platform, copy or misuse exam content, or circumvent security mechanisms.",
      icon: Scale,
    },
    {
      title: "5. Question Bank & Intellectual Property",
      content:
        "All content on ExamInfra, including MCQs, test papers, and explanations, is owned by ExamInfra, institutions, or content providers. Staff and institutions may upload and manage their own content. By uploading content, you grant ExamInfra a license to store and use it for platform operations. Users are strictly prohibited from copying, distributing, or reselling content without permission.",
      icon: FileText,
    },
    {
      title: "6. Payments and Fees",
      content:
        "Students may be required to pay fees to their institution or the platform (where applicable). All payments must be made through approved methods. Fees are non-refundable, unless explicitly stated otherwise. ExamInfra is not responsible for disputes between students and institutions regarding payments.",
      icon: CreditCard,
    },
    {
      title: "7. Student Usage and Conduct",
      content:
        "Students agree not to engage in cheating, impersonation, or unfair practices during tests, and not to share test content with others. Violations may result in suspension or permanent account termination.",
      icon: UserCheck,
    },
    {
      title: "8. Referral Program",
      content:
        "Staff may share referral codes with students. Any misuse, manipulation, or fraudulent activity will result in suspension of accounts and cancellation of referral benefits.",
      icon: Gift,
    },
    {
      title: "9. Data Privacy",
      content:
        "ExamInfra collects and processes user data to provide services. Institutions and staff may access data related to their students. Users agree to the collection and use of data as per our Privacy Policy.",
      icon: Lock,
    },
    {
      title: "10. Suspension and Termination",
      content:
        "ExamInfra reserves the right to suspend or terminate accounts that violate these Terms, remove any content deemed inappropriate or unlawful, or restrict access without prior notice in case of misuse.",
      icon: AlertTriangle,
    },
    {
      title: "11. Limitation of Liability",
      content:
        "ExamInfra is provided on an “as-is” basis. We are not liable for data loss, service interruptions, payment disputes between users, or errors in test content.",
      icon: FileWarning,
    },
    {
      title: "12. Modifications to Terms",
      content:
        "We reserve the right to update or modify these Terms at any time. Continued use of the platform constitutes acceptance of the updated Terms.",
      icon: FileEdit,
    },
    {
      title: "13. Governing Law",
      content: "These Terms shall be governed by the laws of India.",
      icon: Gavel,
    },
  ];

  return (
    <div className="min-h-screen bg-white">
      {/* Header */}
      <section className="pt-32 pb-16 bg-brand-navy relative overflow-hidden">
        <div className="absolute top-0 right-0 -z-0 opacity-10">
          <div className="w-96 h-96 bg-brand-green rounded-full blur-3xl transform translate-x-1/2 -translate-y-1/2"></div>
        </div>

        <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10 text-center">
          <motion.h1
            className="text-4xl md:text-5xl font-extrabold text-white mb-6"
            initial={{ opacity: 0, y: 20 }}
            animate={{ opacity: 1, y: 0 }}
          >
            Terms & <span className="text-brand-orange">Conditions</span>
          </motion.h1>
          <motion.p
            className="text-blue-100 text-lg max-w-2xl mx-auto"
            initial={{ opacity: 0 }}
            animate={{ opacity: 1 }}
            transition={{ delay: 0.2 }}
          >
            Please read these terms carefully before using the ExamInfra
            platform.
          </motion.p>
        </div>
      </section>

      {/* Content */}
      <section className="py-20">
        <div className="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8">
          <div className="space-y-3">
            {sections.map((section, index) => (
              <motion.div
                key={index}
                className="flex gap-6 p-8 rounded-2xl border border-gray-100 bg-white shadow-sm hover:shadow-md transition-shadow"
                initial={{ opacity: 0, x: -20 }}
                whileInView={{ opacity: 1, x: 0 }}
                viewport={{ once: true }}
                transition={{ delay: 0.5 }}
              >
                <div className="flex-shrink-0">
                  <div className="w-12 h-12 rounded-xl bg-orange-50 flex items-center justify-center text-brand-orange">
                    <section.icon className="w-6 h-6" />
                  </div>
                </div>
                <div>
                  <h3 className="text-xl font-bold text-brand-navy mb-3">
                    {section.title}
                  </h3>
                  <p className="text-gray-600 leading-relaxed">
                    {section.content}
                  </p>
                </div>
              </motion.div>
            ))}
          </div>

          <motion.div
            className="mt-16 p-8 rounded-2xl bg-blue-50 border border-blue-100"
            initial={{ opacity: 0 }}
            whileInView={{ opacity: 1 }}
            viewport={{ once: true }}
          >
            <h3 className="text-lg font-bold text-brand-navy mb-4">
              Contacting Us
            </h3>
            <p className="text-gray-600">
              If you have any questions about these Terms & Conditions, please
              contact us at
              <a
                href="mailto:info@examinfra.com"
                className="text-brand-navy font-semibold ml-1 hover:underline"
              >
                info@examinfra.com
              </a>
              .
            </p>
          </motion.div>
        </div>
      </section>
    </div>
  );
};

export default TermsAndConditions;
