import type { Language } from "@/lib/i18n/config";

export type LegalDocumentType = "terms" | "privacy";

export interface LegalSection {
  heading: string;
  body: string;
}

export interface LegalDocument {
  title: string;
  sections: LegalSection[];
}

/** ISO date of the last revision — rendered localized in the dialog header. */
export const LEGAL_LAST_UPDATED = "2026-07-16";

/**
 * Placeholder legal copy for the Washy marketplace.
 * NOTE: have this reviewed/replaced by legal counsel before launch.
 */
export const LEGAL_CONTENT: Record<
  Language,
  Record<LegalDocumentType, LegalDocument>
> = {
  en: {
    terms: {
      title: "Terms & Conditions",
      sections: [
        {
          heading: "Acceptance of Terms",
          body: 'By accessing or using the Washy application (the "Service"), you agree to be bound by these Terms & Conditions. If you do not agree to any part of these terms, please do not use the Service.',
        },
        {
          heading: "About the Service",
          body: "Washy is a marketplace that connects customers with independent mobile car wash providers. Washy facilitates booking and payment but does not perform the washing services itself; these are carried out by third-party providers.",
        },
        {
          heading: "User Accounts",
          body: "You must provide accurate and complete information when creating an account and keep it up to date. You are responsible for safeguarding your sign-in credentials and for all activity that occurs under your account.",
        },
        {
          heading: "Bookings & Payments",
          body: "Service prices are displayed before you confirm a booking. Payment is processed through the payment methods available in the app. All amounts are shown in Saudi Riyals (SAR) and include applicable VAT unless stated otherwise.",
        },
        {
          heading: "Cancellations & Refunds",
          body: "You may cancel a booking before the provider begins the service. A cancellation fee may apply in accordance with the cancellation policy shown at the time of booking, and refunds are returned to the original payment method.",
        },
        {
          heading: "User Responsibilities",
          body: "You agree to provide safe and lawful access to the vehicle's location, to supply accurate information, and not to misuse the Service or use it for any unlawful purpose.",
        },
        {
          heading: "Service Providers",
          body: "Providers are independent contractors and are not employees or agents of Washy. While we take care in verifying providers, Washy is not liable for their acts or omissions to the maximum extent permitted by law.",
        },
        {
          heading: "Limitation of Liability",
          body: 'The Service is provided "as is" without warranties of any kind. To the maximum extent permitted by law, Washy shall not be liable for any indirect, incidental, or consequential damages arising from your use of the Service.',
        },
        {
          heading: "Changes to These Terms",
          body: "We may update these terms from time to time. We will notify you of material changes within the app, and your continued use of the Service after changes take effect constitutes acceptance of the updated terms.",
        },
        {
          heading: "Governing Law",
          body: "These terms are governed by and construed in accordance with the laws of the Kingdom of Saudi Arabia.",
        },
        {
          heading: "Contact Us",
          body: "If you have any questions about these terms, contact us at support@washy.app.",
        },
      ],
    },
    privacy: {
      title: "Privacy Policy",
      sections: [
        {
          heading: "Information We Collect",
          body: "We collect account information (name, email, phone number), vehicle and location details, booking history, and device and usage data. Payment details are processed by secure third-party payment providers; we do not store full card numbers.",
        },
        {
          heading: "How We Use Your Information",
          body: "We use your information to provide and improve the Service, process bookings and payments, communicate with you (such as OTP codes and booking confirmations), keep the platform safe, prevent fraud, and comply with legal obligations.",
        },
        {
          heading: "Information Sharing",
          body: "We share with the provider only what is needed to fulfill your booking (such as your name, location, and vehicle details), and with payment processors. We do not sell your personal data. We may disclose data to competent authorities where legally required.",
        },
        {
          heading: "Data Security",
          body: "We apply appropriate technical and organizational measures to protect your data, including encryption in transit and access controls. However, no method of transmission or storage is 100% secure.",
        },
        {
          heading: "Data Retention",
          body: "We retain your data for as long as your account is active or as required by applicable law, after which it is deleted or anonymized.",
        },
        {
          heading: "Your Rights",
          body: "You may request access to, correction of, or deletion of your personal data, and you may withdraw your consent at any time. To exercise your rights, contact us using the email below.",
        },
        {
          heading: "Cookies & Similar Technologies",
          body: "We use cookies and similar technologies to manage sessions, remember your preferences (such as language), and analyze usage to improve the app.",
        },
        {
          heading: "Changes to This Policy",
          body: "We may update this policy from time to time. The updated version will be published here along with its last-updated date.",
        },
        {
          heading: "Contact Us",
          body: "For any privacy-related enquiries, contact us at privacy@washy.app.",
        },
      ],
    },
  },
  ar: {
    terms: {
      title: "الشروط والأحكام",
      sections: [
        {
          heading: "قبول الشروط",
          body: "باستخدامك تطبيق واشي («الخدمة»)، فإنك توافق على الالتزام بهذه الشروط والأحكام. إذا كنت لا توافق على أي جزء من هذه الشروط، يُرجى عدم استخدام الخدمة.",
        },
        {
          heading: "عن الخدمة",
          body: "واشي هو سوق إلكتروني يربط العملاء بمزوّدي خدمات غسيل السيارات المتنقلين المستقلين. يُسهّل واشي عمليات الحجز والدفع، لكنه لا يقدّم خدمات الغسيل بنفسه؛ إذ يقوم بها مزوّدو خدمات من أطراف ثالثة.",
        },
        {
          heading: "حسابات المستخدمين",
          body: "يجب عليك تقديم معلومات دقيقة وكاملة عند إنشاء الحساب والحفاظ على تحديثها. أنت مسؤول عن حماية بيانات تسجيل الدخول الخاصة بك وعن جميع الأنشطة التي تتم من خلال حسابك.",
        },
        {
          heading: "الحجوزات والمدفوعات",
          body: "تُعرض أسعار الخدمات قبل تأكيد الحجز. تتم معالجة الدفع عبر وسائل الدفع المتاحة في التطبيق. جميع المبالغ معروضة بالريال السعودي وتشمل ضريبة القيمة المضافة ما لم يُذكر خلاف ذلك.",
        },
        {
          heading: "الإلغاء والاسترداد",
          body: "يمكنك إلغاء الحجز قبل بدء مزوّد الخدمة في تنفيذه. قد تُطبَّق رسوم إلغاء وفقاً لسياسة الإلغاء الموضحة عند الحجز، وتُعاد المبالغ المستردة إلى وسيلة الدفع الأصلية.",
        },
        {
          heading: "مسؤوليات المستخدم",
          body: "توافق على توفير وصول آمن وقانوني إلى موقع المركبة، وتقديم معلومات صحيحة، وعدم إساءة استخدام الخدمة أو استخدامها لأي غرض غير مشروع.",
        },
        {
          heading: "مزوّدو الخدمة",
          body: "مزوّدو الخدمة متعاقدون مستقلون وليسوا موظفين أو وكلاء لدى واشي. ورغم حرصنا على التحقق من المزوّدين، فإن واشي غير مسؤول عن أفعالهم أو تقصيرهم إلى الحد الأقصى الذي يسمح به النظام.",
        },
        {
          heading: "حدود المسؤولية",
          body: "تُقدَّم الخدمة «كما هي» دون أي ضمانات من أي نوع. لا يتحمّل واشي المسؤولية عن أي أضرار غير مباشرة أو عرضية أو تبعية تنشأ عن استخدامك للخدمة، إلى الحد الأقصى الذي يسمح به النظام.",
        },
        {
          heading: "تعديل الشروط",
          body: "قد نقوم بتحديث هذه الشروط من وقت لآخر. سنخطرك بالتغييرات الجوهرية داخل التطبيق، ويُعد استمرارك في استخدام الخدمة بعد سريان التعديلات موافقةً عليها.",
        },
        {
          heading: "القانون الواجب التطبيق",
          body: "تخضع هذه الشروط وتُفسَّر وفقاً لأنظمة المملكة العربية السعودية.",
        },
        {
          heading: "تواصل معنا",
          body: "إذا كانت لديك أي أسئلة حول هذه الشروط، يمكنك التواصل معنا عبر البريد الإلكتروني: support@washy.app",
        },
      ],
    },
    privacy: {
      title: "سياسة الخصوصية",
      sections: [
        {
          heading: "المعلومات التي نجمعها",
          body: "نجمع معلومات الحساب (الاسم والبريد الإلكتروني ورقم الجوال)، وتفاصيل المركبة والموقع، وسجلّ الحجوزات، وبيانات الجهاز والاستخدام. تتم معالجة بيانات الدفع عبر مزوّدي دفع آمنين من أطراف ثالثة، ولا نخزّن أرقام البطاقات كاملة.",
        },
        {
          heading: "كيف نستخدم معلوماتك",
          body: "نستخدم معلوماتك لتقديم الخدمة وتحسينها، ومعالجة الحجوزات والمدفوعات، والتواصل معك (مثل رموز التحقق وتأكيدات الحجز)، وضمان الأمان ومنع الاحتيال، والامتثال للمتطلبات النظامية.",
        },
        {
          heading: "مشاركة المعلومات",
          body: "نشارك مع مزوّد الخدمة ما يلزم لتنفيذ الحجز فقط (مثل اسمك وموقعك وتفاصيل مركبتك)، ومع مزوّدي معالجة المدفوعات. لا نبيع بياناتك الشخصية، وقد نفصح عنها للجهات المختصة عند طلبها نظاماً.",
        },
        {
          heading: "أمان البيانات",
          body: "نطبّق تدابير تقنية وتنظيمية مناسبة لحماية بياناتك، بما في ذلك التشفير أثناء النقل وضوابط الوصول. ومع ذلك، لا توجد وسيلة نقل أو تخزين آمنة بنسبة 100٪.",
        },
        {
          heading: "الاحتفاظ بالبيانات",
          body: "نحتفظ ببياناتك طوال مدة نشاط حسابك أو حسبما تقتضيه الأنظمة، ثم نحذفها أو نجعلها مجهولة الهوية.",
        },
        {
          heading: "حقوقك",
          body: "يحق لك طلب الوصول إلى بياناتك الشخصية أو تصحيحها أو حذفها، وسحب موافقتك في أي وقت. للتواصل بشأن حقوقك، راسلنا عبر البريد الإلكتروني أدناه.",
        },
        {
          heading: "ملفات تعريف الارتباط والتقنيات المشابهة",
          body: "نستخدم ملفات تعريف الارتباط وتقنيات مشابهة لإدارة الجلسات وحفظ تفضيلاتك (مثل اللغة) وتحليل الاستخدام لتحسين التطبيق.",
        },
        {
          heading: "تعديل هذه السياسة",
          body: "قد نحدّث هذه السياسة من وقت لآخر، وسننشر النسخة المحدّثة هنا مع تاريخ آخر تحديث.",
        },
        {
          heading: "تواصل معنا",
          body: "لأي استفسارات تتعلق بالخصوصية، تواصل معنا عبر البريد الإلكتروني: privacy@washy.app",
        },
      ],
    },
  },
};
