import React from "react";
import Link from "next/link";
import {
  Shield,
  ArrowLeft,
  Lock,
  ExternalLink,
  Mail,
  UserX,
  FileText,
} from "lucide-react";

export default function PrivacyPolicyPage() {
  return (
    <div className="min-h-screen bg-[#07090E] text-slate-100 selection:bg-amber-500/30 selection:text-amber-200">
      {/* Ambient background glow */}
      <div className="fixed inset-0 pointer-events-none overflow-hidden">
        <div className="absolute -top-40 left-1/2 -translate-x-1/2 w-[700px] h-[500px] bg-gradient-to-b from-amber-500/15 via-amber-600/5 to-transparent blur-3xl opacity-70 rounded-full" />
        <div className="absolute top-1/3 -right-48 w-[400px] h-[400px] bg-amber-700/5 blur-3xl rounded-full" />
        <div className="absolute bottom-10 -left-48 w-[500px] h-[500px] bg-slate-800/15 blur-3xl rounded-full" />
      </div>

      {/* Header */}
      <header className="relative z-50 border-b border-white/5 bg-[#07090E]/80 backdrop-blur-xl sticky top-0">
        <div className="max-w-5xl mx-auto px-4 sm:px-6 h-18 flex items-center justify-between">
          <Link
            href="/"
            className="group flex items-center gap-3 transition-opacity hover:opacity-90"
          >
            <div className="w-10 h-10 rounded-xl bg-gradient-to-tr from-amber-500 via-amber-400 to-amber-600 flex items-center justify-center font-bold text-slate-950 text-xl shadow-lg shadow-amber-500/20 group-hover:scale-105 transition-transform">
              I
            </div>
            <div>
              <span className="text-lg font-bold tracking-wider text-white">
                IMZY
              </span>
              <span className="block text-[10px] tracking-widest uppercase text-amber-400 font-semibold">
                Legal & Privacy
              </span>
            </div>
          </Link>

          <div className="flex items-center gap-3">
            <Link
              href="/delete-account"
              className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-xs font-semibold bg-white/[0.04] hover:bg-white/[0.08] text-slate-200 border border-white/10 hover:border-amber-400/40 transition-all"
            >
              <UserX className="w-3.5 h-3.5 text-amber-400" />
              Delete Account
            </Link>
            <Link
              href="/"
              className="inline-flex items-center gap-1.5 text-xs text-slate-400 hover:text-slate-200 transition-colors py-1.5 px-2.5 rounded-lg border border-white/5 hover:border-white/10 bg-white/[0.02]"
            >
              <ArrowLeft className="w-3.5 h-3.5" />
              Home
            </Link>
          </div>
        </div>
      </header>

      {/* Privacy Policy Main Content */}
      <main className="relative z-10 max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12 sm:py-16">
        {/* Title / Hero */}
        <div className="mb-12 text-center sm:text-left border-b border-white/5 pb-10">
          <div className="inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full text-xs font-semibold bg-amber-400/10 text-amber-300 border border-amber-400/20 mb-4 backdrop-blur-md">
            <Shield className="w-3.5 h-3.5 text-amber-400" />
            Official Legal Notice
          </div>

          <h1 className="text-3xl sm:text-5xl font-extrabold tracking-tight text-white mb-4">
            Privacy <span className="text-transparent bg-clip-text bg-gradient-to-r from-amber-200 via-amber-400 to-amber-100">Policy</span>
          </h1>

          <p className="text-xs sm:text-sm text-slate-400 flex items-center justify-center sm:justify-start gap-2">
            <FileText className="w-4 h-4 text-amber-400" />
            Globe13 Digital Private Limited &bull; Official Website & Mobile Apps Policy
          </p>
        </div>

        {/* Content Body */}
        <div className="space-y-10 text-[15px] leading-7 text-slate-300">
          {/* Introduction */}
          <section className="p-6 sm:p-8 rounded-3xl bg-gradient-to-b from-[#11141E] to-[#0A0D14] border border-white/10 shadow-xl backdrop-blur-sm">
            <h2 className="mb-5 text-xl sm:text-2xl font-bold text-white flex items-center gap-2.5">
              <span className="w-2 h-2 rounded-full bg-amber-400" />
              Introduction
            </h2>

            <div className="space-y-5">
              <p>
                This notice explains how we process personal data, as a data
                controller, relating to:
              </p>

              <ul className="list-disc space-y-3 pl-6 marker:text-amber-400">
                <li>
                  visitors (<strong>“W”</strong>) to our website:{' '}
                  <a
                    href="https://imzy.in"
                    target="_blank"
                    rel="noopener noreferrer"
                    className="font-medium text-amber-400 hover:text-amber-300 underline underline-offset-4 transition-colors"
                  >
                    https://imzy.in
                  </a>{' '}
                  (“Website”); and
                </li>

                <li>
                  users (<strong>“Mobile App Users”</strong>) of our mobile
                  apps (“mobile apps”), which are accessible via certain online
                  stores.
                </li>
              </ul>

              <p>
                and together the W and Mobile App Users shall be the “Users”
                (and “you” and “your” shall refer to any User).
              </p>

              <p>
                We update this notice from time to time, so Users should check
                back in on a regular basis.
              </p>

              <p>
                Please note that other websites or services mentioned on the
                Website or our Apps are not operated by us, and you should
                refer to the privacy policies on those websites to understand
                how their personal data is being used.
              </p>

              <p>
                We are committed to safeguarding the privacy of our website and
                mobile apps visitors and users. This policy applies where we
                are acting as a data controller with respect to the personal
                data of such persons; in other words, where we determine the
                purposes and means of the processing of that personal data.
              </p>

              <p>
                In this policy, &quot;we&quot;, &quot;us&quot; and &quot;our&quot; refer to{' '}
                <strong className="text-white">Globe13 Digital Private Limited</strong>. For more
                information about us, see Our Details.
              </p>
            </div>
          </section>

          {/* Section 2 */}
          <section className="p-6 sm:p-8 rounded-3xl bg-gradient-to-b from-[#11141E] to-[#0A0D14] border border-white/10 shadow-xl backdrop-blur-sm">
            <h2 className="mb-5 text-xl sm:text-2xl font-bold text-white flex items-center gap-2.5">
              <span className="w-2 h-2 rounded-full bg-amber-400" />
              2. The personal data that we collect
            </h2>

            <div className="space-y-5">
              <p>
                <strong className="text-white">2.1</strong> In this Section, we have set out the
                general categories of personal data that we process and, in the
                case of personal data that we did not obtain directly from you,
                information about the source and specific categories of that
                data.
              </p>

              <p>
                <strong className="text-white">2.2</strong> We may process data enabling us to get in
                touch with you (&quot;<strong className="text-white">contact data</strong>&quot;). The contact
                data may include your name, email address, telephone number,
                postal address and/or social media account identifiers. The
                source of the contact data is you. If you log into our website
                and mobile apps using a social media account, we will obtain
                elements of the contact data from the relevant social media
                account provider.
              </p>

              <p>
                <strong className="text-white">3.3</strong> We may process your website and mobile apps
                user account data (&quot;<strong className="text-white">account data</strong>&quot;). The
                account data may include your account identifier, name, email
                address, business name, account creation and modification
                dates, website and mobile apps settings and marketing
                preferences. The primary source of the account data is you
                although some elements of the account data may be generated by
                our website and mobile apps. If you log into our website and
                mobile apps using a social media account, we will obtain
                elements of the account data from the relevant social media
                account provider.
              </p>

              <p>
                We may process information relating to transactions, including
                purchases of goods and/or services, that you enter into with us
                and/or through our website and mobile apps (&quot;transaction
                data&quot;). The transaction data may include your name, your
                contact details, your payment card details (or other payment
                details) billing information, currency, country, and the
                transaction details. The source of the transaction data is you
                and/or our payment services providers (“Payment Providers “)
                (e.g., Stripe, PayPal, and Paddle). This data may also include
                anonymised or tokenised payment identifiers generated by these
                providers. These tokens are only accessible by our Payment
                Providers and are not stored by us. We may process information
                contained in or relating to any communication that you send to
                us or that we send to you (&quot;<strong className="text-white">communication data</strong>
                &quot;). The communication data may include the communication
                content and metadata associated with the communication. Our
                website and mobile apps will generate the metadata associated
                with communications made using the website and mobile apps
                contact forms.
              </p>

              <p>
                <strong className="text-white">3.4</strong> We may process data about your use of our
                website and mobile apps and services (&quot;<strong className="text-white">usage data</strong>
                &quot;). The usage data may include your IP address, geographical
                location, browser type and version, operating system, referral
                source, length of visit, page views and website and mobile apps
                navigation paths, as well as information about the timing,
                frequency and pattern of your service use. The source of the
                usage data is our analytics tracking system.
              </p>

              <div className="space-y-5">
                <h3 className="mb-3 text-lg flex items-center gap-2">
                  
                  3.5 Face Images and Visual Search Data
                </h3>

                <p>
                  We may process images and photos that you voluntarily upload
                  or capture using your device&apos;s camera or photo library, which
                  may contain facial features (&quot;image and face data&quot;). The
                  source of this data is you. This data is processed solely for
                  the purpose of generating the AI-based content and image
                  transformations that you request. We do not automatically
                  collect face data, nor do we create, extract, store, or
                  analyze biometric templates, facial geometry, facial maps, or
                  identifiers for personal identification, authentication,
                  advertising, profiling, analytics, tracking, or any purpose
                  unrelated to providing the requested AI-generated content.
                </p>

                <p className="mt-5">
                  We do not permanently store your image and face data. Images
                  and generated content are retained only for the duration
                  necessary to process your request and deliver the AI-generated
                  content back to your device. After processing is complete, all
                  associated data is permanently deleted from our systems and
                  the systems of our third-party processing providers.
                </p>
              </div>
            </div>
          </section>

          {/* Section 4 */}
          <section className="p-6 sm:p-8 rounded-3xl bg-gradient-to-b from-[#11141E] to-[#0A0D14] border border-white/10 shadow-xl backdrop-blur-sm">
            <h2 className="mb-5 text-xl sm:text-2xl font-bold text-white flex items-center gap-2.5">
              <span className="w-2 h-2 rounded-full bg-amber-400" />
              4. Purposes of processing and legal bases
            </h2>

            <div className="space-y-5">
              <p>
                <strong className="text-white">4.1</strong> In this Section, we have set out the
                purposes for which we may process personal data and the legal
                basis of the processing.
              </p>

              <div className="space-y-5">
                <h3 className="mb-3 text-lg flex items-center gap-2">
                  4.2 Sharing of Face Data with Service Providers
                </h3>

                <p>
                  We do not sell your face data. We may share face images and
                  related technical features with carefully selected third-party
                  service providers that help us perform visual search (for
                  example, cloud infrastructure or AI search providers). These
                  providers are contractually required to process this data only
                  on our behalf, only for the purpose of performing the search,
                  to implement appropriate security measures, and to delete the
                  data after processing.
                </p>
              </div>

              <div className="grid grid-cols-1 gap-4 pt-2">
                <PolicyItem
                  title="Operations"
                  text="We may process your personal data for the purposes of operating our website and mobile apps, the processing and fulfilment of orders, providing our services, generating invoices, bills and other payment-related documentation. This includes processing carried out by our authorised payment providers for purposes such as billing, issuing tax-compliant receipts, fraud prevention, and refund management. The legal basis for this processing is our legitimate interests and the performance of a contract between you and us."
                />

                <PolicyItem
                  title="Relationships and communications"
                  text="We may process contact data, account data, transaction data and/or communication data for the purposes of managing our relationships, communicating with you (excluding communicating for the purposes of direct marketing) by the means of communication you provided providing support services and complaint handling. The legal basis for this processing is our legitimate interests, namely communications with our website and mobile apps visitors, service users, individual customers and customer personnel, the maintenance of relationships, and the proper administration of our website and mobile apps."
                />

                <PolicyItem
                  title="Direct marketing"
                  text="We may process contact data, account data and/or transaction data for the purposes of creating, targeting and sending direct marketing communications by the means of communication you provided. The legal basis for this processing is consent and/or our legitimate interests."
                />

                <PolicyItem
                  title="Research and analysis"
                  text="We may process usage data and/or transaction data for the purposes of researching and analysing the use of our website and mobile apps and services, as well as researching and analysing other interactions with our business. The legal basis for this processing is consent and/or our legitimate interests."
                />

                <PolicyItem
                  title="Record keeping"
                  text="We may process your personal data for the purposes of creating and maintaining our databases, back-up copies of our databases and our business records generally. The legal basis for this processing is our legitimate interests."
                />

                <PolicyItem
                  title="Security"
                  text="We may process your personal data for the purposes of security and the prevention of fraud and other criminal activity. The legal basis for this processing is our legitimate interests."
                />

                <PolicyItem
                  title="Legal compliance and vital interests"
                  text="We may also process your personal data where such processing is necessary for compliance with a legal obligation to which we are subject or in order to protect your vital interests or the vital interests of another natural person."
                />
              </div>
            </div>
          </section>

          {/* Section 5 */}
          <section className="p-6 sm:p-8 rounded-3xl bg-gradient-to-b from-[#11141E] to-[#0A0D14] border border-white/10 shadow-xl backdrop-blur-sm">
            <h2 className="mb-5 text-xl sm:text-2xl font-bold text-white flex items-center gap-2.5">
              <span className="w-2 h-2 rounded-full bg-amber-400" />
              5. Providing your personal data to others
            </h2>

            <div className="space-y-5">
              <p>
                <strong className="text-white">5.1</strong> Your personal data held in our website and
                mobile apps database will be stored on the servers of our
                hosting services providers.
              </p>

              <p>
                <strong className="text-white">5.2</strong> Financial transactions relating to our
                website and mobile apps and services may be handled by our
                Payment Providers. This includes payments made directly via our
                website using web-based checkout systems. If you purchased
                directly from our website, you may cancel through your account
                settings or by contacting us. Deleting the mobile application
                does not cancel your subscription.
              </p>

              <p>
                We do not store or collect your full payment card details. Any
                payment information you provide will be processed directly by
                the relevant provider in accordance with their respective
                privacy policies.
              </p>

              <p>
                These providers may collect and process your payment and
                billing information, issue receipts or invoices, calculate and
                remit applicable taxes, and manage customer payment flows as
                part of their role in enabling purchases of our Services.
              </p>

              <p>
                We will share transaction data with our Payment Providers only
                to the extent necessary for the purposes of processing your
                payments, managing refunds, issuing receipts, and handling
                payment-related queries and disputes.
              </p>

              <div className="p-5 rounded-2xl bg-white/[0.02] border border-white/5 space-y-3">
                <h3 className="text-base sm:text-lg font-semibold text-white">
                  5.3 Third-party SDKs and Advertising Platforms
                </h3>

                <p>
                  We use third-party SDKs and advertising platforms to help us
                  analyse app performance, deliver personalised ads, and better
                  understand user engagement. These services may collect data
                  such as your device type, advertising identifiers, location,
                  usage patterns, and in-app behaviours.
                </p>

                <p>
                  These services use the collected data to deliver and optimise
                  ads, perform attribution analysis, and monitor app
                  performance. Data collected may be combined with information
                  from other apps or services for cross-platform advertising
                  purposes. Some of these SDKs may perform automated
                  decision-making or profiling. We recommend reviewing their
                  respective privacy policies for further details.
                </p>
              </div>

              <div className="p-5 rounded-2xl bg-white/[0.02] border border-white/5 space-y-3">
                <h3 className="text-base sm:text-lg font-semibold text-white">
                  5.4 AI-Powered Features and Third-party APIs
                </h3>

                <p>
                  Our apps integrate various artificial intelligence (AI) tools
                  and third-party APIs to provide enhanced features and
                  personalised experiences
                </p>

                <p>
                  These tools may receive and process data such as user
                  queries, text inputs, images, photos, or contextual
                  information to generate responses and AI-based content. We
                  take reasonable measures to transmit data securely and limit
                  usage to the extent necessary for real-time responses. We do
                  not store or retain AI-generated outputs or your input data
                  beyond the duration of the response session. By using these
                  features, you consent to the transfer and processing of your
                  data by these AI services. If you do not agree, please refrain
                  from using these features. If you encounter inappropriate
                  content, you may report it using the mechanisms available
                  within the app. We promptly review and take appropriate
                  action.
                </p>
              </div>
            </div>
          </section>

          {/* Section 6 */}
          <section className="p-6 sm:p-8 rounded-3xl bg-gradient-to-b from-[#11141E] to-[#0A0D14] border border-white/10 shadow-xl backdrop-blur-sm">
            <h2 className="mb-5 text-xl sm:text-2xl font-bold text-white flex items-center gap-2.5">
              <span className="w-2 h-2 rounded-full bg-amber-400" />
              6. Retaining and deleting personal data
            </h2>

            <div className="space-y-5">
              <p>
                <strong className="text-white">6.1</strong> This Section 6 sets out our data retention
                policies and procedures, which are designed to help ensure that
                we comply with our legal obligations in relation to the
                retention and deletion of personal data.
              </p>

              <p>
                <strong className="text-white">6.2</strong> Personal data that we process for any
                purpose or purposes shall not be kept for longer than is
                necessary for that purpose or those purposes.
              </p>

              <p>
                <strong className="text-white">6.3</strong> Notwithstanding the other provisions of
                this Section 6, we may retain your personal data where such
                retention is necessary for compliance with a legal obligation
                to which we are subject, or in order to protect your vital
                interests or the vital interests of another natural person.
                Please note that certain payment data may be retained by our
                Payment Providers in accordance with their own legal
                obligations and retention policies.
              </p>
            </div>
          </section>

          {/* Section 7 */}
          <section className="p-6 sm:p-8 rounded-3xl bg-gradient-to-b from-[#11141E] to-[#0A0D14] border border-white/10 shadow-xl backdrop-blur-sm">
            <h2 className="mb-5 text-xl sm:text-2xl font-bold text-white flex items-center gap-2.5">
              <span className="w-2 h-2 rounded-full bg-amber-400" />
              7. Your rights
            </h2>

            <div className="space-y-5">
              <p>
                <strong className="text-white">7.1</strong> In this Section 7, we have listed the
                rights that you have under data protection law.
              </p>

              <p>
                <strong className="text-white">7.2</strong> Your principal rights under data
                protection law are:
              </p>

              <ol className="list-[lower-alpha] space-y-3 pl-8 marker:text-amber-400 marker:font-semibold">
                <li>
                  <strong className="text-white">the right to access</strong> - you can ask for copies
                  of your personal data;
                </li>
                <li>
                  <strong className="text-white">the right to rectification</strong> - you can ask us
                  to rectify inaccurate personal data and to complete
                  incomplete personal data;
                </li>
                <li>
                  <strong className="text-white">the right to erasure</strong> - you can ask us to
                  erase your personal data;
                </li>
                <li>
                  <strong className="text-white">the right to restrict processing</strong> - you can
                  ask us to restrict the processing of your personal data;
                </li>
                <li>
                  <strong className="text-white">the right to object to processing</strong> - you can
                  object to the processing of your personal data;
                </li>
                <li>
                  <strong className="text-white">the right to data portability</strong> - you can ask
                  that we transfer your personal data to another organisation
                  or to you;
                </li>
                <li>
                  <strong className="text-white">the right to complain to a supervisory authority</strong>{' '}
                  - you can complain about our processing of your personal data;
                  and
                </li>
                <li>
                  <strong className="text-white">the right to withdraw consent</strong> - to the extent
                  that the legal basis of our processing of your personal data
                  is consent, you can withdraw that consent.
                </li>
              </ol>

              <p>
                <strong className="text-white">7.3</strong> These rights are subject to certain
                limitations and exceptions.
              </p>

              <p>
                <strong className="text-white">7.4</strong> You may exercise any of your rights in
                relation to your personal data by written notice to us, using
                the contact details set out below.
              </p>

              <p>
                <strong className="text-white">7.5</strong> Where your personal data is processed by
                third-party payment providers, you may need to exercise certain
                rights (e.g., deletion or access) directly with them via their
                respective privacy policies.
              </p>
            </div>
          </section>

          {/* Section 8 */}
          <section className="p-6 sm:p-8 rounded-3xl bg-gradient-to-b from-[#11141E] to-[#0A0D14] border border-white/10 shadow-xl backdrop-blur-sm">
            <h2 className="mb-5 text-xl sm:text-2xl font-bold text-white flex items-center gap-2.5">
              <span className="w-2 h-2 rounded-full bg-amber-400" />
              8. Amendments
            </h2>

            <div className="space-y-5">
              <p>
                <strong className="text-white">8.1</strong> We may update this policy from time to
                time by publishing a new version on our website and mobile
                apps.
              </p>

              <p>
                <strong className="text-white">8.2</strong> You should check this page occasionally to
                ensure you are happy with any changes to this policy.
              </p>

              <p>
                <strong className="text-white">8.3</strong> We may notify you of significant changes
                to this policy by notification or email (if provided).
              </p>
            </div>
          </section>

          {/* Section 9 */}
          <section className="p-6 sm:p-8 rounded-3xl bg-gradient-to-b from-[#11141E] to-[#0A0D14] border border-white/10 shadow-xl backdrop-blur-sm">
            <h2 className="mb-5 text-xl sm:text-2xl font-bold text-white flex items-center gap-2.5">
              <span className="w-2 h-2 rounded-full bg-amber-400" />
              9. Our details
            </h2>

            <div className="space-y-5">
              <p>
                <strong className="text-white">9.1</strong> This website and mobile apps is owned and
                operated by <em className="text-amber-300 not-italic font-semibold">Globe13 Digital Pvt. Ltd.</em>
              </p>

              <p>
                <strong className="text-white">9.2</strong> You can contact us by email, using the
                email address published on our website and mobile apps or{' '}
                <a
                  href="mailto:info@globe13.com"
                  className="font-medium text-amber-400 hover:text-amber-300 underline underline-offset-4 transition-colors"
                >
                  info@globe13.com
                </a>
                .
              </p>
            </div>
          </section>
        </div>
      </main>

      {/* Footer */}
      <footer className="relative z-10 border-t border-white/10 py-8 text-xs text-slate-500">
        <div className="max-w-5xl mx-auto px-4 sm:px-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
          <p>© {new Date().getFullYear()} IMZY. All rights reserved.</p>

          <div className="flex items-center gap-6">
            <Link
              href="/delete-account"
              className="text-slate-400 hover:text-amber-400 transition-colors"
            >
              Account Deletion
            </Link>
            <a
              href="https://imzy.in"
              target="_blank"
              rel="noopener noreferrer"
              className="inline-flex items-center gap-1 text-slate-400 hover:text-amber-400 transition-colors"
            >
              imzy.in
              <ExternalLink className="w-3 h-3" />
            </a>
            <a
              href="mailto:info@globe13.com"
              className="inline-flex items-center gap-1 text-slate-400 hover:text-amber-400 transition-colors"
            >
              <Mail className="w-3 h-3" />
              info@globe13.com
            </a>
          </div>
        </div>
      </footer>
    </div>
  );
}

function PolicyItem({
  title,
  text,
}: {
  title: string;
  text: string;
}) {
  return (
    <div className="p-4 rounded-2xl bg-white/[0.02] border border-white/5 hover:border-white/10 transition-colors">
      <h3 className="mb-1.5 text-base font-semibold text-white">{title}</h3>
      <p className="text-sm text-slate-300 leading-relaxed">{text}</p>
    </div>
  );
}