// User and Authentication Types
export interface User {
  id: string;
  email: string;
  name: string;
  avatar?: string;
  role: UserRole;
  permissions: Permission[];
  createdAt: Date;
  updatedAt: Date;
}

export type UserRole = 'super_admin' | 'admin' | 'instructor' | 'student' | 'auditor';

export interface Permission {
  id: string;
  name: string;
  resource: string;
  action: string;
}

// Course Types
export interface Course {
  id: string;
  title: string;
  description: string;
  thumbnail: string;
  instructor: User;
  modules: Module[];
  progress: number;
  status: CourseStatus;
  category: string;
  duration: number; // in minutes
  level: 'beginner' | 'intermediate' | 'advanced';
  enrolledCount: number;
  rating: number;
  createdAt: Date;
  updatedAt: Date;
}

export type CourseStatus = 'draft' | 'published' | 'archived';

export interface Module {
  id: string;
  courseId: string;
  title: string;
  description: string;
  order: number;
  lessons: Lesson[];
  duration: number;
  isCompleted: boolean;
}

export interface Lesson {
  id: string;
  moduleId: string;
  title: string;
  content: string;
  type: 'video' | 'text' | 'quiz' | 'assignment';
  duration: number;
  order: number;
  isCompleted: boolean;
  resources: Resource[];
}

export interface Resource {
  id: string;
  name: string;
  type: 'pdf' | 'doc' | 'video' | 'image' | 'link';
  url: string;
  size?: number;
}

// Assignment Types
export interface Assignment {
  id: string;
  courseId: string;
  moduleId?: string;
  title: string;
  description: string;
  instructions: string;
  dueDate: Date;
  maxScore: number;
  submissionType: 'file' | 'text' | 'both';
  allowedFileTypes: string[];
  maxFileSize: number;
  status: AssignmentStatus;
  createdAt: Date;
}

export type AssignmentStatus = 'draft' | 'published' | 'closed';

export interface AssignmentSubmission {
  id: string;
  assignmentId: string;
  studentId: string;
  content?: string;
  files: SubmissionFile[];
  submittedAt: Date;
  status: SubmissionStatus;
  score?: number;
  feedback?: string;
  gradedAt?: Date;
  gradedBy?: string;
}

export type SubmissionStatus = 'submitted' | 'graded' | 'returned';

export interface SubmissionFile {
  id: string;
  name: string;
  url: string;
  size: number;
  type: string;
}

// Exam Types
export interface Exam {
  id: string;
  courseId: string;
  title: string;
  description: string;
  instructions: string;
  duration: number; // in minutes
  totalQuestions: number;
  passingScore: number;
  maxAttempts: number;
  questions: Question[];
  status: ExamStatus;
  startDate: Date;
  endDate: Date;
  createdAt: Date;
}

export type ExamStatus = 'draft' | 'published' | 'active' | 'closed';

export interface Question {
  id: string;
  examId: string;
  type: 'multiple_choice' | 'essay' | 'true_false' | 'fill_blank';
  question: string;
  options?: string[]; // for multiple choice
  correctAnswer?: string | string[] | number;
  points: number;
  order: number;
  explanation?: string;
}

export interface ExamAttempt {
  id: string;
  examId: string;
  studentId: string;
  answers: ExamAnswer[];
  startedAt: Date;
  submittedAt?: Date;
  score?: number;
  status: 'in_progress' | 'submitted' | 'graded';
  timeRemaining: number;
}

export interface ExamAnswer {
  questionId: string;
  answer: string | string[];
  isCorrect?: boolean;
  points?: number;
}

// Enhanced Exam Data Interface for Interactive Quizzes
export interface EnhancedExamData {
  id: string;
  title: string;
  description?: string;
  duration: number; // in minutes
  questions: Question[];
  
  // Interactive Quiz Extensions
  adminConfig?: AdminQuizConfig;
  interactiveQuestions?: InteractiveQuestion[];
  interactiveData?: InteractiveExamData;
  
  // Metadata
  createdBy?: string;
  createdAt?: Date;
  updatedAt?: Date;
  version?: string;
  status?: 'draft' | 'published' | 'archived';
}

// Certificate Types
export interface Certificate {
  id: string;
  studentId: string;
  courseId: string;
  examId?: string;
  title: string;
  description: string;
  issueDate: Date;
  expiryDate?: Date;
  certificateNumber: string;
  qrCode: string;
  digitalSignature: string;
  status: CertificateStatus;
  verificationUrl: string;
}

export type CertificateStatus = 'issued' | 'revoked' | 'expired';

// Schedule Types
export interface Schedule {
  id: string;
  title: string;
  description?: string;
  type: 'course' | 'exam' | 'assignment' | 'meeting';
  startDate: Date;
  endDate: Date;
  location?: string;
  isOnline: boolean;
  participants: string[];
  createdBy: string;
  status: ScheduleStatus;
}

export type ScheduleStatus = 'scheduled' | 'ongoing' | 'completed' | 'cancelled';

export interface ScheduleNotification {
  id: string;
  scheduleId: string;
  userId: string;
  type: 'reminder' | 'update' | 'cancellation';
  message: string;
  sentAt: Date;
  isRead: boolean;
}

// Report Types
export interface Report {
  id: string;
  title: string;
  type: ReportType;
  data: any;
  filters: ReportFilter[];
  generatedAt: Date;
  generatedBy: string;
  format: 'pdf' | 'excel' | 'csv';
}

export type ReportType = 'progress' | 'performance' | 'certification' | 'analytics' | 'audit';

export interface ReportFilter {
  field: string;
  operator: 'equals' | 'contains' | 'greater_than' | 'less_than' | 'between';
  value: any;
}

// AI Assistant Types
export interface AIConversation {
  id: string;
  userId: string;
  messages: AIMessage[];
  context: string;
  createdAt: Date;
  updatedAt: Date;
}

export interface AIMessage {
  id: string;
  role: 'user' | 'assistant';
  content: string;
  timestamp: Date;
  metadata?: any;
}

export interface AIRecommendation {
  id: string;
  userId: string;
  type: 'course' | 'content' | 'study_plan';
  title: string;
  description: string;
  confidence: number;
  data: any;
  createdAt: Date;
}

// Dashboard Types
export interface DashboardStats {
  totalCourses: number;
  completedCourses: number;
  averageScore: number;
  certificatesEarned: number;
  studyHours: number;
  upcomingDeadlines: number;
}

export interface ActivityItem {
  id: string;
  type: 'course_completed' | 'assignment_submitted' | 'exam_taken' | 'certificate_earned';
  title: string;
  description: string;
  timestamp: Date;
  metadata?: any;
}

// Notification Types
export interface Notification {
  id: string;
  userId: string;
  type: NotificationType;
  title: string;
  message: string;
  isRead: boolean;
  createdAt: Date;
  data?: any;
}

export type NotificationType = 
  | 'assignment_due'
  | 'exam_reminder'
  | 'course_update'
  | 'certificate_issued'
  | 'system_announcement'
  | 'grade_released';

// API Response Types
export interface ApiResponse<T = any> {
  success: boolean;
  data?: T;
  message?: string;
  errors?: string[];
  meta?: {
    page?: number;
    limit?: number;
    total?: number;
    totalPages?: number;
  };
}

export interface PaginatedResponse<T> {
  data: T[];
  meta: {
    page: number;
    limit: number;
    total: number;
    totalPages: number;
  };
}

// Form Types
export interface FormField {
  name: string;
  label: string;
  type: 'text' | 'email' | 'password' | 'textarea' | 'select' | 'file' | 'date' | 'number';
  placeholder?: string;
  required?: boolean;
  options?: { value: string; label: string }[];
  validation?: any;
}

// Settings Types
export interface UserSettings {
  language: 'id' | 'en';
  timezone: string;
  notifications: NotificationSettings;
  privacy: PrivacySettings;
  accessibility: AccessibilitySettings;
}

export interface NotificationSettings {
  email: boolean;
  push: boolean;
  sms: boolean;
  assignmentReminders: boolean;
  examReminders: boolean;
  courseUpdates: boolean;
  systemAnnouncements: boolean;
}

export interface PrivacySettings {
  profileVisibility: 'public' | 'private' | 'friends';
  showProgress: boolean;
  showCertificates: boolean;
  allowMessages: boolean;
}

export interface AccessibilitySettings {
  fontSize: 'normal' | 'large' | 'xlarge';
  highContrast: boolean;
  screenReader: boolean;
  keyboardNavigation: boolean;
}

// Error Types
export interface AppError {
  code: string;
  message: string;
  details?: any;
  timestamp: Date;
}

// Loading States
export interface LoadingState {
  isLoading: boolean;
  error?: string | null;
  lastUpdated?: Date;
}

// ========================================
// INTERACTIVE QUIZ SYSTEM TYPES
// ========================================

// Enhanced Question Types for Interactive Quiz
export interface InteractiveQuestion {
  id: string;
  type: 'mcq' | 'enhanced_mcq' | 'puzzle' | 'scenario' | 'simulation' | 'randomizer' | 'drag_drop' | 'puzzle_gambar_icon' | 'true_false_cepat' | 'mini_simulation_rpg' | 'mini_survey_reflection' | 'video_scenario' | 'image_hotspot' | 'media_gallery';
  content: QuestionContent;
  interactiveElements?: InteractiveElement[];
  behaviorMetrics?: BehaviorMetric[];
  timeLimit?: number;
  multimedia?: MultimediaContent;
  difficulty?: 'easy' | 'medium' | 'hard';
  tags?: string[];
  
  // Puzzle-specific data
  puzzleData?: PuzzleData;
  
  // Scenario-specific data
  scenarioData?: ScenarioData;
  
  // Video scenario specific data
  scenarios?: VideoScenarioStep[];
  
  // Image hotspot specific data
  hotspots?: ImageHotspot[];
  
  // New quiz type properties
  visualElements?: VisualMatchingConfig;
  reactionTimeConfig?: ReactionTimeConfig;
  rpgElements?: RPGConfig;
  reflectionConfig?: ReflectionConfig;
  
  // Media gallery specific
  mediaItems?: MediaItem[];
  
  // Legacy properties for backward compatibility
  text?: string;
  question?: string;
  options?: string[];
  correctAnswer?: number;
  multipleAnswers?: boolean;
  dragDropItems?: DragDropItem[];
  dropZones?: DropZone[];
  media?: MultimediaContent;
  hint?: string;
  requiresConfidence?: boolean;
}

export interface QuestionContent {
  question: string;
  description?: string;
  instructions?: string;
  options?: QuestionOption[];
  correctAnswers?: (string | number)[];
  explanation?: string;
  multipleAnswers?: boolean;
  dragDropItems?: DragDropItem[];
  dropZones?: DropZone[];
  media?: MultimediaContent;
  hint?: string;
  requiresConfidence?: boolean;
  puzzleType?: string;
}

export interface QuestionOption {
  id: string;
  text: string;
  isCorrect?: boolean;
  feedback?: string;
  multimedia?: MultimediaContent;
  image?: string;
}

export interface DragDropItem {
  id: string;
  text: string;
  category?: string;
}

export interface DropZone {
  id: string;
  label: string;
  acceptedCategories?: string[];
}

export interface MultimediaContent {
  type: 'image' | 'video' | 'audio' | 'document';
  src: string;
  alt?: string;
  caption?: string;
  thumbnail?: string;
}

export interface MediaItem {
  id: string;
  type: 'image' | 'video' | 'audio' | 'document';
  src: string;
  title: string;
  description?: string;
  duration?: number; // in seconds for video/audio
  size?: number; // file size in bytes
  fileType?: string; // for document type (e.g., 'PDF', 'DOC', 'XLS')
  fileSize?: string; // human readable file size (e.g., '2.5 MB')
  thumbnail?: string;
  metadata?: {
    width?: number;
    height?: number;
    format?: string;
    quality?: string;
  };
}

export interface InteractiveElement {
  type: 'drag_drop' | 'matching' | 'sequencing' | 'slider' | 'hotspot' | 'timeline' | 'hint' | 'explanation' | 'learning_objective' | 'assessment_criteria';
  config?: any; // Flexible configuration object
  content?: string; // For hint and explanation content
  validation?: ValidationRule[];
}

export interface ValidationRule {
  type: 'required' | 'min_length' | 'max_length' | 'pattern' | 'custom';
  value?: any;
  message: string;
}

export interface SliderConfig {
  id: string;
  label: string;
  minValue: number;
  maxValue: number;
  correctValue: number;
  unit?: string;
}

// Puzzle Data Types
export interface PuzzleData {
  type: 'jigsaw' | 'sequence' | 'word_puzzle' | 'slider';
  instructions?: string;
  pieces?: PuzzlePiece[];
  sequence?: string[];
  words?: string[];
  correctOrder?: number[];
  sliders?: SliderConfig[];
  targetAreas?: any[];
  gridSize?: {
    rows: number;
    cols: number;
  };
  initialState?: {
    temperature?: number;
    cleanliness?: number;
    inventory?: { [item: string]: number };
    equipment?: { [equipment: string]: boolean };
    staff?: { [role: string]: boolean };
    orders?: any[];
  };
}

export interface PuzzlePiece {
  id: string;
  content: string;
  correctPosition: number | string;
  isLocked?: boolean;
}

// Scenario Data Types
export interface ScenarioData {
  type: 'kitchen' | 'restaurant' | 'general';
  instructions?: string;
  steps: ScenarioStep[];
  initialState?: {
    temperature?: number;
    cleanliness?: number;
    inventory?: { [item: string]: number };
    equipment?: { [equipment: string]: boolean };
    staff?: { [role: string]: boolean };
    orders?: any[];
  };
}

export interface ScenarioStep {
  id: string;
  title: string;
  description: string;
  situation: string;
  options: ScenarioOption[];
  timeLimit?: number;
  consequences: { [optionId: string]: Consequence };
}

export interface ScenarioOption {
  id: string;
  text: string;
  icon?: string;
  risk: 'low' | 'medium' | 'high';
  cost?: number;
  timeRequired?: number;
}

export interface Consequence {
  scoreChange: number;
  kitchenStateChanges?: any;
  message: string;
  nextStep?: string;
}

// Admin Configuration Types
export interface AdminQuizConfig {
  // Basic Configuration
  language: 'id' | 'en';
  allowHints: boolean;
  showExplanations: boolean;
  enableBehaviorTracking: boolean;
  confidenceRatingRequired: boolean;
  timeLimit: number;
  shuffleQuestions: boolean;
  shuffleOptions: boolean;
  allowReview: boolean;
  showProgressBar: boolean;
  customInstructions: string;
  
  // Behavior Analysis Configuration
  behaviorAnalysis: BehaviorAnalysisConfig;
  
  // Privacy Settings
  privacySettings: BehaviorPrivacySettings;
  
  // Extended Configuration (Optional)
  configuredBy?: string;
  configuredAt?: Date;
  templateId?: string;
  templateName?: string;
  
  enabledFeatures?: {
    enhancedMCQ: boolean;
    puzzleQuestions: boolean;
    scenarioSimulation: boolean;
    behaviorAnalysis: boolean;
    timeBasedQuestions: boolean;
    adaptiveDifficulty: boolean;
    personalityProfiling: boolean;
  };
  
  customSettings?: {
    allowRetake: boolean;
    showResultsImmediately: boolean;
    generatePersonalityReport: boolean;
    enableHints: boolean;
    trackBehaviorMetrics: boolean;
    requireConfidenceRating: boolean;
    enableCollaboration: boolean;
  };
  
  uiSettings?: {
    language: 'indonesia' | 'english';
    theme: 'light' | 'dark' | 'auto';
    fontSize: 'small' | 'medium' | 'large';
    showProgressBar: boolean;
    enableAnimations: boolean;
    mobileOptimized: boolean;
  };
  
  templates?: {
    introTemplate?: string;
    completionTemplate?: string;
    feedbackTemplate?: string;
    errorTemplate?: string;
  };
}

// Enhanced Exam Data Interface
export interface InteractiveExamData {
  id: string;
  title: string;
  description?: string;
  duration: number; // in minutes
  
  // Quiz Type Configuration
  examType: 'standard' | 'interactive';
  adminConfig: AdminQuizConfig;
  
  // Questions and Structure
  questions: InteractiveQuestion[];
  stages?: ExamStage[];
  
  // Behavior Analysis Configuration
  behaviorAnalysis?: BehaviorAnalysisConfig;
  
  // Assessment Settings
  passingGrade?: number;
  maxAttempts?: number;
  shuffleQuestions?: boolean;
  shuffleOptions?: boolean;
  
  // Metadata
  createdBy: string;
  createdAt: Date;
  updatedAt: Date;
  version: string;
  status: 'draft' | 'published' | 'archived';
}

export interface ExamStage {
  id: string;
  title: string;
  description: string;
  order: number;
  isLocked: boolean;
  prerequisiteStages: string[];
  questions: InteractiveQuestion[];
  completionCriteria: CompletionCriteria;
  timeLimit?: number;
}

export interface CompletionCriteria {
  minimumScore?: number;
  requiredQuestions?: string[];
  timeRequirement?: number;
  behaviorRequirements?: BehaviorRequirement[];
}

export interface BehaviorRequirement {
  metric: string;
  threshold: number;
  operator: 'greater_than' | 'less_than' | 'equals' | 'between';
}

// Behavior Analysis Types
export interface BehaviorAnalysisConfig {
  trackMouseMovements: boolean;
  trackKeystrokes: boolean;
  trackScrolling: boolean;
  trackFocusEvents: boolean;
  analysisDepth: 'basic' | 'detailed' | 'comprehensive';
  
  // Extended Configuration (Optional)
  enabled?: boolean;
  trackingLevel?: 'basic' | 'detailed' | 'comprehensive';
  generateProfile?: boolean;
  metrics?: BehaviorMetric[];
  privacySettings?: BehaviorPrivacySettings;
}

export interface BehaviorPrivacySettings {
  anonymizeData: boolean;
  dataRetentionDays: number;
  allowDataExport: boolean;
  
  // Tracking Settings
  trackClicks?: boolean;
  trackScrolling?: boolean;
  trackFocus?: boolean;
  trackTiming?: boolean;
  trackAnswerChanges?: boolean;
  trackHesitation?: boolean;
  
  // Extended Configuration (Optional)
  retentionPeriod?: number; // in days
  shareWithInstructors?: boolean;
  allowOptOut?: boolean;
}

export interface BehaviorMetric {
  id: string;
  name: string;
  type: 'time_based' | 'interaction_based' | 'performance_based' | 'pattern_based';
  description: string;
  weight: number; // 0-1 for importance in analysis
}

// Behavior Tracking Data Types
export interface BehaviorData {
  sessionId: string;
  userId: string;
  examId: string;
  startTime: Date;
  endTime?: Date;
  
  // Time Metrics
  totalTime: number;
  timePerQuestion: number[];
  pauseDurations: number[];
  
  // Interaction Patterns
  clickEvents: ClickEvent[];
  scrollEvents: ScrollEvent[];
  focusEvents: FocusEvent[];
  
  // Decision Making Patterns
  answerChanges: AnswerChangeEvent[];
  hesitationPoints: HesitationEvent[];
  confidenceLevels: number[];
  
  // Stress Indicators
  rapidClicking: boolean;
  excessiveScrolling: boolean;
  longPauses: boolean;
  
  // Performance Correlation
  accuracyOverTime: { time: number; accuracy: number }[];
  difficultyResponse: { questionId: string; difficulty: number; response: string }[];
  
  // Calculated Metrics
  metrics?: {
    averageResponseTime: number;
    clickFrequency: number;
    scrollFrequency: number;
    hesitationCount: number;
    answerChangeCount: number;
    totalClicks: number;
    totalScrolls: number;
    focusLossCount: number;
    engagementScore: number;
  };
  
  // Personality Indicators
  personalityIndicators?: {
    impulsiveness: number;
    thoroughness: number;
    confidence: number;
    stressLevel: number;
  };
  
  // Alternative property names for compatibility
  hesitationEvents?: HesitationEvent[];
  answerChangeEvents?: AnswerChangeEvent[];
}

export interface ClickEvent {
  timestamp: Date;
  elementType: string;
  elementId: string;
  coordinates: { x: number; y: number };
  duration?: number;
  targetClass?: string;
}

export interface ScrollEvent {
  timestamp: Date;
  direction: 'up' | 'down';
  distance: number;
  speed: number;
}

export interface FocusEvent {
  timestamp: Date;
  type: 'focus' | 'blur';
  elementId: string;
  duration?: number;
}

export interface AnswerChangeEvent {
  timestamp: Date;
  questionId: string;
  previousAnswer: any;
  newAnswer: any;
  changeReason?: string;
  timeSpent?: number;
}

export interface HesitationEvent {
  timestamp: Date;
  questionId: string;
  duration: number;
  indicators: string[];
}

// Personality Profile Types
export interface PersonalityProfile {
  userId: string;
  generatedAt: Date;
  basedOnExams: string[];
  confidenceLevel: number; // 0-100
  
  traits: PersonalityTraits;
  insights: PersonalityInsights;
  recommendations: string[];
  
  // Metadata
  version: string;
  algorithm: string;
  dataPoints: number;
}

export interface PersonalityTraits {
  decisionMaking: 'quick' | 'careful' | 'analytical';
  stressResponse: 'calm' | 'moderate' | 'reactive';
  learningStyle: 'visual' | 'analytical' | 'kinesthetic' | 'mixed';
  riskTolerance: 'conservative' | 'moderate' | 'aggressive';
  problemSolving: 'systematic' | 'intuitive' | 'collaborative';
  attentionToDetail: number; // 1-10 scale
  adaptability: number; // 1-10 scale
  teamwork: number; // 1-10 scale
}

export interface PersonalityInsights {
  strengths: string[];
  developmentAreas: string[];
  recommendedLearningPaths: string[];
  suggestedResources: string[];
  careerAlignment: string[];
}

// Quiz Configuration Templates
export interface QuizTemplate {
  id: string;
  name: string;
  description: string;
  category: 'culinary' | 'management' | 'safety' | 'general';
  config: AdminQuizConfig;
  questions: InteractiveQuestion[];
  createdBy: string;
  createdAt: Date;
  isPublic: boolean;
  usageCount: number;
}

// Results and Analytics Types
export interface InteractiveQuizResult {
  id: string;
  userId: string;
  examId: string;
  attemptNumber: number;
  startTime: Date;
  endTime: Date;
  
  // Basic Results
  score: number;
  maxScore: number;
  percentage: number;
  passed: boolean;
  
  // Interactive Results
  answers: QuestionAnswer[];
  behaviorData?: BehaviorData;
  personalityInsights?: PersonalityProfile;
  
  // Detailed Analytics
  timeAnalysis: TimeAnalysis;
  performanceAnalysis: PerformanceAnalysis;
  recommendations: string[];
}

export interface QuestionAnswer {
  questionId: string;
  answer: any;
  isCorrect: boolean;
  timeSpent: number;
  confidenceLevel?: number;
  hesitationTime?: number;
  changeCount: number;
}

export interface TimeAnalysis {
  totalTime: number;
  averageTimePerQuestion: number;
  fastestQuestion: { id: string; time: number };
  slowestQuestion: { id: string; time: number };
  timeDistribution: number[];
}

export interface PerformanceAnalysis {
  overallAccuracy: number;
  accuracyByDifficulty: { difficulty: string; accuracy: number }[];
  accuracyByType: { type: string; accuracy: number }[];
  improvementAreas: string[];
  strengths: string[];
}

// New Quiz Types Interfaces

export interface VisualMatchingConfig {
  matchingPairs: MatchingPair[];
  allowDragDrop: boolean;
  showHints: boolean;
  maxAttempts: number;
  visualStyle: 'grid' | 'list' | 'carousel';
}

export interface MatchingPair {
  id: string;
  leftItem: {
    id: string;
    content: string;
    image?: string;
    icon?: string;
  };
  rightItem: {
    id: string;
    content: string;
    image?: string;
    icon?: string;
  };
  isCorrect?: boolean;
}

export interface ReactionTimeConfig {
  timeLimit: number; // in milliseconds
  showCountdown: boolean;
  trackReactionTime: boolean;
  instantFeedback: boolean;
  penaltyForWrongAnswer: number; // in points
  bonusForQuickAnswer: number; // in points
  quickAnswerThreshold: number; // in milliseconds
}

export interface RPGConfig {
  character: RPGCharacter;
  scenario: string;
  decisions: RPGDecision[];
  maxSteps: number;
  scoringSystem: {
    empathy: number;
    leadership: number;
    problemSolving: number;
    communication: number;
  };
}

export interface RPGCharacter {
  name: string;
  role: string;
  avatar?: string;
  initialStats: {
    empathy: number;
    leadership: number;
    problemSolving: number;
    communication: number;
  };
}

export interface RPGDecision {
  id: string;
  step: number;
  situation: string;
  options: RPGOption[];
  consequences: { [optionId: string]: RPGConsequence };
}

export interface RPGOption {
  id: string;
  text: string;
  icon?: string;
  difficulty: 'easy' | 'medium' | 'hard';
}

export interface RPGConsequence {
  message: string;
  statChanges: {
    empathy?: number;
    leadership?: number;
    problemSolving?: number;
    communication?: number;
  };
  nextStep?: string;
  isEndingPath?: boolean;
  endingType?: 'success' | 'failure' | 'neutral';
}

export interface ReflectionConfig {
  questions: ReflectionQuestion[];
  scaleType: 'emoji' | 'numeric' | 'text';
  emojiScale?: EmojiScaleConfig;
  allowComments: boolean;
  isAnonymous: boolean;
}

export interface ReflectionQuestion {
  id: string;
  question: string;
  description?: string;
  category: 'self-assessment' | 'experience' | 'preference' | 'behavior';
  required: boolean;
}

export interface EmojiScaleConfig {
  options: EmojiOption[];
  showLabels: boolean;
  allowHalfSteps: boolean;
}

// Video Scenario Types
export interface VideoScenarioStep {
  id: string;
  timestamp: number; // detik
  title: string;
  question: string;
  options: VideoOption[];
  correctAnswer: number;
  explanation: string;
  pauseVideo?: boolean;
}

export interface VideoOption {
  id: string;
  text: string;
  consequence?: string;
  isCorrect?: boolean;
}

// Image Hotspot Types
export interface ImageHotspot {
  id: string;
  x: number; // percentage (0-100)
  y: number; // percentage (0-100)
  width: number; // percentage
  height: number; // percentage
  type: 'correct' | 'incorrect' | 'neutral' | 'warning';
  title: string;
  description: string;
  feedback: string;
  points: number;
  hint?: string;
  consequence?: string;
  isRequired?: boolean;
}

export interface EmojiOption {
  value: number;
  emoji: string;
  label: string;
  description?: string;
}