/**
 * Data Simulasi / Mock Data untuk Dashboard Admin SMA BPI 1 Bandung
 * CATATAN PENTING:
 * Data di bawah ini ditandai secara transparan sebagai DEMO DATA (isDemo: true).
 * Data ini mencerminkan struktur dan angka yang tertera pada poster referensi resmi BPI SmartSchool
 * dan akan digantikan oleh query Supabase PostgreSQL ketika koneksi backend dihubungkan.
 */

export interface SummaryStatItem {
  id: string;
  title: string;
  value: string;
  rawValue: number;
  description: string;
  trendText?: string;
  isPositiveTrend?: boolean;
  statusBadge?: string;
  iconType: "students" | "teachers" | "classes" | "attendance";
}

export interface AttendanceTrendPoint {
  month: string;
  rate: number; // Persentase kehadiran (e.g. 96.5)
  totalStudentsPresent: number;
  totalActiveStudents: number;
}

export interface GradeDistributionItem {
  gradeLevel: "Kelas X" | "Kelas XI" | "Kelas XII";
  curriculumPhase: "Fase E" | "Fase F";
  studentCount: number;
  classCount: number;
  percentage: number;
  color: string;
}

export interface ActivityLogItem {
  id: string;
  title: string;
  description: string;
  timestamp: string;
  relativeTime: string;
  category: "akademik" | "jadwal" | "presensi" | "pengumuman" | "kepegawaian";
  actorName: string;
  actorRole: string;
}

export interface SchoolAnnouncementItem {
  id: string;
  title: string;
  summary: string;
  date: string;
  category: string;
  priority: "tinggi" | "sedang" | "normal";
  author: string;
}

export interface QuickActionItem {
  id: string;
  label: string;
  description: string;
  href: string;
  iconName: "user-plus" | "users" | "user-check" | "calendar" | "file-text";
  colorVariant: "primary" | "secondary" | "outline";
}

export const mockDashboardData = {
  academicYear: "2026/2027",
  semester: "Ganjil",
  lastUpdated: "Senin, 21 September 2026 - 12:00 WIB",

  summaryStats: [
    {
      id: "stat-students",
      title: "Total Siswa",
      value: "1.248",
      rawValue: 1248,
      description: "Terdaftar aktif di 42 rombel",
      trendText: "+3.2% vs TA lalu",
      isPositiveTrend: true,
      iconType: "students",
    },
    {
      id: "stat-teachers",
      title: "Total Guru",
      value: "86",
      rawValue: 86,
      description: "Tenaga pendidik & staf",
      statusBadge: "100% Aktif",
      iconType: "teachers",
    },
    {
      id: "stat-classes",
      title: "Total Kelas",
      value: "42",
      rawValue: 42,
      description: "Fase E (X) & Fase F (XI, XII)",
      statusBadge: "30 siswa/kls",
      iconType: "classes",
    },
    {
      id: "stat-attendance",
      title: "Kehadiran Hari Ini",
      value: "96,5%",
      rawValue: 96.5,
      description: "1.204 dari 1.248 siswa hadir",
      trendText: "+1.2% kemarin",
      isPositiveTrend: true,
      iconType: "attendance",
    },
  ] as SummaryStatItem[],

  attendanceTrend: [
    { month: "Jan", rate: 96.2, totalStudentsPresent: 1200, totalActiveStudents: 1248 },
    { month: "Feb", rate: 95.8, totalStudentsPresent: 1195, totalActiveStudents: 1248 },
    { month: "Mar", rate: 97.1, totalStudentsPresent: 1211, totalActiveStudents: 1248 },
    { month: "Apr", rate: 96.4, totalStudentsPresent: 1203, totalActiveStudents: 1248 },
    { month: "Mei", rate: 95.9, totalStudentsPresent: 1196, totalActiveStudents: 1248 },
    { month: "Jun", rate: 94.8, totalStudentsPresent: 1183, totalActiveStudents: 1248 },
    { month: "Jul", rate: 98.2, totalStudentsPresent: 1225, totalActiveStudents: 1248 },
    { month: "Ags", rate: 97.6, totalStudentsPresent: 1218, totalActiveStudents: 1248 },
    { month: "Sep", rate: 96.5, totalStudentsPresent: 1204, totalActiveStudents: 1248 },
    { month: "Okt", rate: 96.8, totalStudentsPresent: 1208, totalActiveStudents: 1248 },
    { month: "Nov", rate: 97.2, totalStudentsPresent: 1213, totalActiveStudents: 1248 },
    { month: "Des", rate: 95.5, totalStudentsPresent: 1191, totalActiveStudents: 1248 },
  ] as AttendanceTrendPoint[],

  studentDistribution: [
    {
      gradeLevel: "Kelas X",
      curriculumPhase: "Fase E",
      studentCount: 420,
      classCount: 14,
      percentage: 33.6,
      color: "#0F2B5B", // Brand Navy
    },
    {
      gradeLevel: "Kelas XI",
      curriculumPhase: "Fase F",
      studentCount: 416,
      classCount: 14,
      percentage: 33.3,
      color: "#2563EB", // Brand Blue
    },
    {
      gradeLevel: "Kelas XII",
      curriculumPhase: "Fase F",
      studentCount: 412,
      classCount: 14,
      percentage: 33.1,
      color: "#38BDF8", // Light Blue Accent
    },
  ] as GradeDistributionItem[],

  recentActivities: [
    {
      id: "act-1",
      title: "Data 36 siswa baru Kelas X-1 telah diverifikasi",
      description: "Pembaruan kelengkapan NISN dan berkas pendaftaran tahun ajaran baru.",
      timestamp: "2026-09-21T11:30:00",
      relativeTime: "25 menit yang lalu",
      category: "akademik",
      actorName: "Staf Tata Usaha",
      actorRole: "Operator Dapodik",
    },
    {
      id: "act-2",
      title: "Jadwal Pelajaran Semester Ganjil TA 2026/2027 diperbarui",
      description: "Penyesuaian jam mengajar mata pelajaran Biologi dan Fisika Fase F.",
      timestamp: "2026-09-21T10:00:00",
      relativeTime: "2 jam yang lalu",
      category: "jadwal",
      actorName: "Wakasek Kurikulum",
      actorRole: "Kurikulum",
    },
    {
      id: "act-3",
      title: "Pengumuman: Gladi Bersih Asesmen Nasional (ANBK) 2024",
      description: "Surat edaran pelaksanaan simulasi ANBK untuk siswa Kelas XI.",
      timestamp: "2026-09-21T08:15:00",
      relativeTime: "4 jam yang lalu",
      category: "pengumuman",
      actorName: "Humas SMA BPI 1",
      actorRole: "Humas",
    },
    {
      id: "act-4",
      title: "Rekap Presensi Harian Kelas XI-MIPA-1 selesai diinput",
      description: "Tingkat kehadiran: 94.4% (34 hadir, 2 sakit dengan surat dokter).",
      timestamp: "2026-09-21T07:45:00",
      relativeTime: "5 jam yang lalu",
      category: "presensi",
      actorName: "Wali Kelas XI-1",
      actorRole: "Pendidik",
    },
    {
      id: "act-5",
      title: "Penugasan Guru Mata Pelajaran Kimia baru telah dicatat",
      description: "Penambahan hak akses portal akademik untuk Dra. Hj. Ratnasari, M.Pd.",
      timestamp: "2026-09-20T15:20:00",
      relativeTime: "1 hari yang lalu",
      category: "kepegawaian",
      actorName: "Super Administrator",
      actorRole: "Admin",
    },
  ] as ActivityLogItem[],

  announcements: [
    {
      id: "ann-1",
      title: "Persiapan Penilaian Sumatif Tengah Semester (PTS) Ganjil",
      summary: "Diharapkan seluruh Bapak/Ibu guru telah menyelesaikan pengunggahan kisi-kisi soal pada sistem akademik paling lambat hari Jumat ini.",
      date: "20 Sep 2026",
      category: "Kurikulum",
      priority: "tinggi",
      author: "Wakasek Kurikulum",
    },
    {
      id: "ann-2",
      title: "Rapat Koordinasi Komite Sekolah & Yayasan BPI Bandung",
      summary: "Undangan rapat evaluasi program pembinaan karakter dan persiapan pameran karya siswa (P5) SMA BPI 1 Bandung.",
      date: "18 Sep 2026",
      category: "Manajemen",
      priority: "sedang",
      author: "Kepala SMA BPI 1",
    },
  ] as SchoolAnnouncementItem[],

  quickActions: [
    {
      id: "qa-students",
      label: "Tambah Siswa",
      description: "Input data siswa baru",
      href: "/siswa",
      iconName: "user-plus",
      colorVariant: "primary",
    },
    {
      id: "qa-teachers",
      label: "Kelola Guru",
      description: "Data tenaga pendidik",
      href: "/guru",
      iconName: "users",
      colorVariant: "outline",
    },
    {
      id: "qa-attendance",
      label: "Lihat Presensi",
      description: "Rekap kehadiran harian",
      href: "/presensi",
      iconName: "user-check",
      colorVariant: "outline",
    },
    {
      id: "qa-schedule",
      label: "Kelola Jadwal",
      description: "Penyusunan jadwal KBM",
      href: "/jadwal",
      iconName: "calendar",
      colorVariant: "outline",
    },
    {
      id: "qa-reports",
      label: "Lihat Laporan",
      description: "Rekap data sekolah",
      href: "/laporan",
      iconName: "file-text",
      colorVariant: "outline",
    },
  ] as QuickActionItem[],
};
