export type PlacementSubject = "english" | "math" | "it";
export type CATSection = "grammar" | "vocabulary" | "reading" | "speaking";
export type CEFRLevel = "pre_a1" | "a1" | "a2" | "b1" | "b2" | "c1" | "c2";

export interface CATQuestion {
  id: number;
  type: "mcq" | "mcq_multi" | "gap_fill" | "tfng" | "definition_match" | "audio_recording";
  section: CATSection;
  stem: string;
  options?: { label: string; text: string }[];
  passage_text?: string;
  audio_url?: string;
  estimated_total: number;
}

export interface CATStartResponse {
  session_id: string;
  first_question: CATQuestion;
}

export interface CATAnswer {
  session_id: string;
  question_id: number;
  answer: string | string[];
  time_spent_ms: number;
}

export interface CATAnswerResponse {
  next_question: CATQuestion | null;
  section_complete: boolean;
  test_complete: boolean;
  progress: { current: number; estimated_total: number };
}

export interface CATAutoSave {
  session_id: string;
  current_answer: { question_id: number; answer: string | string[] };
}

export interface SpeakingUpload {
  session_id: string;
  prompt_id: number;
  audio_file: File;
}

export interface DimensionScore {
  dimension: string;
  score: number;
  cefr_level: CEFRLevel | null;
  gap_to_target: string;
  status?: "scored" | "pending";
}

export interface PlacementResult {
  overall_cefr: CEFRLevel;
  dimensions: DimensionScore[];
  speaking_status: "scored" | "pending";
  entity_approval_pending?: boolean;
}

export interface LearningPathModule {
  name: string;
  estimated_hours: number;
  resource_types: string[];
  difficulty: string;
  priority: "high" | "medium" | "low";
}

export interface LearningPathPreview {
  course_title: string;
  estimated_duration_weeks: number;
  module_count: number;
  study_hours_per_week: number;
  modules: LearningPathModule[];
}
