export interface TrustBadgeItem {
  id: string;
  iconName: string;
  title: string;
  subtitle: string;
}

export interface ServiceCardItem {
  id: string;
  title: string;
  description: string;
  badge: string;
  href: string;
  iconName: string;
}

export interface WhyChooseUsItem {
  id: string;
  title: string;
  description: string;
}

/**
 * Sourced from real customer reviews (`JM_writers_review` — see
 * AGENTS.md "Category listing bridge"). That table has no customer name or
 * university field, only which writer was reviewed, so this reflects the
 * real shape rather than inventing a reviewer identity.
 */
export interface TestimonialItem {
  id: string;
  writerName: string;
  rating: number;
  comment: string;
  subject: string;
}

export interface CalculatorConfig {
  /**
   * Which `currency_values` row to price in. The live site picks this from
   * the visitor's IP; there's no geolocation here, so it's an env var
   * (`JOOMLA_PRICE_COUNTRY`), defaulting to the template's own no-country
   * fallback of United States / USD.
   */
  priceCountry: string;
  orderCtaUrl: string;
  /**
   * The live order form prefixes prices with `$_SESSION['order_currency']` —
   * the ISO code ("INR"), not the symbol — and the code is picked from the
   * visitor's country via the `currency_values` table.
   */
}

/**
 * One tab of the live `.slider-banner` carousel next to the homepage
 * calculator (real CMS content — the order-code banner, a "how we solve
 * your assignment" video, the grammar-checker promo, and a plain order
 * banner). `href`/`imageUrl` are real, already-resolved URLs from the home
 * article's own markup. `videoKey` is the raw token from the CMS's
 * `.videopart` `src` attribute (e.g. `"solve-my-assignment-new"`) —
 * `joomlaService` maps it to the closest real file under
 * `templates/GAH/videos/` (see `HERO_VIDEO_FILE_MAP`), since the CMS token
 * and the actual filename on disk differ by a dropped "-new"/"1" suffix.
 */
export interface HeroBannerSlide {
  href: string;
  imageUrl: string;
  alt: string;
  isVideo: boolean;
  videoUrl?: string;
}

export interface HomePageResponse {
  articleTitle?: string;
  articleContentHtml?: string;
  /**
   * Real CMS markup for the two banner slides (`.loading-home-banner` +
   * `.slider-banner`) that sit beside the calculator inside the live
   * `.slider-section` flex row. Pulled out of `articleContentHtml` because
   * that field is rendered through several separate `dangerouslySetInnerHTML`
   * calls (split around the `__HOME_CALCULATOR__` token) — leaving the
   * banner markup inside it would put the banner and the form in two
   * unrelated DOM subtrees instead of the live site's single flex container.
   */
  heroBannerHtml?: string;
  /** Structured version of the `.slider-banner` tabs — see `HeroBannerSlide`. */
  heroBannerSlides?: HeroBannerSlide[];
  hero: {
    announcementBadge: string;
    headingPrefix: string;
    headingHighlight: string;
    headingSuffix: string;
    subtitle: string;
    trustBadges: TrustBadgeItem[];
    calculator: CalculatorConfig;
  };
  servicesSection: {
    title: string;
    subtitle: string;
    services: ServiceCardItem[];
  };
  whyChooseUsSection: {
    badgeText: string;
    title: string;
    features: WhyChooseUsItem[];
  };
  testimonialsSection: {
    title: string;
    subtitle: string;
    testimonials: TestimonialItem[];
  };
  writers?: {
    id: string | number;
    alias?: string;
    name: string;
    rating: number;
    completedProjects: number;
    qualification: string;
    bio: string;
    location: string;
    avatarUrl: string;
    sampleTitle?: string;
    sampleExcerpt?: string;
  }[];
  blogData?: {
    recent: Array<{ id: number | string; alias: string; title: string; excerpt: string; imageUrl?: string | null }>;
    mostViewed: Array<{ id: number | string; alias: string; title: string; excerpt: string; imageUrl?: string | null }>;
  };
  bottomCtaBanner: {
    title: string;
    subtitle: string;
    buttonText: string;
    buttonHref: string;
  };
}


