import { type Lang } from "@/lib/config";

export interface Message {
  id: string;
  sender: "customer" | "ai";
  text: string;
  time: string;
  typing?: boolean;
}

export const conversations: Record<
  Lang,
  { title: string; messages: Message[] }[]
> = {
  en: [
    {
      title: "Medical Appointment",
      messages: [
        {
          id: "1",
          sender: "customer",
          text: `Hi, I need to book an appointment with Dr. Sarah`,
          time: "10:02 AM",
        },
        {
          id: "2",
          sender: "ai",
          text: `Hello! I'd be happy to help you book an appointment with Dr. Sarah. 👋`,
          time: "10:02 AM",
        },
        {
          id: "3",
          sender: "ai",
          text: `I can see the following slots available this week:
📅 Tomorrow 2:30 PM
📅 Thursday 10:00 AM
📅 Friday 4:00 PM

Which works best for you?`,
          time: "10:02 AM",
        },
        {
          id: "4",
          sender: "customer",
          text: `Thursday 10am please`,
          time: "10:03 AM",
        },
        {
          id: "5",
          sender: "ai",
          text: `Perfect! I've reserved Thursday at 10:00 AM for you. To confirm your booking, I'll need a 50 SAR deposit.`,
          time: "10:03 AM",
        },
        {
          id: "6",
          sender: "ai",
          text: `💳 Click here to pay securely: [Payment Link]
✅ Accepts Mada, Apple Pay & Visa`,
          time: "10:03 AM",
        },
      ],
    },
    {
      title: "Real Estate Viewing",
      messages: [
        {
          id: "1",
          sender: "customer",
          text: `I want to view the 3BR apartment in Riyadh`,
          time: "2:15 PM",
        },
        {
          id: "2",
          sender: "ai",
          text: `Great choice! I can arrange a viewing for the 3BR apartment in Al Olaya. 🏢`,
          time: "2:15 PM",
        },
        {
          id: "3",
          sender: "ai",
          text: `Available viewing times:
🕒 Today 5:00 PM
🕒 Tomorrow 11:00 AM
🕒 Tomorrow 3:00 PM`,
          time: "2:15 PM",
        },
        {
          id: "4",
          sender: "customer",
          text: `Today 5pm works`,
          time: "2:16 PM",
        },
        {
          id: "5",
          sender: "ai",
          text: `Excellent! Before I confirm, please upload your ID for verification:`,
          time: "2:16 PM",
        },
        {
          id: "6",
          sender: "ai",
          text: `📎 Secure upload link: [Upload Documents]
🔒 Your data is encrypted and safe`,
          time: "2:16 PM",
        },
      ],
    },
    {
      title: "Maintenance Request",
      messages: [
        {
          id: "1",
          sender: "customer",
          text: `AC is not working in unit 405`,
          time: "8:30 AM",
        },
        {
          id: "2",
          sender: "ai",
          text: `I'm sorry to hear about the AC issue in unit 405. Let me help you right away! 🔧`,
          time: "8:30 AM",
        },
        {
          id: "3",
          sender: "ai",
          text: `Can you share a photo of the AC unit? This helps our technician prepare.`,
          time: "8:30 AM",
        },
        {
          id: "4",
          sender: "customer",
          text: `[Photo attached]`,
          time: "8:31 AM",
        },
        {
          id: "5",
          sender: "ai",
          text: `Thank you! I can send a technician:
⚡ Emergency (2 hours) - 150 SAR
🔧 Today (4-6 PM) - 100 SAR
📅 Tomorrow morning - 80 SAR`,
          time: "8:31 AM",
        },
        {
          id: "6",
          sender: "ai",
          text: `Which option would you prefer?`,
          time: "8:31 AM",
        },
      ],
    },
    {
      title: "Salon Appointment",
      messages: [
        {
          id: "1",
          sender: "customer",
          text: `I need to book a hair appointment for tomorrow`,
          time: "11:15 AM",
        },
        {
          id: "2",
          sender: "ai",
          text: `Hello! I'll help you book your hair appointment. 💇‍♀️`,
          time: "11:15 AM",
        },
        {
          id: "3",
          sender: "ai",
          text: `What service would you like?
✨ Haircut & Style - 120 SAR
🎨 Hair Color - 350 SAR
💆‍♀️ Hair Treatment - 200 SAR
✂️ Trim Only - 60 SAR`,
          time: "11:15 AM",
        },
        {
          id: "4",
          sender: "customer",
          text: `Haircut and style please`,
          time: "11:16 AM",
        },
        {
          id: "5",
          sender: "ai",
          text: `Great choice! Available times tomorrow:
⏰ 9:00 AM with Sara
⏰ 2:30 PM with Maya
⏰ 5:00 PM with Lina

Which stylist and time do you prefer?`,
          time: "11:16 AM",
        },
        {
          id: "6",
          sender: "customer",
          text: `2:30 PM with Maya`,
          time: "11:17 AM",
        },
        {
          id: "7",
          sender: "ai",
          text: `Perfect! Booked with Maya at 2:30 PM tomorrow.
💳 Total: 120 SAR
📍 Location: [Salon Address]

Pay now to confirm: [Payment Link]`,
          time: "11:17 AM",
        },
      ],
    },
    {
      title: "Restaurant Order",
      messages: [
        {
          id: "1",
          sender: "customer",
          text: `I want to order food for delivery`,
          time: "7:45 PM",
        },
        {
          id: "2",
          sender: "ai",
          text: `Welcome to Quick Bites! 🍔 What would you like to order today?`,
          time: "7:45 PM",
        },
        {
          id: "3",
          sender: "customer",
          text: `Show me your burgers menu`,
          time: "7:45 PM",
        },
        {
          id: "4",
          sender: "ai",
          text: `🍔 Our Burger Menu:
• Classic Beef - 45 SAR
• Cheese Burger - 50 SAR
• Mushroom Swiss - 55 SAR
• Spicy Jalapeño - 52 SAR

All served with fries! What would you like?`,
          time: "7:46 PM",
        },
        {
          id: "5",
          sender: "customer",
          text: `2 cheese burgers and 1 classic`,
          time: "7:46 PM",
        },
        {
          id: "6",
          sender: "ai",
          text: `Great! Your order:
• 2x Cheese Burger = 100 SAR
• 1x Classic Beef = 45 SAR
📦 Delivery fee = 10 SAR

Total: 155 SAR

📍 Confirm delivery address?`,
          time: "7:46 PM",
        },
        {
          id: "7",
          sender: "customer",
          text: `Yes, Building 5, Apartment 12, Al Olaya`,
          time: "7:47 PM",
        },
        {
          id: "8",
          sender: "ai",
          text: `✅ Order confirmed!
🚗 Delivery time: 30-40 minutes
💳 Pay on delivery or pay now: [Payment Link]

Track your order: [Tracking Link]`,
          time: "7:47 PM",
        },
      ],
    },
    {
      title: "School Fees",
      messages: [
        {
          id: "1",
          sender: "customer",
          text: `I need to pay my daughter's school fees`,
          time: "9:00 AM",
        },
        {
          id: "2",
          sender: "ai",
          text: `I'll help you with the school fee payment. 📚 What's your daughter's student ID?`,
          time: "9:00 AM",
        },
        {
          id: "3",
          sender: "customer",
          text: `Student ID is 2024-1156`,
          time: "9:01 AM",
        },
        {
          id: "4",
          sender: "ai",
          text: `Found it! Student: Sara Ahmed
🏫 Grade 7 - International School

📋 Outstanding fees:
• Term 2 Tuition: 8,500 SAR
• Bus Service: 1,200 SAR
• Books & Materials: 800 SAR

Total Due: 10,500 SAR`,
          time: "9:01 AM",
        },
        {
          id: "5",
          sender: "customer",
          text: `Can I pay in installments?`,
          time: "9:02 AM",
        },
        {
          id: "6",
          sender: "ai",
          text: `Yes! Installment options:

1️⃣ 2 payments: 5,250 SAR each
2️⃣ 3 payments: 3,500 SAR each
3️⃣ Pay full now and get 3% discount = 10,185 SAR

Which option works for you?`,
          time: "9:02 AM",
        },
        {
          id: "7",
          sender: "customer",
          text: `I'll take the 3 payment plan`,
          time: "9:03 AM",
        },
        {
          id: "8",
          sender: "ai",
          text: `✅ Payment plan activated!

📅 Schedule:
• 1st payment (Today): 3,500 SAR - [Pay Now]
• 2nd payment (Feb 1): 3,500 SAR
• 3rd payment (Mar 1): 3,500 SAR

📧 Receipt will be sent to your email`,
          time: "9:03 AM",
        },
      ],
    },
    {
      title: "Repair Service",
      messages: [
        {
          id: "1",
          sender: "customer",
          text: `My washing machine is leaking water`,
          time: "3:30 PM",
        },
        {
          id: "2",
          sender: "ai",
          text: `I'll help you book a repair technician right away! 🔧 Can you tell me the brand of your washing machine?`,
          time: "3:30 PM",
        },
        {
          id: "3",
          sender: "customer",
          text: `It's a Samsung front loader`,
          time: "3:31 PM",
        },
        {
          id: "4",
          sender: "ai",
          text: `Got it! For Samsung washing machines, I have specialized technicians available.

🔍 To help diagnose: Is the leak from:
• Bottom of machine
• Door seal
• Back connections
• Not sure`,
          time: "3:31 PM",
        },
        {
          id: "5",
          sender: "customer",
          text: `From the bottom I think`,
          time: "3:32 PM",
        },
        {
          id: "6",
          sender: "ai",
          text: `Likely a pump or hose issue. Available service slots:

⚡ Emergency (2 hrs): 250 SAR + parts
🔧 Today (5-7 PM): 180 SAR + parts
📅 Tomorrow AM: 150 SAR + parts

✅ All include free diagnosis`,
          time: "3:32 PM",
        },
        {
          id: "7",
          sender: "customer",
          text: `Today 5-7 PM please`,
          time: "3:33 PM",
        },
        {
          id: "8",
          sender: "ai",
          text: `✅ Technician booked!

🔧 Ahmed (4.8⭐, 500+ repairs)
⏰ Today 5:00-7:00 PM
💰 Service: 180 SAR (pay after service)

📱 He'll call 30 min before arrival
🆔 Tech ID: #TEC-4521 for verification`,
          time: "3:33 PM",
        },
      ],
    },
  ],
  ar: [
    {
      title: "حجز طبي",
      messages: [
        {
          id: "1",
          sender: "customer",
          text: `السلام عليكم، أريد حجز موعد مع د. سارة`,
          time: "10:02 ص",
        },
        {
          id: "2",
          sender: "ai",
          text: `وعليكم السلام! يسعدني مساعدتك في حجز موعد مع د. سارة 👋`,
          time: "10:02 ص",
        },
        {
          id: "3",
          sender: "ai",
          text: `المواعيد المتاحة هذا الأسبوع:
📅 غداً 2:30 م
📅 الخميس 10:00 ص
📅 الجمعة 4:00 م

أي وقت يناسبك؟`,
          time: "10:02 ص",
        },
        {
          id: "4",
          sender: "customer",
          text: `الخميس الساعة 10 صباحاً`,
          time: "10:03 ص",
        },
        {
          id: "5",
          sender: "ai",
          text: `ممتاز! حجزت لك الخميس الساعة 10:00 ص. لتأكيد الحجز، نحتاج عربون 50 ريال.`,
          time: "10:03 ص",
        },
        {
          id: "6",
          sender: "ai",
          text: `💳 اضغط هنا للدفع الآمن: [رابط الدفع]
✅ يقبل مدى وآبل باي وفيزا`,
          time: "10:03 ص",
        },
      ],
    },
    {
      title: "معاينة عقار",
      messages: [
        {
          id: "1",
          sender: "customer",
          text: `أريد معاينة الشقة 3 غرف في الرياض`,
          time: "2:15 م",
        },
        {
          id: "2",
          sender: "ai",
          text: `اختيار موفق! يمكنني ترتيب معاينة للشقة 3 غرف في العليا 🏢`,
          time: "2:15 م",
        },
        {
          id: "3",
          sender: "ai",
          text: `أوقات المعاينة المتاحة:
🕒 اليوم 5:00 م
🕒 غداً 11:00 ص
🕒 غداً 3:00 م`,
          time: "2:15 م",
        },
        {
          id: "4",
          sender: "customer",
          text: `اليوم الساعة 5 مساءً`,
          time: "2:16 م",
        },
        {
          id: "5",
          sender: "ai",
          text: `ممتاز! قبل التأكيد، الرجاء رفع الهوية للتحقق:`,
          time: "2:16 م",
        },
        {
          id: "6",
          sender: "ai",
          text: `📎 رابط الرفع الآمن: [رفع المستندات]
🔒 بياناتك مشفرة وآمنة`,
          time: "2:16 م",
        },
      ],
    },
    {
      title: "طلب صيانة",
      messages: [
        {
          id: "1",
          sender: "customer",
          text: `المكيف لا يعمل في الوحدة 405`,
          time: "8:30 ص",
        },
        {
          id: "2",
          sender: "ai",
          text: `آسف لسماع مشكلة المكيف في الوحدة 405. دعني أساعدك فوراً! 🔧`,
          time: "8:30 ص",
        },
        {
          id: "3",
          sender: "ai",
          text: `هل يمكنك مشاركة صورة للمكيف؟ هذا يساعد الفني على الاستعداد.`,
          time: "8:30 ص",
        },
        {
          id: "4",
          sender: "customer",
          text: `[صورة مرفقة]", time: "8:31 ص" },
        {
          id: "5",
          sender: "ai",
          text: "شكراً! يمكنني إرسال فني:
⚡ طوارئ (ساعتين) - 150 ريال
🔧 اليوم (4-6 م) - 100 ريال
📅 غداً صباحاً - 80 ريال`,
          time: "8:31 ص",
        },
        {
          id: "6",
          sender: "ai",
          text: `أي خيار تفضل؟", time: "8:31 ص" },
      ],
    },
    {
      title: "موعد صالون",
      messages: [
        {
          id: "1",
          sender: "customer",
          text: "أريد حجز موعد للشعر غداً`,
          time: "11:15 ص",
        },
        {
          id: "2",
          sender: "ai",
          text: `أهلاً! سأساعدك في حجز موعد الشعر 💇‍♀️`,
          time: "11:15 ص",
        },
        {
          id: "3",
          sender: "ai",
          text: `ما الخدمة التي تريدينها؟
✨ قص وتسريحة - 120 ريال
🎨 صبغة شعر - 350 ريال
💆‍♀️ علاج الشعر - 200 ريال
✂️ قص أطراف فقط - 60 ريال`,
          time: "11:15 ص",
        },
        {
          id: "4",
          sender: "customer",
          text: `قص وتسريحة من فضلك`,
          time: "11:16 ص",
        },
        {
          id: "5",
          sender: "ai",
          text: `ممتاز! المواعيد المتاحة غداً:
⏰ 9:00 ص مع سارة
⏰ 2:30 م مع مايا
⏰ 5:00 م مع لينا

أي مصففة ووقت تفضلين؟`,
          time: "11:16 ص",
        },
        {
          id: "6",
          sender: "customer",
          text: `2:30 م مع مايا`,
          time: "11:17 ص",
        },
        {
          id: "7",
          sender: "ai",
          text: `رائع! تم الحجز مع مايا الساعة 2:30 م غداً.
💳 المجموع: 120 ريال
📍 الموقع: [عنوان الصالون]

ادفعي الآن للتأكيد: [رابط الدفع]`,
          time: "11:17 ص",
        },
      ],
    },
    {
      title: "طلب مطعم",
      messages: [
        {
          id: "1",
          sender: "customer",
          text: `أريد طلب توصيل طعام`,
          time: "7:45 م",
        },
        {
          id: "2",
          sender: "ai",
          text: `مرحباً بك في كويك بايتس! 🍔 ماذا تريد أن تطلب اليوم؟`,
          time: "7:45 م",
        },
        {
          id: "3",
          sender: "customer",
          text: `أريد قائمة البرجر`,
          time: "7:45 م",
        },
        {
          id: "4",
          sender: "ai",
          text: `🍔 قائمة البرجر:
• كلاسيك لحم - 45 ريال
• تشيز برجر - 50 ريال
• سويس مشروم - 55 ريال
• حار بالهلابينو - 52 ريال

الكل يقدم مع البطاطس! ماذا تريد؟`,
          time: "7:46 م",
        },
        {
          id: "5",
          sender: "customer",
          text: `2 تشيز برجر و1 كلاسيك`,
          time: "7:46 م",
        },
        {
          id: "6",
          sender: "ai",
          text: `ممتاز! طلبك:
• 2× تشيز برجر = 100 ريال
• 1× كلاسيك لحم = 45 ريال
📦 رسوم التوصيل = 10 ريال

المجموع: 155 ريال

📍 تأكيد عنوان التوصيل؟`,
          time: "7:46 م",
        },
        {
          id: "7",
          sender: "customer",
          text: `نعم، مبنى 5، شقة 12، العليا`,
          time: "7:47 م",
        },
        {
          id: "8",
          sender: "ai",
          text: `✅ تم تأكيد الطلب!
🚗 وقت التوصيل: 30-40 دقيقة
💳 الدفع عند التوصيل أو ادفع الآن: [رابط الدفع]

تتبع طلبك: [رابط التتبع]`,
          time: "7:47 م",
        },
      ],
    },
    {
      title: "رسوم مدرسية",
      messages: [
        {
          id: "1",
          sender: "customer",
          text: `أريد دفع الرسوم المدرسية لابنتي`,
          time: "9:00 ص",
        },
        {
          id: "2",
          sender: "ai",
          text: `سأساعدك في دفع الرسوم المدرسية. 📚 ما رقم الطالب لابنتك؟`,
          time: "9:00 ص",
        },
        {
          id: "3",
          sender: "customer",
          text: `رقم الطالب 2024-1156`,
          time: "9:01 ص",
        },
        {
          id: "4",
          sender: "ai",
          text: `وجدتها! الطالبة: سارة أحمد
🏫 الصف السابع - المدرسة الدولية

📋 الرسوم المستحقة:
• رسوم الفصل الثاني: 8,500 ريال
• خدمة الباص: 1,200 ريال
• الكتب والمواد: 800 ريال

المجموع المستحق: 10,500 ريال`,
          time: "9:01 ص",
        },
        {
          id: "5",
          sender: "customer",
          text: `هل يمكن الدفع بالأقساط؟`,
          time: "9:02 ص",
        },
        {
          id: "6",
          sender: "ai",
          text: `نعم! خيارات الأقساط:

1️⃣ دفعتان: 5,250 ريال لكل دفعة
2️⃣ 3 دفعات: 3,500 ريال لكل دفعة
3️⃣ ادفع الآن كاملاً واحصل على خصم 3% = 10,185 ريال

أي خيار يناسبك؟`,
          time: "9:02 ص",
        },
        {
          id: "7",
          sender: "customer",
          text: `سآخذ خطة 3 دفعات`,
          time: "9:03 ص",
        },
        {
          id: "8",
          sender: "ai",
          text: `✅ تم تفعيل خطة الدفع!

📅 الجدول:
• الدفعة الأولى (اليوم): 3,500 ريال - [ادفع الآن]
• الدفعة الثانية (1 فبراير): 3,500 ريال
• الدفعة الثالثة (1 مارس): 3,500 ريال

📧 سيتم إرسال الإيصال لبريدك الإلكتروني`,
          time: "9:03 ص",
        },
      ],
    },
    {
      title: "خدمة إصلاح",
      messages: [
        {
          id: "1",
          sender: "customer",
          text: `الغسالة تسرب الماء`,
          time: "3:30 م",
        },
        {
          id: "2",
          sender: "ai",
          text: `سأساعدك في حجز فني إصلاح فوراً! 🔧 ما هي ماركة الغسالة؟`,
          time: "3:30 م",
        },
        {
          id: "3",
          sender: "customer",
          text: `سامسونج أمامية التحميل`,
          time: "3:31 م",
        },
        {
          id: "4",
          sender: "ai",
          text: `فهمت! لغسالات سامسونج، لدي فنيون متخصصون.

🔍 للمساعدة في التشخيص: التسريب من:
• أسفل الآلة
• باب الغسالة
• التوصيلات الخلفية
• غير متأكد`,
          time: "3:31 م",
        },
        {
          id: "5",
          sender: "customer",
          text: `من الأسفل أعتقد`,
          time: "3:32 م",
        },
        {
          id: "6",
          sender: "ai",
          text: `غالباً مشكلة في المضخة أو الخرطوم. المواعيد المتاحة:

⚡ طوارئ (ساعتين): 250 ريال + القطع
🔧 اليوم (5-7 م): 180 ريال + القطع
📅 غداً صباحاً: 150 ريال + القطع

✅ الكل يشمل الفحص المجاني`,
          time: "3:32 م",
        },
        {
          id: "7",
          sender: "customer",
          text: `اليوم 5-7 مساء من فضلك`,
          time: "3:33 م",
        },
        {
          id: "8",
          sender: "ai",
          text: `✅ تم حجز الفني!

🔧 أحمد (4.8⭐، 500+ إصلاح)
⏰ اليوم 5:00-7:00 م
💰 الخدمة: 180 ريال (ادفع بعد الخدمة)

📱 سيتصل قبل 30 دقيقة من الوصول
🆔 رقم الفني: #TEC-4521 للتحقق`,
          time: "3:33 م",
        },
      ],
    },
  ],
};
