import React from 'react';
import { ArrowLeft } from 'lucide-react';

interface PrivacyPolicyProps {
  onBack: () => void;
}

const PrivacyPolicy: React.FC<PrivacyPolicyProps> = ({ onBack }) => {
  return (
    <div className="bg-background-dark min-h-screen text-text-light font-sans pt-32 pb-20">
      <div className="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8">
        <button 
          onClick={onBack}
          className="flex items-center gap-2 text-primary hover:text-emerald-400 transition-colors mb-8 group"
        >
          <ArrowLeft size={20} className="group-hover:-translate-x-1 transition-transform" />
          <span>Back to Home</span>
        </button>

        <h1 className="text-4xl lg:text-5xl font-display font-bold mb-8 text-white">Privacy Policy</h1>
        
        <div className="space-y-8 text-gray-400 leading-relaxed">
          <section>
            <h2 className="text-2xl font-bold text-white mb-4">1. Introduction</h2>
            <p>
              Welcome to Nemia. We are committed to protecting your personal information and your right to privacy. If you have any questions or concerns about our policy, or our practices with regards to your personal information, please contact us.
            </p>
          </section>

          <section>
            <h2 className="text-2xl font-bold text-white mb-4">2. Information We Collect</h2>
            <p>
              We collect personal information that you provide to us such as name, email address, and study data when you register an account via Google Sign-In. We also collect data related to your flashcards, decks, and study progress to enable cloud synchronization.
            </p>
            <p className="mt-4">
              <strong>Focus Mode Data:</strong> On Android, Nemia requires Accessibility and Overlay permissions to detect foreground apps and provide blocking functionality. This data is processed locally on your device and is never uploaded to our servers.
            </p>
          </section>

          <section>
            <h2 className="text-2xl font-bold text-white mb-4">3. How We Use Your Information</h2>
            <p>
              We use the information we collect or receive to:
            </p>
            <ul className="list-disc pl-6 mt-4 space-y-2">
              <li>Facilitate account creation and logon process via Google OAuth.</li>
              <li>Synchronize your study data across multiple devices.</li>
              <li>Provide and maintain the Focus Mode functionality.</li>
              <li>Send you study reminders (if enabled).</li>
            </ul>
          </section>

          <section>
            <h2 className="text-2xl font-bold text-white mb-4">4. Sharing Your Information</h2>
            <p>
              We only share information with your consent, to comply with laws, to provide you with services, to protect your rights, or to fulfill business obligations. We use Supabase for backend services and Google for authentication.
            </p>
          </section>

          <section>
            <h2 className="text-2xl font-bold text-white mb-4">5. Data Retention</h2>
            <p>
              We keep your information for as long as necessary to fulfill the purposes outlined in this privacy policy unless otherwise required by law.
            </p>
          </section>

          <section>
            <h2 className="text-2xl font-bold text-white mb-4">6. Security</h2>
            <p>
              We aim to protect your personal information through a system of organizational and technical security measures provided by our infrastructure partners (Supabase).
            </p>
          </section>

          <section>
            <h2 className="text-2xl font-bold text-white mb-4">7. Contact Us</h2>
            <p>
              If you have questions or comments about this policy, you may email us at support@nemia.app.
            </p>
          </section>
        </div>
      </div>
    </div>
  );
};

export default PrivacyPolicy;


