import type {
    MasteryScaleLevel,
    ProgressHowItWorksContent,
    ProgressSampleReportContent,
} from "./types";

export const defaultMasteryScale: MasteryScaleLevel[] = [
    {
        level: 4,
        label: "Exceeding",
        color: "moss",
        description: "Applies mastery in complex or new contexts with independence and depth.",
    },
    {
        level: 3,
        label: "Meeting",
        color: "deep-sea",
        description: "Demonstrates independent and consistent mastery of the learning outcome.",
    },
    {
        level: 2,
        label: "Approaching",
        color: "sunflower",
        description: "Developing understanding with support; partial mastery.",
    },
    {
        level: 1,
        label: "Not Yet",
        color: "valencia",
        description: "Beginning stages of learning; requires ongoing support.",
    },
];

export function defaultHowItWorksContent(): ProgressHowItWorksContent {
    return {
        whyTitle: "Why Mastery, Not Grades?",
        whyIntroHtml:
            'Inspired by the <a href="https://mastery.org" target="_blank" rel="noopener noreferrer" class="text-primary underline hover:text-primary/80">Mastery Transcript Consortium® (MTC)</a>, Orion believes that traditional letter grades compress complex learning into a single symbol, losing the richness of what students actually know and can do.',
        whyCards: [
            {
                emoji: "📖",
                title: "Competency-Based",
                description:
                    "Students are assessed on specific skills and knowledge areas — not compared to peers. Every learner has a clear, personalized path.",
            },
            {
                emoji: "📊",
                title: "Growth Over Time",
                description:
                    "Progress reports track movement along a mastery continuum. A student who is 'Approaching' today can demonstrate 'Meeting' or 'Exceeding' later.",
            },
            {
                emoji: "👥",
                title: "Evidence & Portfolios",
                description:
                    "Mastery isn't claimed — it's demonstrated. Students build portfolios of authentic work that showcase their competencies to families and beyond.",
            },
        ],
        scaleTitle: "Mastery Scale",
        scaleSubtitle: "How we describe student progress — no letters, no percentages.",
        masteryScale: defaultMasteryScale,
        trackTitle: "How We Track Progress",
        trackIntroHtml:
            'Powered by the <a href="https://mastery.org/what-we-do/mtc-progress-tracker/" target="_blank" rel="noopener noreferrer" class="text-primary underline hover:text-primary/80">MTC Progress Tracker</a> framework — students lead the tracking process by uploading evidence of growth and advancing along the learning scale.',
        trackCards: [
            {
                emoji: "📤",
                title: "Learner-Driven Evidence",
                description:
                    "Students upload evidence of growth — documents, videos, project links — and request to advance along the mastery scale. This builds ownership and agency.",
                color: "text-deep-sea",
            },
            {
                emoji: "👁️",
                title: "Educator Workspace",
                description:
                    "Teachers see a real-time progress heatmap across all students and competencies, enabling targeted support and timely feedback.",
                color: "text-valencia",
            },
            {
                emoji: "📷",
                title: "Flexible Snapshots",
                description:
                    "Progress Snapshots are shared with parents and caregivers at regular intervals — providing a living picture of growth, not a single-point grade.",
                color: "text-moss",
            },
            {
                emoji: "💡",
                title: "Authentic Feedback",
                description:
                    "Learners receive suggestions and feedback from educators to progress. Evidence can be tagged across multiple competencies for a holistic view.",
                color: "text-sunflower",
            },
        ],
        heatmapTitle: "Progress Heatmap — Sample View",
        heatmapDescription:
            "A classroom-level view showing each student's mastery across competencies. Colors indicate current mastery level.",
        heatmapColumns: ["Reading", "Writing", "Math Ops", "Fractions", "Science", "Collab", "Self-Dir", "Comm"],
        heatmapStudents: [
            { name: "Maya L.", scores: [3, 3, 3, 3, 4, 3, 4, 3] },
            { name: "Aiden R.", scores: [2, 2, 3, 2, 3, 2, 3, 2] },
            { name: "Sofia M.", scores: [4, 3, 2, 2, 3, 3, 3, 4] },
            { name: "Leo T.", scores: [1, 2, 3, 3, 2, 2, 2, 2] },
            { name: "Zara K.", scores: [3, 3, 4, 3, 4, 4, 3, 3] },
        ],
        heatmapLegend: [
            { level: 4, label: "Exceeding", color: "moss" },
            { level: 3, label: "Meeting", color: "deep-sea" },
            { level: 2, label: "Approaching", color: "sunflower" },
            { level: 1, label: "Not Yet", color: "valencia" },
        ],
        continuumHtml:
            '<strong class="text-foreground">A Continuum of Competency-Based Tools:</strong> The MTC Progress Tracker supports competency-based learning across a learner\'s K–12 experience. As students advance, evidence feeds into the <strong class="text-foreground">MTC Learning Record</strong> and <strong class="text-foreground">Mastery Transcript</strong>, creating a seamless record of growth from elementary through graduation.',
        timelineTitle: "Reporting Timeline",
        timelineSubtitle: "Four touchpoints throughout the year to keep families connected.",
        timeline: [
            {
                quarter: "Q1",
                month: "November",
                label: "Fall Progress Report",
                description:
                    "Baseline assessment of where each student stands on competencies. Sets growth goals collaboratively with student and family.",
            },
            {
                quarter: "Q2",
                month: "January",
                label: "Mid-Year Progress Report",
                description:
                    "Update on growth trajectory. Highlights areas of advancement and identifies competencies needing additional support.",
            },
            {
                quarter: "Q3",
                month: "April",
                label: "Spring Progress Report",
                description:
                    "Comprehensive review with evidence portfolios. Student-led conferences to demonstrate mastery through authentic work.",
            },
            {
                quarter: "Q4",
                month: "June",
                label: "End-of-Year Mastery Transcript",
                description:
                    "Final mastery levels across all competencies. Includes narrative reflections, portfolio highlights, and growth story.",
            },
        ],
        readEmoji: "💡",
        readTitle: "How to Read Your Child's Report",
        readTips: [
            {
                lead: "Look for growth, not perfection.",
                text: 'A student moving from "Not Yet" to "Approaching" is making real progress — celebrate it.',
            },
            {
                lead: "Read the narratives.",
                text: "Teachers write personalized reflections for each child that explain how they're learning, not just what.",
            },
            {
                lead: "Explore the portfolio.",
                text: "Student work samples are attached as evidence. Ask your child to walk you through their favorite pieces.",
            },
            {
                lead: "Focus on the whole child.",
                text: "Academic competencies are only part of the picture. SEL and Portrait dimensions matter just as much.",
            },
            {
                lead: "Partner with us.",
                text: "Progress reports are an invitation to conversation, not a final verdict. Join student-led conferences each quarter.",
            },
        ],
    };
}

export function defaultSampleReportContent(): ProgressSampleReportContent {
    return {
        schoolLabel: "Orion STEM Schools",
        reportTitle: "Sample Mastery-Based Progress Report (Grades K–5)",
        studentName: "Maya L.",
        studentGrade: "5",
        studentTerm: "Winter 2024–2025",
        studentTeacher: "Patel",
        scaleNote:
            '"Meeting" indicates your child is consistently demonstrating independent mastery of the material.',
        masteryScale: defaultMasteryScale,
        masteryProgressTitle: "Mastery Progress",
        masteryProgressSubtitle:
            "Academic outcomes in ELA, Math, and Science showing growth over time.",
        masteryProgress: [
            { subject: "ELA", outcome: "Prior Grade Outcomes Mastered", gradeLevel: "K–4", term1: "✔", term2: "✔" },
            { subject: "ELA", outcome: "Analyze characters using evidence", gradeLevel: "5th", term1: "3 - Meeting", term2: "3 - Meeting" },
            { subject: "ELA", outcome: "Summarize nonfiction using main ideas", gradeLevel: "5th", term1: "2 - Approaching", term2: "3 - Meeting" },
            { subject: "ELA", outcome: "Cite evidence across texts", gradeLevel: "6th", term1: "1 - Not Yet", term2: "2 - Approaching" },
            { subject: "Math", outcome: "Prior Grade Outcomes Mastered", gradeLevel: "K–4", term1: "✔", term2: "✔" },
            { subject: "Math", outcome: "Add and subtract fractions with unlike denominators", gradeLevel: "5th", term1: "3 - Meeting", term2: "3 - Meeting" },
            { subject: "Math", outcome: "Multiply fractions by whole numbers", gradeLevel: "5th", term1: "2 - Approaching", term2: "3 - Meeting" },
            { subject: "Math", outcome: "Divide fractions by whole numbers", gradeLevel: "6th", term1: "1 - Not Yet", term2: "2 - Approaching" },
            { subject: "Science", outcome: "Prior Grade Outcomes Mastered", gradeLevel: "K–4", term1: "✔", term2: "✔" },
            { subject: "Science", outcome: "Describe the water cycle and its processes", gradeLevel: "5th", term1: "3 - Meeting", term2: "4 - Exceeding" },
            { subject: "Science", outcome: "Conduct and record simple investigations", gradeLevel: "6th", term1: "4 - Exceeding", term2: "4 - Exceeding" },
        ],
        competencyTitle: "Competency Progress",
        competencySubtitle:
            "Habits of learning — collaboration, self-direction, and more — assessed through classroom observations and goal-setting.",
        competencyProgress: [
            {
                name: "Collaboration",
                description: "Skill in working with peers, sharing ideas, and contributing to group success.",
                term1: "2 - Approaching",
                term2: "3 - Meeting",
            },
            {
                name: "Self-Direction",
                description: "Capacity to set goals, stay focused, and take initiative in learning tasks.",
                term1: "3 - Meeting",
                term2: "4 - Exceeding",
            },
            {
                name: "Time Management",
                description: "Ability to use time effectively, plan ahead, and adjust when needed.",
                term1: "2 - Approaching",
                term2: "3 - Meeting",
            },
            {
                name: "Communication",
                description:
                    "Effectiveness in expressing ideas clearly through speaking and writing, and in listening actively.",
                term1: "2 - Approaching",
                term2: "3 - Meeting",
            },
        ],
        spiderTitle: "Competency Spiderweb",
        spiderSubtitle:
            "A visual snapshot of growth across all competencies from Term 1 to Term 2.",
        spiderPoints: [
            { competency: "Collaboration", term1: 2, term2: 3 },
            { competency: "Self-Direction", term1: 3, term2: 4 },
            { competency: "Time Management", term1: 2, term2: 3 },
            { competency: "Communication", term1: 2, term2: 3 },
            { competency: "Reading", term1: 3, term2: 3 },
            { competency: "Writing", term1: 2, term2: 3 },
            { competency: "Math", term1: 3, term2: 3 },
            { competency: "Science", term1: 3, term2: 4 },
        ],
        readinessTitle: "Readiness for Middle School",
        readinessSubtitle:
            'Students who are "On Track" have mastered at least 60% of core outcomes at a proficient ("Meeting") level.',
        readiness: [
            { subject: "ELA", pct: "67%", status: "🟨 On Track" },
            { subject: "Math", pct: "67%", status: "🟨 On Track" },
            { subject: "Science", pct: "100%", status: "🟩 Strong Readiness" },
        ],
        reflectionTitle: "Student Reflection (Term 2)",
        reflectionItems: [
            {
                emoji: "🌟",
                label: "What I'm proud of",
                text: "I'm proud that I got better at finding main ideas in nonfiction. I can explain what I read more easily now. I'm also proud that I helped lead a science project — it was fun to organize everything!",
            },
            {
                emoji: "🔨",
                label: "What I'm still working on",
                text: "I want to improve how I revise my writing so it sounds better and has more detail.",
            },
            {
                emoji: "🎯",
                label: "My next goal",
                text: "Take more time to reread and revise my writing, especially in opinion pieces.",
            },
        ],
        narrativeTitle: "Teacher Narrative",
        narrativeSections: [
            {
                emoji: "📊",
                label: "Pacing Overview (Term 2)",
                text: "Maya is currently on pace in all subjects. She has fully mastered foundational (K–4) outcomes and is now working through a blend of 5th and 6th grade content, particularly in math and science. Pacing aligns with the time elapsed in the term.",
            },
            {
                emoji: "📝",
                label: "Learning Summary (Term 2)",
                text: "Maya continues to shine across disciplines, especially in science, where she takes initiative and shows deep conceptual understanding. Her math and ELA mastery is progressing steadily, and she is now applying 5th grade skills in 6th grade contexts. Maya has also shown strong growth in self-direction and time management. For the next term, we will focus on refining her writing and introducing multi-step math problems that require both reasoning and perseverance.",
            },
            {
                emoji: "🚀",
                label: "Outlook",
                text: "Maya is on a strong trajectory toward middle school success. She is building independence, managing her time well, and showing a growing ability to transfer skills across contexts. With continued feedback and goal-setting, she will be ready to take on credit-bearing coursework in the near future.",
                highlight: true,
            },
        ],
        archiveTitle: "Learning Journey Archive",
        archiveItems: [
            "Progress Report – Fall 2024 (Term 1)",
            "Progress Report – Spring 2024 (Term 3)",
        ],
    };
}
