import type { SellerProfile } from "./types";

export const MOCK_SELLER: SellerProfile = {
  id: "seller-001",
  slug: "rahul-electronics",
  name: "Rahul's Electronics Hub",
  avatar: "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=200&h=200&fit=crop&q=80",
  coverImage: "https://images.unsplash.com/photo-1518770660439-4636190af475?w=1200&h=400&fit=crop&q=80",
  bio: "Passionate electronics enthusiast and trusted seller with 4+ years of experience. I specialize in pre-owned Apple products, Samsung flagships, and high-end audio gear. Every item is thoroughly tested and accurately described.",
  businessDescription:
    "Rahul's Electronics Hub is your trusted marketplace destination for quality pre-owned electronics. We source from verified channels, test every device, and offer a 7-day return policy. Customer satisfaction is our #1 priority — every sale is backed by our personal guarantee.",
  languages: ["English", "Hindi", "Gujarati"],
  specialization: ["Apple Devices", "Android Flagships", "Audio Equipment", "Laptops"],
  experience: "4+ years in electronics reselling",
  location: "Mumbai, Maharashtra",
  joinDate: "2022-03-15",
  isFollowing: false,
  trustScore: 94,
  stats: {
    activeListings: 24,
    productsSold: 347,
    followers: 892,
    completedOrders: 312,
    averageRating: 4.8,
    positiveReviewsPercent: 96,
    responseRate: 98,
    yearsOnMarketplace: 4,
    totalReviews: 187,
    responseTime: "Within 1 hour",
  },
  ratingDistribution: { 5: 142, 4: 31, 3: 9, 2: 3, 1: 2 },
  verifications: [
    { id: "v1", label: "Email Verified", description: "Email address confirmed", status: "verified", date: "2022-03-15" },
    { id: "v2", label: "Phone Verified", description: "Mobile number verified via OTP", status: "verified", date: "2022-03-16" },
    { id: "v3", label: "KYC Verified", description: "Know Your Customer check completed", status: "verified", date: "2022-04-02" },
    { id: "v4", label: "Identity Verified", description: "Government ID verified", status: "verified", date: "2022-04-05" },
    { id: "v5", label: "Trusted Seller", description: "Earned Trusted Seller status", status: "verified", date: "2023-01-10" },
    { id: "v6", label: "Premium Seller", description: "Premium membership active", status: "verified", date: "2024-06-01" },
  ],
  achievements: [
    { id: "a1", label: "Top Seller", description: "Among top 5% sellers this month", emoji: "🏆", earned: true, earnedAt: "2025-01-01", color: "#f0c040", bgColor: "rgba(240,192,64,0.12)" },
    { id: "a2", label: "Fast Responder", description: "Replies within 1 hour on average", emoji: "⚡", earned: true, earnedAt: "2023-06-01", color: "#60a5fa", bgColor: "rgba(96,165,250,0.12)" },
    { id: "a3", label: "Trusted Seller", description: "Verified identity and KYC complete", emoji: "🛡️", earned: true, earnedAt: "2022-04-05", color: "#34d399", bgColor: "rgba(52,211,153,0.12)" },
    { id: "a4", label: "100+ Sales", description: "Completed over 100 successful orders", emoji: "🎯", earned: true, earnedAt: "2023-09-15", color: "#fb923c", bgColor: "rgba(251,146,60,0.12)" },
    { id: "a5", label: "Highly Rated", description: "Maintained 4.5+ rating for 6+ months", emoji: "⭐", earned: true, earnedAt: "2024-01-20", color: "#f472b6", bgColor: "rgba(244,114,182,0.12)" },
    { id: "a6", label: "Premium Member", description: "Active premium subscription", emoji: "💎", earned: true, earnedAt: "2024-06-01", color: "#a78bfa", bgColor: "rgba(167,139,250,0.12)" },
    { id: "a7", label: "300+ Sales", description: "Completed over 300 successful orders", emoji: "🚀", earned: true, earnedAt: "2025-06-01", color: "#22d3ee", bgColor: "rgba(34,211,238,0.12)" },
    { id: "a8", label: "Perfect Responder", description: "100% response rate for 30 days", emoji: "💬", earned: false, color: "#6b7280", bgColor: "rgba(107,114,128,0.08)" },
  ],
  timeline: [
    { id: "t1", label: "Joined Marketplace", description: "Started the journey as a seller", date: "2022-03-15", achieved: true },
    { id: "t2", label: "First Sale", description: "Completed the very first successful order", date: "2022-03-28", achieved: true },
    { id: "t3", label: "100 Orders", description: "Reached 100 completed orders milestone", date: "2023-09-15", achieved: true },
    { id: "t4", label: "Verified Seller", description: "Completed identity verification and KYC", date: "2022-04-05", achieved: true },
    { id: "t5", label: "Top Rated Seller", description: "Achieved Top Rated Seller status", date: "2024-01-20", achieved: true },
    { id: "t6", label: "Premium Seller", description: "Upgraded to Premium Seller membership", date: "2024-06-01", achieved: true },
    { id: "t7", label: "500 Orders", description: "Next milestone — 500 completed orders", date: "2026-12-31", achieved: false },
  ],
  reviews: [
    {
      id: "r1", buyerId: "b1", buyerName: "Priya Sharma",
      buyerAvatar: "https://images.unsplash.com/photo-1494790108755-2616b612b7c0?w=80&h=80&fit=crop&q=80",
      rating: 5, title: "Excellent seller, highly recommend!",
      text: "Got the iPhone 14 Pro in perfect condition. Exactly as described. Rahul was very helpful and responsive throughout. Fast shipping too! The device was pristine and came with all original accessories.",
      date: "2026-06-10", productId: "l1", productTitle: "iPhone 14 Pro 256GB",
      productImage: "https://images.unsplash.com/photo-1592750475338-74b7b21085ab?w=80&h=80&fit=crop&q=80",
      helpful: 24, verified: true,
    },
    {
      id: "r2", buyerId: "b2", buyerName: "Arjun Mehta",
      buyerAvatar: "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=80&h=80&fit=crop&q=80",
      rating: 5, title: "MacBook worked perfectly right out of the box",
      text: "Great experience! The MacBook Pro was in pristine condition, battery health at 92%. Seller even included the original box and all accessories. Will definitely buy again from this seller.",
      date: "2026-05-22", productId: "l2", productTitle: "MacBook Pro M2",
      productImage: "https://images.unsplash.com/photo-1496181133206-80ce9b88a853?w=80&h=80&fit=crop&q=80",
      helpful: 18, verified: true,
    },
    {
      id: "r3", buyerId: "b3", buyerName: "Meera Patel",
      buyerAvatar: "https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=80&h=80&fit=crop&q=80",
      rating: 4, title: "Good product, minor delay in shipping",
      text: "The Sony headphones sound amazing. Product condition was as described. Only minor issue was shipping took 2 extra days, but seller kept me updated throughout the process.",
      date: "2026-05-08", productId: "l4", productTitle: "Sony WH-1000XM5",
      productImage: "https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=80&h=80&fit=crop&q=80",
      helpful: 11, verified: true,
    },
    {
      id: "r4", buyerId: "b4", buyerName: "Vikram Singh",
      buyerAvatar: "https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=80&h=80&fit=crop&q=80",
      rating: 5, title: "Absolutely trustworthy — my 3rd purchase!",
      text: "This is my third purchase from Rahul's Electronics Hub. Every single time, the products have been exactly as described, well-packaged, and delivered on time. Real marketplace trust.",
      date: "2026-04-30", productId: "l3", productTitle: "Canon EOS R50",
      productImage: "https://images.unsplash.com/photo-1516035069371-29a1b244cc32?w=80&h=80&fit=crop&q=80",
      helpful: 32, verified: true,
    },
    {
      id: "r5", buyerId: "b5", buyerName: "Divya Nair",
      buyerAvatar: "https://images.unsplash.com/photo-1544005313-94ddf0286df2?w=80&h=80&fit=crop&q=80",
      rating: 5, title: "Smooth transaction, lightning-fast responses",
      text: "Bought the Apple Watch Ultra 2 and couldn't be happier. Rahul answered all my questions within minutes. The watch was sealed, genuine, and came with full warranty documentation.",
      date: "2026-04-15", productId: "l5", productTitle: "Apple Watch Ultra 2",
      productImage: "https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=80&h=80&fit=crop&q=80",
      helpful: 14, verified: true,
    },
    {
      id: "r6", buyerId: "b6", buyerName: "Rohan Kapoor",
      buyerAvatar: "https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=80&h=80&fit=crop&q=80",
      rating: 4, title: "Great deal, seller resolved minor issue professionally",
      text: "iPad Pro was a great deal overall. There was a tiny scratch not mentioned in the listing, but Rahul apologized and offered a partial refund immediately. Very professional handling.",
      date: "2026-03-20", productId: "l6", productTitle: "iPad Pro 12.9-inch M2",
      productImage: "https://images.unsplash.com/photo-1544244015-0df4b3ffc6b0?w=80&h=80&fit=crop&q=80",
      helpful: 7, verified: true,
    },
  ],
  listings: [
    { id: "l1", slug: "iphone-14-pro-256gb", title: "iPhone 14 Pro 256GB Space Black", price: 64999,
      image: "https://images.unsplash.com/photo-1592750475338-74b7b21085ab?w=400&h=300&fit=crop&q=80",
      location: "Mumbai", condition: "like_new", views: 1247, wishlisted: false, category: "Smartphones" },
    { id: "l2", slug: "macbook-pro-m2", title: "MacBook Pro 14\" M2 Pro 16GB/512GB", price: 149999,
      image: "https://images.unsplash.com/photo-1496181133206-80ce9b88a853?w=400&h=300&fit=crop&q=80",
      location: "Mumbai", condition: "like_new", views: 892, wishlisted: true, category: "Laptops" },
    { id: "l3", slug: "canon-eos-r50", title: "Canon EOS R50 + 18-45mm Kit Lens", price: 54999,
      image: "https://images.unsplash.com/photo-1516035069371-29a1b244cc32?w=400&h=300&fit=crop&q=80",
      location: "Mumbai", condition: "good", views: 534, wishlisted: false, category: "Cameras" },
    { id: "l4", slug: "sony-wh1000xm5", title: "Sony WH-1000XM5 Wireless Headphones", price: 24999,
      image: "https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=400&h=300&fit=crop&q=80",
      location: "Mumbai", condition: "new", views: 763, wishlisted: false, category: "Audio" },
    { id: "l5", slug: "apple-watch-ultra-2", title: "Apple Watch Ultra 2 49mm Titanium", price: 79999,
      image: "https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=400&h=300&fit=crop&q=80",
      location: "Mumbai", condition: "like_new", views: 445, wishlisted: false, category: "Wearables" },
    { id: "l6", slug: "ipad-pro-m2", title: "iPad Pro 12.9\" M2 WiFi 256GB Silver", price: 89999,
      image: "https://images.unsplash.com/photo-1544244015-0df4b3ffc6b0?w=400&h=300&fit=crop&q=80",
      location: "Mumbai", condition: "good", views: 328, wishlisted: false, category: "Tablets" },
  ],
};

export function formatPrice(amount: number): string {
  return `₹${amount.toLocaleString("en-IN")}`;
}

export function formatProfileDate(dateStr: string): string {
  const d = new Date(dateStr);
  return d.toLocaleDateString("en-IN", { day: "numeric", month: "short", year: "numeric" });
}

export function formatShortDate(dateStr: string): string {
  const d = new Date(dateStr);
  return d.toLocaleDateString("en-IN", { month: "short", year: "numeric" });
}

export function getConditionLabel(condition: string): string {
  const map: Record<string, string> = {
    new: "Brand New", like_new: "Like New", good: "Good", fair: "Fair", poor: "Poor",
  };
  return map[condition] ?? condition;
}

export function getConditionColor(condition: string): string {
  const map: Record<string, string> = {
    new: "#22c55e", like_new: "#60a5fa", good: "#f0c040", fair: "#fb923c", poor: "#f87171",
  };
  return map[condition] ?? "#6b7280";
}

export function getTrustScoreColor(score: number): string {
  if (score >= 80) return "#22c55e";
  if (score >= 60) return "#f0c040";
  return "#f87171";
}

export function getTrustScoreLabel(score: number): string {
  if (score >= 90) return "Excellent";
  if (score >= 80) return "Very Good";
  if (score >= 70) return "Good";
  if (score >= 60) return "Fair";
  return "Poor";
}
