import React from "react";
import { motion } from "framer-motion";
import { FiCheckCircle } from "react-icons/fi";
import styles from '../styles/TermsOfSale.module.css';

export default function TermsOfSale() {
  const sections = [
    { id: 1, title: "Definitions", content: (
      <ul>
        <li><b>Company:</b> Dattatray Corporation, owner of the brand <b>Vamsa Agri</b>.</li>
        <li><b>Buyer:</b> Any individual, entity, or company purchasing the Company's liner bags.</li>
        <li><b>Product:</b> Vamsa Agri liner bags designed for fresh produce packaging.</li>
        <li><b>Agreement:</b> These Terms and Conditions of Sale.</li>
        <li><b>Order:</b> A confirmed request for Products by the Buyer.</li>
      </ul>
    )},
    { id: 2, title: "Scope of Agreement", content: (
      <>
        <p>The Company supplies liner bags that enhance the shelf life of fresh produce.</p>
        <p>It does not guarantee compliance with export regulations regarding residues, fruit quality, packaging, or other external factors.</p>
        <p>By purchasing the Product, the Buyer acknowledges and accepts these Terms and Conditions.</p>
      </>
    )},
    { id: 3, title: "Limitation of Liability", content: (
      <>
        <p>Our liability is strictly limited to the manufacturing quality of the liner bags. We are not responsible for:</p>
        <ul>
          <li>Quality, size, or pesticide content of the fresh produce</li>
          <li>Packaging materials (boxes, LDPE pouches, etc.)</li>
          <li>Storage conditions, transportation, or export handling post-purchase</li>
          <li>Shipment rejection for reasons unrelated to liner bag quality</li>
          <li>Financial losses beyond the invoice value</li>
          <li>Failure due to improper precooling, temperature variations, or missing residue checks</li>
        </ul>
      </>
    )},
    { id: 4, title: "Disclaimer of Warranties", content: (
      <>
        <p>The Company warrants its liner bags are manufactured to industry standards and free from defects. However, we make no guarantees about:</p>
        <ul>
          <li>Produce shelf life</li>
          <li>Prevention of external contamination or degradation</li>
          <li>Compliance with importer’s agricultural/food safety rules</li>
          <li>Failure caused by improper precooling, temperature issues, or missing residue tests</li>
        </ul>
        <p>The Buyer is responsible for ensuring compliance with export/import regulations and product suitability.</p>
      </>
    )},
    { id: 5, title: "Buyer Indemnity", content: (
      <>
        <p>The Buyer agrees to indemnify and hold the Company harmless from claims, losses, or penalties arising from:</p>
        <ul>
          <li>Improper use or misuse of liner bags</li>
          <li>Export shipment rejection (other than due to proven liner bag defect)</li>
          <li>Third-party claims (farmers, exporters, importers, regulators)</li>
        </ul>
        <p>The Buyer acknowledges our maximum liability is limited to the invoice value. Payments cannot be withheld for issues unrelated to liner bag quality.</p>
      </>
    )},
    { id: 6, title: "Control Sample Retention", content: (
      <p>The Buyer must retain at least five (5) control samples per batch for verification. Claims without such verification will not be valid.</p>
    )},
    { id: 7, title: "Purchase Confirmation & Acceptance", content: (
      <p>Each order implies full acceptance of these Terms & Conditions. The Buyer is responsible for proper product handling. The Company may update these terms anytime.</p>
    )},
    { id: 8, title: "Dispute Resolution & Governing Law", content: (
      <p>Disputes fall under the exclusive jurisdiction of Nashik, Maharashtra, India. Both parties shall first attempt amicable resolution through negotiation.</p>
    )},
    { id: 9, title: "Payment Terms & Indemnity", content: (
      <p>Payments shall not be withheld for issues unrelated to liner bag manufacturing. The Buyer indemnifies the Company from claims due to shipment rejection beyond product scope.</p>
    )},
    { id: 10, title: "Force Majeure", content: (
      <p>The Company is not liable for failure or delays due to uncontrollable events (natural disasters, government actions, trade restrictions, etc.).</p>
    )},
    { id: 11, title: "Notices & Communication", content: (
      <p>All official communications must be made in writing via registered post or email.</p>
    )},
    { id: 12, title: "Entire Agreement", content: (
      <p>This document constitutes the full agreement between Company and Buyer, replacing all prior understandings.</p>
    )},
  ];

  return (
    <div className={styles.container}>
      <motion.div
        initial={{ opacity: 0, y: 20 }}
        animate={{ opacity: 1, y: 0 }}
        transition={{ duration: 0.6 }}
        className={styles.card}
      >
        <h1 className={styles.heading}>Terms and Conditions of Sale</h1>

        {sections.map((section) => (
          <section key={section.id} className={styles.section}>
            <div className={styles.sectionHeader}>
              <div className={styles.sectionIcon}>
                <FiCheckCircle />
              </div>
              <h2>{section.title}</h2>
            </div>
            <div className={styles.sectionContent}>
              {section.content}
            </div>
          </section>
        ))}
      </motion.div>
    </div>
  );
}
