#!/usr/bin/env python3
"""Week 3 Generator - Vowel Teams: AI, AY, EE, EA

Phonics: Long A (ai/ay), Long E (ee/ea) vowel team patterns
Spelling: 12 words, all 6+ letters
Grammar: Verbs (action words)
"""

import os
import sys

sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
from monday import generate_monday
from tuesday import generate_tuesday
from wednesday import generate_wednesday
from thursday import generate_thursday
from friday import generate_friday
from teacher_guide import generate_teacher_guide
from validate import validate_week

WEEK = os.path.expanduser("~/Home_School/2nd_Grade/English_Language_Arts/Week_03")

# =====================================================================
# WORD LIST - 12 words, all 6+ letters, Vowel Teams (AI, EE, EA)
# =====================================================================
WORDS = [
    ("railroad", "long a (ai)", "a road for trains to travel on"),
    ("rainbow", "long a (ai)", "a colorful arc in the sky after rain"),
    ("rainfall", "long a (ai)", "the amount of rain that falls"),
    ("staircase", "long a (ai)", "a set of stairs leading up or down"),
    ("mailbox", "long a (ai)", "a box where letters and mail are delivered"),
    ("mainland", "long a (ai)", "the largest part of a country"),
    ("sweater", "long e (ea)", "a warm knitted top you wear in cold weather"),
    ("teacher", "long e (ea)", "someone who helps students learn"),
    ("street", "long e (ee)", "a road in a town or city"),
    ("cheese", "long e (ee)", "a food made from milk"),
    ("cheerful", "long e (ee)", "happy and in a good mood"),
    ("beefsteak", "long e (ea)", "a large piece of beef"),
]

WORD_NAMES = [w[0] for w in WORDS]

# =====================================================================
# SHARED CONTENT DATA
# =====================================================================
PHONICS_LABEL = "Vowel_Teams"

LEARNING_TEXT = (
    "Vowel TEAMS are two letters that work together to make ONE sound. "
    "This week: <strong>AI</strong> and <strong>AY</strong> make long A (like in <em>rain</em>), "
    "and <strong>EE</strong> and <strong>EA</strong> make long E (like in <em>tree</em>)."
)

GRAMMAR_NOTE = (
    "Grammar: A <strong>verb</strong> is an action word -- it tells what someone or something is doing. "
    "Example: The cat <em>runs</em>. We <em>eat</em> lunch. She <em>reads</em> a book."
)

GRAMMAR_DEEP = (
    "A <strong>verb</strong> is an action word -- it tells what someone or something is doing.<br><br>"
    "Examples:<br>"
    "The cat <strong>runs</strong> fast. (runs = action)<br>"
    "We <strong>eat</strong> lunch every day. (eat = action)<br>"
    "She <strong>reads</strong> a book. (reads = action)<br><br>"
    "Verbs can also show feelings: <em>wants, loves, needs</em>."
)

VOWEL_EXAMPLES_MONDAY = [
    'Long <strong>a</strong> as in <em>railroad</em> -- r-<span style="color:#FF7043;font-weight:bold;">ai</span>-l-r-o-a-d',
    'Long <strong>e</strong> as in <em>sweater</em> -- s-<span style="color:#FF7043;font-weight:bold;">ee</span>-t-e-r',
    'Long <strong>e</strong> as in <em>cheese</em> -- ch-<span style="color:#FF7043;font-weight:bold;">ee</span>-s-e',
]

VOWEL_EXAMPLES_TUE = [
    'Long <strong>a</strong> with ai &mdash; <em>railroad</em>, <em>rainbow</em>, <em>rainfall</em>',
    'Long <strong>e</strong> with ee &mdash; <em>sweater</em>, <em>teacher</em>, <em>street</em>',
    'Long <strong>e</strong> with ea &mdash; <em>cheese</em>, <em>cheerful</em>, <em>beefsteak</em>',
]

SORT_LABELS = ["Long A (ai)", "Long E (ee)", "Long E (ea)"]
SORT_TITLE = "Vowel Team Sort"

LEARNING_SKILLS_WED = [
    "<strong>Reading</strong> &mdash; understand vocabulary in context",
    "<strong>Synonyms &amp; Antonyms</strong> &mdash; words with similar and opposite meanings",
    "<strong>Word Webs</strong> &mdash; connecting related vocabulary",
]

REMINDER_TEXT = (
    "Vowel Team Rules:<br><br>"
    "1. <strong>AI</strong> and <strong>AY</strong> both make long A (say \"A\")<br>"
    "2. <strong>EE</strong> and <strong>EA</strong> both make long E (say \"E\")<br>"
    "3. The two vowels work TOGETHER -- one sound!<br><br>"
    "Examples: r<strong>ai</strong>lroad, sw<strong>ee</strong>ter, ch<strong>ee</strong>se, ch<strong>ee</strong>rful"
)

# =====================================================================
# MONDAY DATA
# =====================================================================
MONDAY_STORY = (
    'My grandma knits the coziest <strong>sweater</strong> you have ever seen. '\
    'She uses <strong>rainbow</strong> yarn with every color of the sky. '\
    'This winter the <strong>rainfall</strong> turns to snow and the whole town gets covered in white. '\
    'I wear my new <strong>sweater</strong> to school and my <strong>teacher</strong> says it is beautiful. '\
    'All my friends are <strong>cheerful</strong> because it keeps us warm on the bus ride. '\
    'Grandma lives on the <strong>mainland</strong> but she visits every holiday. '\
    'She always brings <strong>cheese</strong> cookies and <strong>beefsteak</strong> stew for dinner. '\
    'We walk up the <strong>staircase</strong> to her house on our <strong>street</strong>. '\
    'After dinner we ride the <strong>railroad</strong> to the town market. '\
    'I check the <strong>mailbox</strong> for pattern books so I can learn to knit too.'
)

MONDAY_GRAMMAR_PRACTICE = [
    "the teacher runs to the railroad",
    "we eat cheese on the street",
    "she reads about the rainbow",
]

MONDAY_FILL_DATA = [
    ("A beautiful ____ appeared after the storm.", "rainbow"),
    ("The train travels on the ____.", "railroad"),
    ("I learned from my ____ today.", "teacher"),
    ("We wore a warm ____ in the cold weather.", "sweater"),
]

MONDAY_OPPOSITE_WORDS = ["cheerful", "mainland"]
MONDAY_SENTENCE_WORDS = [w[0] for w in WORDS[:4]]

# =====================================================================
# TUESDAY DATA
# =====================================================================
TUESDAY_LEARNING = (
    "Today we practice Vowel Team patterns. Read each word slowly "
    "and listen for the long vowel sound the team creates."
)

TUESDAY_READING = (
    'My <strong>teacher</strong> says the secret to a good garden is patience. '\
    'Every morning I check the <strong>mailbox</strong> for new seed catalogs. '\
    'This year I am growing <strong>cheese</strong> pumpkins and <strong>beefsteak</strong> tomatoes. '\
    'After the <strong>rainfall</strong> last week a bright <strong>rainbow</strong> hung over the vegetable patch. '\
    'The plants look so <strong>cheerful</strong> standing tall in the sunshine. '\
    'My neighbor helped me build a <strong>staircase</strong> of wooden boxes for the hillside garden. '\
    'She lives on the <strong>mainland</strong> and sent me a warm <strong>sweater</strong> for the cold mornings. '\
    'The <strong>railroad</strong> runs right by our <strong>street</strong> and the steam from the trains keeps the frost away.'
)

TUESDAY_COMP_QUESTIONS = [
    "What is the secret to a good garden?",
    "What vegetables is the narrator growing?",
    "How does the railroad steam help the garden?",
]

TUESDAY_REMEMBER_1 = (
    "Remember This!",
    "Vowel Teams make ONE sound:<br>"
    "- <strong>AI</strong> = long A &rarr; <em>railroad</em>, <em>rainbow</em><br>"
    "- <strong>EE</strong> = long E &rarr; <em>sweater</em>, <em>teacher</em><br>"
    "- <strong>EA</strong> = long E &rarr; <em>cheese</em>, <em>cheerful</em><br><br>"
    "<strong>Try This:</strong> What vowel team is in <em>street</em>? ___"
)

TUESDAY_REMEMBER_2 = (
    "Remember This!",
    "To find vowel teams, look for two vowels sitting together:<br><br>"
    "<strong>railroad</strong> &rarr; r-<strong>ai</strong>-l-r-o-a-d &rarr; long <strong>a</strong><br>"
    "<strong>sweater</strong> &rarr; s-<strong>ee</strong>-t-e-r &rarr; long <strong>e</strong><br><br>"
    "<strong>Try This:</strong> What vowel team is in <em>cheese</em>? ___"
)

TUESDAY_SWAP_DATA = [
    ("The teacher showed us the rainbow.", ("teacher", "railroad"), ("rainbow", "rainfall")),
    ("We ate cheese on the street.", ("cheese", "beefsteak"), ("street", "staircase")),
    ("Everyone was cheerful after the rainfall.", ("cheerful", "cheese"), ("rainfall", "rainbow")),
]

TUESDAY_BUILDER_PROMPTS = [
    ("Write a sentence about a rainbow.", "rainbow"),
    ("Write a sentence about being cheerful.", "cheerful"),
    ("Write a sentence about the railroad.", "railroad"),
]

# =====================================================================
# WEDNESDAY DATA
# =====================================================================
WEDNESDAY_LEARNING = (
    "Today we use our Vowel Team words in reading, writing, and thinking. "
    "Each activity helps you understand how these words work in different contexts."
)

WEDNESDAY_READING = (
    'The <strong>railroad</strong> workers are building a new station right beside our <strong>street</strong>. '\
    'I watch them from the <strong>staircase</strong> of my bedroom window. '\
    'My <strong>teacher</strong> says the station will connect our town to the whole <strong>mainland</strong>. '\
    'Today after the morning <strong>rainfall</strong> a huge <strong>rainbow</strong> appeared over the construction site. '\
    'The workers were <strong>cheerful</strong> singing songs as they hammered the steel beams. '\
    'I put my construction pass in the <strong>mailbox</strong> and ran outside. '\
    'I wear my warm <strong>sweater</strong> even in spring because the morning wind is cold. '\
    'For lunch the workers eat <strong>cheese</strong> soup and <strong>beefsteak</strong> stew from their coolers.'
)

WEDNESDAY_VOCAB_Q = (
    "In the sentence 'The workers were cheerful singing songs,' what does <strong>cheerful</strong> mean?<br><br>"
    "A) Sad and tired<br>"
    "B) Happy and in a good mood<br>"
    "C) Angry and loud<br>"
    "D) Quiet and calm"
)

WEDNESDAY_SYN_ANT = ["cheerful", "rainbow", "staircase", "teacher", "street", "railroad"]

WEDNESDAY_SORT_DATA = [
    "The teacher showed us the beautiful rainbow",
    "We rode the railroad across the mainland",
]

WEDNESDAY_CORRECT = [
    "the teacher eats cheese on the street.",
    "we saw a rainbow after the rainfall.",
    "she climbs the tall staircase.",
]

WEDNESDAY_FILL = [
    ("The ____ led us to the museum.", "teacher"),
    ("A bright ____ appeared in the sky.", "rainbow"),
    ("We wore a warm ____ in winter.", "sweater"),
]

WEDNESDAY_CONTEXT = (
    'Read this sentence: "After the long rainfall, the children ran outside to see the beautiful rainbow."<br><br>'
    "What does <strong>rainfall</strong> mean?<br>"
    "A) A type of flower<br>"
    "B) Rain that falls from the sky<br>"
    "C) A kind of train<br>"
    "D) A tall building"
)

WEDNESDAY_DICTATION = ["railroad", "rainbow", "staircase", "mailbox", "sweater", "cheese"]

# =====================================================================
# THURSDAY DATA
# =====================================================================
THURSDAY_LEARNING = (
    "Today we use our Vowel Team words in stories and writing. "
    "Use each word correctly in your sentences and stories."
)

THURSDAY_STORY = (
    'The <strong>cheese</strong> and <strong>beefsteak</strong> recipe contest is this Saturday on our <strong>street</strong>. '\
    'My <strong>teacher</strong> entered her famous lasagna. '\
    'I help her carry ingredients up the <strong>staircase</strong> to the kitchen. '\
    'She got the recipe from her grandma on the <strong>mainland</strong>. '\
    'Even though the morning <strong>rainfall</strong> flooded the garden, we are still <strong>cheerful</strong>. '\
    'A tiny <strong>rainbow</strong> sits over the puddle by the <strong>mailbox</strong>. '\
    'I pull on my <strong>sweater</strong> to go outside where it is cold. '\
    'The <strong>railroad</strong> whistle blows at noon to start the cooking.'
)

THURSDAY_COMP_QUESTIONS = [
    "What contest is happening on Saturday?",
    "Where did the teacher get her recipe?",
    "What signals the start of the cooking?",
]

THURSDAY_SORT_DATA = [
    "The teacher climbed the tall staircase",
    "A cheerful rainbow appeared after the rainfall",
]

THURSDAY_DETECTIVE = ["rallroad", "rainbou", "rainfll", "staircse", "mialbox", "sweaer", "techer", "chease"]

THURSDAY_SWAP_DATA = [
    ("The teacher climbed the staircase.", ("teacher", "staircase"), ("staircase", "street")),
    ("We saw a rainbow after the rainfall.", ("rainbow", "rainfall"), ("rainfall", "railroad")),
]

THURSDAY_PARA_PROMPTS = [
    "Write a paragraph about your favorite trip.",
    "Write a paragraph about a cheerful day.",
]

# =====================================================================
# FRIDAY DATA
# =====================================================================
FRIDAY_REVIEW_STORY = (
    'Dear <strong>Teacher</strong>, today was the best day ever! '\
    'I saw a <strong>rainbow</strong> after the <strong>rainfall</strong> and took a picture for our class <strong>mailbox</strong>. '\
    'We walked up the <strong>staircase</strong> to the art room and made <strong>cheerful</strong> paintings of the <strong>railroad</strong>. '\
    'My painting shows a train going to the <strong>mainland</strong> past our <strong>street</strong>. '\
    'I wore my favorite <strong>sweater</strong> to school. '\
    'For lunch we had <strong>cheese</strong> and <strong>beefsteak</strong>. '\
    'Love, Your Student.'
)

FRIDAY_STORY_QUESTIONS = [
    "What did the student see after the rainfall?",
    "What did they paint in the art room?",
    "What was the student's lunch?",
]

FRIDAY_OPPOSITE_WORDS = ["cheerful", "mainland", "street"]
FRIDAY_BUILDER_WORDS = ["railroad", "rainbow", "teacher", "cheerful"]
FRIDAY_JOURNAL_WORDS = ["staircase", "mailbox", "sweater", "cheese"]

# =====================================================================
# TEACHER GUIDE DATA — Answer keys, explanations, and teaching notes
# =====================================================================

# Monday
TEACHER_MONDAY_PHONICS_EXPLANATION = (
    "VOWEL TEAMS are two vowels that work together to make ONE sound. "
    "This is different from single vowels or vowel blends — the two letters "
    "join to create a single, longer vowel sound. This week we cover:<br><br>"
    "&bull; <strong>AI</strong> = long A (/a/) — as in r<strong>ai</strong>lroad, r<strong>ai</strong>nbow<br>"
    "&bull; <strong>AY</strong> = long A (/a/) — as in d<strong>ay</strong>, pl<strong>ay</strong> (usually at word endings)<br>"
    "&bull; <strong>EE</strong> = long E (/e/) — as in sw<strong>ee</strong>ter, t<strong>ea</strong>cher<br>"
    "&bull; <strong>EA</strong> = long E (/e/) — as in ch<strong>ee</strong>se, ch<strong>ea</strong>rful"
)

TEACHER_MONDAY_GRAMMAR_FOCUS = "Verbs (Action Words)"

TEACHER_MONDAY_GRAMMAR_EXPLANATION = (
    "A verb is an action word that tells what someone or something is doing. "
    "Verbs are essential — every sentence needs at least one. "
    "They can show physical actions (run, jump, eat), mental actions (think, remember), "
    "or states of being (is, am, are)."
)

TEACHER_MONDAY_SORT_LABELS = ["Long A (ai)", "Long E (ee)", "Long E (ea)"]

TEACHER_MONDAY_SORT_ANSWERS = [
    ["railroad", "rainbow", "rainfall", "staircase", "mailbox", "mainland"],
    ["sweater", "teacher", "street"],
    ["cheese", "cheerful", "beefsteak"],
]

TEACHER_MONDAY_FILL_ANSWERS = ["rainbow", "railroad", "teacher", "sweater"]

TEACHER_MONDAY_OPPOSITE_ANSWERS = [
    ("cheerful", "sad"),
    ("mainland", "island"),
]

TEACHER_MONDAY_SENTENCE_WORDS = ["railroad", "rainbow", "rainfall", "staircase"]

# Tuesday
TEACHER_TUESDAY_PHONICS_EXPLANATION = (
    "Students continue building fluency with vowel team patterns. "
    "Today's focus shifts from identification to APPLICATION — finding vowel teams "
    "in context (reading passage), discriminating them from other patterns (Pattern Hunt), "
    "and using them in original sentences."
)

TEACHER_TUESDAY_SCRAMBLE_ANSWERS = [
    ("roalidrr", "railroad"),
    ("wobrain", "rainbow"),
    ("lfailran", "rainfall"),
    ("casestiar", "staircase"),
    ("bxailmo", "mailbox"),
    ("landmain", "mainland"),
    ("etawsre", "sweater"),
    ("eartcheh", "teacher"),
    ("teesrt", "street"),
    ("eesech", "cheese"),
    ("rehfulec", "cheerful"),
    ("sebtaekf", "beefsteak"),
]

TEACHER_TUESDAY_COMP_QUESTIONS = [
    "What is the secret to a good garden?",
    "What vegetables is the narrator growing?",
    "How does the railroad steam help the garden?",
]

TEACHER_TUESDAY_COMP_ANSWERS = [
    "Patience.",
    "Cheese pumpkins and beefsteak tomatoes.",
    "The steam from the trains keeps the frost away.",
]

TEACHER_TUESDAY_PATTERN_HUNT = {
    "match": ["railroad", "rainbow", "rainfall", "staircase", "mailbox", "mainland",
              "sweater", "teacher", "street", "cheese", "cheerful", "beefsteak"],
    "decoy": [],
}

TEACHER_TUESDAY_SWAP_ANSWERS = [
    "teacher, rainbow",
    "cheese, street",
    "cheerful, rainfall",
]

TEACHER_TUESDAY_BUILDER_PROMPTS = [
    ("Write a sentence about a rainbow.", "rainbow"),
    ("Write a sentence about being cheerful.", "cheerful"),
    ("Write a sentence about the railroad.", "railroad"),
]

# Wednesday
TEACHER_WEDNESDAY_PHONICS_EXPLANATION = (
    "Mid-week deepening. Students now move beyond recognition into ANALYSIS — "
    "understanding word relationships (synonyms/antonyms), connecting vocabulary (word web), "
    "and applying listening skills (dictation). This is where the vowel team knowledge becomes functional."
)

TEACHER_WEDNESDAY_VOCAB_Q_QUESTION = (
    "In the sentence 'Everyone was cheerful,' what does cheerful mean?"
)

TEACHER_WEDNESDAY_VOCAB_Q_ANSWER = "B) Happy and in a good mood"

TEACHER_WEDNESDAY_SYN_ANT_WORDS = ["cheerful", "rainbow", "staircase", "teacher", "street", "railroad"]

TEACHER_WEDNESDAY_WORD_WEB_CENTER = "teacher"

TEACHER_WEDNESDAY_WORD_WEB_SUGGESTIONS = [
    "school", "learn", "classroom", "student", "lesson", "help", "read", "book", "teach", "study"
]

TEACHER_WEDNESDAY_SORT_ANSWERS = {
    "sentences": [
        "The teacher showed us the beautiful rainbow",
        "We rode the railroad across the mainland",
    ],
    "correct_order": [
        "The teacher showed us the beautiful rainbow.",
        "We rode the railroad across the mainland.",
    ],
}

TEACHER_WEDNESDAY_CORRECT_ANSWERS = [
    ("the teacher eats cheese on the street.", "The teacher eats cheese on the street."),
    ("we saw a rainbow after the rainfall.", "We saw a rainbow after the rainfall."),
    ("she climbs the tall staircase.", "She climbs the tall staircase."),
]

TEACHER_WEDNESDAY_FILL_ANSWERS = ["teacher", "rainbow", "sweater"]

TEACHER_WEDNESDAY_CONTEXT_CLUE_QUESTION = (
    "In 'After the long rainfall, the children ran outside to see the beautiful rainbow,' what does rainfall mean?"
)

TEACHER_WEDNESDAY_CONTEXT_CLUE_ANSWER = "B) Rain that falls from the sky"

TEACHER_WEDNESDAY_DICTATION_WORDS = ["railroad", "rainbow", "staircase", "mailbox", "sweater", "cheese"]

# Thursday
TEACHER_THURSDAY_PHONICS_EXPLANATION = (
    "Production day. Students have now seen and practiced the vowel team patterns for 3 days — "
    "today they actively CREATE with them. Spelling Detective builds metacognition "
    "(thinking about how they think about spelling). Spelling Maps teach word analysis. "
    "Paragraph writing brings it all together."
)

TEACHER_THURSDAY_COMP_QUESTIONS = [
    "What contest is happening on Saturday?",
    "Where did the teacher get her recipe?",
    "What signals the start of the cooking?",
]

TEACHER_THURSDAY_COMP_ANSWERS = [
    "The cheese and beefsteak recipe contest.",
    "From her grandma on the mainland.",
    "The railroad whistle blows at noon.",
]

TEACHER_THURSDAY_SORT_ANSWERS = {
    "sentences": ["The teacher showed us the beautiful rainbow", "We rode the railroad across the mainland"],
    "correct_order": ["The teacher showed us the beautiful rainbow.", "We rode the railroad across the mainland."],
}

TEACHER_THURSDAY_DETECTIVE_ANSWERS = [
    ("rallroad", "railroad"),
    ("rainbou", "rainbow"),
    ("rainfll", "rainfall"),
    ("staircse", "staircase"),
    ("mialbox", "mailbox"),
    ("sweaer", "sweater"),
    ("techer", "teacher"),
    ("chease", "cheese"),
]

TEACHER_THURSDAY_SWAP_ANSWERS = [
    "teacher, staircase",
    "rainbow, rainfall",
]

TEACHER_THURSDAY_MAP_WORD = "rainbow"

TEACHER_THURSDAY_MAP_SUGGESTIONS = [
    "rain-bow (2 syllables)",
    "rain (contains the AI vowel team = long A)",
    "bow (ow team)",
    "Related words: rainbow, rainbows",
]

TEACHER_THURSDAY_PARA_PROMPTS = [
    "Write a paragraph about your favorite trip.",
    "Write a paragraph about a cheerful day.",
]

# Friday
TEACHER_FRIDAY_PHONICS_EXPLANATION = (
    "Review and assessment day. All 12 words are tested through the spelling test, "
    "but the full worksheet also reviews reading comprehension, vocabulary, "
    "and writing skills from the week. The goal is to see what stuck and what needs "
    "more practice next week."
)

TEACHER_FRIDAY_TEST_ANSWERS = [
    "railroad", "rainbow", "rainfall", "staircase", "mailbox", "mainland",
    "sweater", "teacher", "street", "cheese", "cheerful", "beefsteak",
]

TEACHER_FRIDAY_STORY_QUESTIONS = [
    "What did the student see after the rainfall?",
    "What did they paint in the art room?",
    "What was the student's lunch?",
]

TEACHER_FRIDAY_STORY_ANSWERS = [
    "A rainbow.",
    "Paintings of the railroad.",
    "Cheese and beefsteak.",
]

TEACHER_FRIDAY_OPPOSITE_ANSWERS = [
    ("cheerful", "sad"),
    ("mainland", "island"),
    ("street", "alley"),
]

TEACHER_FRIDAY_BUILDER_WORDS = ["railroad", "rainbow", "teacher", "cheerful"]

TEACHER_FRIDAY_JOURNAL_WORDS = ["staircase", "mailbox", "sweater", "cheese"]

# =====================================================================
# VALIDATION DATA
# =====================================================================
FILL_DATA = MONDAY_FILL_DATA
DETECTIVE_WORDS = THURSDAY_DETECTIVE
DETECTIVE_ANSWERS = ["railroad", "rainbow", "rainfall", "staircase", "mailbox", "sweater", "teacher", "cheese"]
OPPOSITE_PAIRS = [("cheerful", "sad"), ("mainland", "island")]
LEARNING_EXAMPLES = ["railroad", "sweater", "cheese"]
BREAKDOWNS = {
    "railroad": "r-ai-l-r-o-a-d",
    "cheese": "ch-ee-s-e",
}

# =====================================================================
# GENERATE
# =====================================================================
def main():
    print("=" * 50)
    print("Week 3 Generator - Vowel Teams: AI, EE, EA")
    print("=" * 50)

def main():
    print("=" * 50)
    print("Week 3 Generator - Vowel Teams: AI, EE, EA")
    print("=" * 50)


    # Phonetic audit (verifies words against database)
    try:
        from audit.run_audit import validate_before_generate
        validate_before_generate(__file__)
    except ImportError:
        print("  [warn] audit system unavailable — skipping phonetic check")
    except Exception as e:
        print(f"\n  AUDIT FAILED: {e}")
        exit(1)

    # Validate
    errors = validate_week(
        words=WORDS, word_names=WORD_NAMES,
        fill_data=FILL_DATA,
        detective_words=DETECTIVE_WORDS, detective_answers=DETECTIVE_ANSWERS,
        opposite_pairs=OPPOSITE_PAIRS,
        learning_examples=LEARNING_EXAMPLES,
        breakdowns=BREAKDOWNS,
        generate_friday=lambda: None,
        phonetic_check=False
    )
    if errors:
        print("\nVALIDATION FAILED:")
        for e in errors:
            print(f"  - {e}")
        exit(1)
    print("Validation passed.\n")

    # Monday
    generate_monday(
        week_dir=WEEK, week_num=3, phonics_label=PHONICS_LABEL, words=WORDS,
        learning_text=LEARNING_TEXT, vowel_examples=VOWEL_EXAMPLES_MONDAY,
        grammar_note=GRAMMAR_NOTE, grammar_deep=GRAMMAR_DEEP,
        grammar_practice=MONDAY_GRAMMAR_PRACTICE,
        story_text=MONDAY_STORY, sort_labels=SORT_LABELS, sort_title=SORT_TITLE,
        fill_data=MONDAY_FILL_DATA, opposite_words=MONDAY_OPPOSITE_WORDS,
        sentence_words=MONDAY_SENTENCE_WORDS,
    )

    # Tuesday
    generate_tuesday(
        week_dir=WEEK, week_num=3, phonics_label=PHONICS_LABEL, words=WORDS,
        learning_text=TUESDAY_LEARNING, vowel_examples=VOWEL_EXAMPLES_TUE,
        remember_boxes=[TUESDAY_REMEMBER_1, TUESDAY_REMEMBER_2],
        reading_text=TUESDAY_READING, comp_questions=TUESDAY_COMP_QUESTIONS,
        swap_data=TUESDAY_SWAP_DATA, builder_prompts=TUESDAY_BUILDER_PROMPTS,
    )

    # Wednesday
    generate_wednesday(
        week_dir=WEEK, week_num=3, phonics_label=PHONICS_LABEL, words=WORDS,
        learning_text=WEDNESDAY_LEARNING, learning_skills=LEARNING_SKILLS_WED,
        reading_passage=WEDNESDAY_READING, vocab_question=WEDNESDAY_VOCAB_Q,
        syn_ant_words=WEDNESDAY_SYN_ANT, word_web_center="teacher",
        sentence_sort_data=WEDNESDAY_SORT_DATA, correct_sentences=WEDNESDAY_CORRECT,
        fill_data=WEDNESDAY_FILL, context_clue=WEDNESDAY_CONTEXT,
        dictation_words=WEDNESDAY_DICTATION,
    )

    # Thursday
    generate_thursday(
        week_dir=WEEK, week_num=3, phonics_label=PHONICS_LABEL, words=WORDS,
        learning_text=THURSDAY_LEARNING, remember_text=REMINDER_TEXT,
        story_text=THURSDAY_STORY, comp_questions=THURSDAY_COMP_QUESTIONS,
        sentence_sort_data=THURSDAY_SORT_DATA, detective_words=THURSDAY_DETECTIVE,
        swap_data=THURSDAY_SWAP_DATA, map_word="rainbow",
        para_prompts=THURSDAY_PARA_PROMPTS,
    )

    # Friday
    generate_friday(
        week_dir=WEEK, week_num=3, phonics_label=PHONICS_LABEL, words=WORDS,
        review_story=FRIDAY_REVIEW_STORY, story_questions=FRIDAY_STORY_QUESTIONS,
        opposite_words=FRIDAY_OPPOSITE_WORDS, builder_words=FRIDAY_BUILDER_WORDS,
        journal_words=FRIDAY_JOURNAL_WORDS,
    )

    # Teacher Guide
    generate_teacher_guide(
        week_dir=WEEK, week_num=3, phonics_label=PHONICS_LABEL, words=WORDS,
        phonics_name="Vowel Teams: AI, AY, EE, EA",

        # Monday
        monday_phonics_explanation=TEACHER_MONDAY_PHONICS_EXPLANATION,
        monday_grammar_focus=TEACHER_MONDAY_GRAMMAR_FOCUS,
        monday_grammar_explanation=TEACHER_MONDAY_GRAMMAR_EXPLANATION,
        monday_story_text=MONDAY_STORY,
        monday_sort_labels=TEACHER_MONDAY_SORT_LABELS,
        monday_sort_answers=TEACHER_MONDAY_SORT_ANSWERS,
        monday_fill_answers=TEACHER_MONDAY_FILL_ANSWERS,
        monday_opposite_answers=TEACHER_MONDAY_OPPOSITE_ANSWERS,
        monday_sentence_words=TEACHER_MONDAY_SENTENCE_WORDS,

        # Tuesday
        tuesday_phonics_explanation=TEACHER_TUESDAY_PHONICS_EXPLANATION,
        tuesday_scramble_answers=TEACHER_TUESDAY_SCRAMBLE_ANSWERS,
        tuesday_reading_text=TUESDAY_READING,
        tuesday_comp_questions=TEACHER_TUESDAY_COMP_QUESTIONS,
        tuesday_comp_answers=TEACHER_TUESDAY_COMP_ANSWERS,
        tuesday_pattern_hunt_answers=TEACHER_TUESDAY_PATTERN_HUNT,
        tuesday_swap_answers=TEACHER_TUESDAY_SWAP_ANSWERS,
        tuesday_builder_prompts=TEACHER_TUESDAY_BUILDER_PROMPTS,

        # Wednesday
        wednesday_phonics_explanation=TEACHER_WEDNESDAY_PHONICS_EXPLANATION,
        wednesday_vocab_q_question=TEACHER_WEDNESDAY_VOCAB_Q_QUESTION,
        wednesday_vocab_q_answer=TEACHER_WEDNESDAY_VOCAB_Q_ANSWER,
        wednesday_syn_ant_words=TEACHER_WEDNESDAY_SYN_ANT_WORDS,
        wednesday_word_web_center=TEACHER_WEDNESDAY_WORD_WEB_CENTER,
        wednesday_word_web_suggestions=TEACHER_WEDNESDAY_WORD_WEB_SUGGESTIONS,
        wednesday_sort_answers=TEACHER_WEDNESDAY_SORT_ANSWERS,
        wednesday_correct_answers=TEACHER_WEDNESDAY_CORRECT_ANSWERS,
        wednesday_fill_answers=TEACHER_WEDNESDAY_FILL_ANSWERS,
        wednesday_context_clue_question=TEACHER_WEDNESDAY_CONTEXT_CLUE_QUESTION,
        wednesday_context_clue_answer=TEACHER_WEDNESDAY_CONTEXT_CLUE_ANSWER,
        wednesday_dictation_words=TEACHER_WEDNESDAY_DICTATION_WORDS,

        # Thursday
        thursday_phonics_explanation=TEACHER_THURSDAY_PHONICS_EXPLANATION,
        thursday_comp_questions=TEACHER_THURSDAY_COMP_QUESTIONS,
        thursday_comp_answers=TEACHER_THURSDAY_COMP_ANSWERS,
        thursday_sort_answers=TEACHER_THURSDAY_SORT_ANSWERS,
        thursday_detective_answers=TEACHER_THURSDAY_DETECTIVE_ANSWERS,
        thursday_swap_answers=TEACHER_THURSDAY_SWAP_ANSWERS,
        thursday_map_word=TEACHER_THURSDAY_MAP_WORD,
        thursday_map_suggestions=TEACHER_THURSDAY_MAP_SUGGESTIONS,
        thursday_para_prompts=TEACHER_THURSDAY_PARA_PROMPTS,

        # Friday
        friday_phonics_explanation=TEACHER_FRIDAY_PHONICS_EXPLANATION,
        friday_test_answers=TEACHER_FRIDAY_TEST_ANSWERS,
        friday_story_questions=TEACHER_FRIDAY_STORY_QUESTIONS,
        friday_story_answers=TEACHER_FRIDAY_STORY_ANSWERS,
        friday_opposite_answers=TEACHER_FRIDAY_OPPOSITE_ANSWERS,
        friday_builder_words=TEACHER_FRIDAY_BUILDER_WORDS,
        friday_journal_words=TEACHER_FRIDAY_JOURNAL_WORDS,
    )

    print("\nAll done! Check Week_03/ for PDFs.")


if __name__ == "__main__":
    main()
