#!/usr/bin/env python3
"""Week 14 Generator - Synonyms

Phonics: Finding words with similar meanings to improve expression
Spelling: 12 words paired with their synonyms (all 6+ letters)
Grammar: Compound sentences with "and," "but," "so"
"""

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_14")

# =====================================================================
# WORD LIST - 12 words, all 6+ letters, Synonyms
# =====================================================================
WORDS = [
    ("beautiful", "suffix_ful", "very pleasant to look at"),
    ("enormous", "suffix_ous", "extremely large in size"),
    ("friendly", "suffix_ly", "pleasant and helpful to others"),
    ("quickly", "suffix_ly", "moving or happening at high speed"),
    ("amazing", "suffix_ing", "causing great surprise or admiration"),
    ("delicious", "suffix_ious", "having a pleasant flavor"),
    ("grateful", "suffix_ful", "feeling or showing appreciation"),
    ("powerful", "suffix_ful", "having great strength or force"),
    ("wonderful", "suffix_ful", "extremely good or pleasing"),
    ("valuable", "suffix_able", "worth a lot or very important"),
    ("carefully", "suffix_ly", "done with attention and caution"),
    ("brilliant", "double_consonant", "shining brightly or very clever"),
]

WORD_NAMES = [w[0] for w in WORDS]
PHONICS_LABEL = "Synonyms"

# =====================================================================
# SHARED CONTENT DATA
# =====================================================================
LEARNING_TEXT = (
    "<strong>Synonyms</strong> are words that have the same or very similar meanings.<br>"
    "Using synonyms makes your reading and writing more interesting!<br>"
    "Tip: When you see a word you know, think of another word that means the same thing."
)

GRAMMAR_NOTE = (
    'Grammar: <strong>Compound Sentences</strong> join two complete ideas using '
    '<em>and, but, so</em>. Example: The sun was <strong>brilliant</strong>, <strong>and</strong> the sky was clear.'
)

GRAMMAR_DEEP = (
    'Compound Sentences join two complete ideas (called independent clauses) with a coordinating conjunction.<br><br>'
    '&bull; <strong>and</strong> &mdash; adds information &mdash; The food was <em>delicious</em>, <strong>and</strong> everyone enjoyed it.<br>'
    '&bull; <strong>but</strong> &mdash; shows contrast &mdash; The storm was <em>powerful</em>, <strong>but</strong> no one was hurt.<br>'
    '&bull; <strong>so</strong> &mdash; shows result &mdash; The gift was <em>valuable</em>, <strong>so</strong> she kept it safe.<br><br>'
    'Rule: Two complete sentences + comma + and/but/so = compound sentence!'
)

SYNONYM_EXAMPLES_MONDAY = [
    '<strong>beautiful</strong> &mdash; same as <em>lovely</em>',
    '<strong>enormous</strong> &mdash; same as <em>huge</em>',
    '<strong>friendly</strong> &mdash; same as <em>kind</em>',
    '<strong>quickly</strong> &mdash; same as <em>fast</em>',
    '<strong>amazing</strong> &mdash; same as <em>incredible</em>',
    '<strong>delicious</strong> &mdash; same as <em>tasty</em>',
    '<strong>grateful</strong> &mdash; same as <em>thankful</em>',
    '<strong>powerful</strong> &mdash; same as <em>strong</em>',
    '<strong>wonderful</strong> &mdash; same as <em>fantastic</em>',
    '<strong>valuable</strong> &mdash; same as <em>precious</em>',
    '<strong>carefully</strong> &mdash; same as <em>cautiously</em>',
    '<strong>brilliant</strong> &mdash; same as <em>bright</em>',
]

SYNONYM_EXAMPLES_TUE = SYNONYM_EXAMPLES_MONDAY

SORT_LABELS = ["positive", "describing size", "describing speed", "describing taste", "describing feelings", "describing appearance"]
SORT_TITLE = "Synonym Category Sort"

LEARNING_SKILLS_WED = [
    "<strong>Reading</strong> &mdash; understand vocabulary in context",
    "<strong>Synonyms</strong> &mdash; words with the same or similar meanings",
    "<strong>Word Relationships</strong> &mdash; connecting related vocabulary",
]

REMINDER_TEXT = (
    "Synonym Tips:<br><br>"
    "1. Synonyms have the <strong>same or similar meaning</strong>.<br>"
    "2. <strong>beautiful</strong> = lovely &mdash; both describe something pleasant to see<br>"
    "3. <strong>enormous</strong> = huge &mdash; both describe something very large<br>"
    "4. <strong>friendly</strong> = kind &mdash; both describe someone pleasant<br>"
    "5. <strong>quickly</strong> = fast &mdash; both describe speed<br>"
    "6. <strong>amazing</strong> = incredible &mdash; both describe something surprising<br>"
    "7. <strong>delicious</strong> = tasty &mdash; both describe good flavor<br>"
    "8. <strong>grateful</strong> = thankful &mdash; both describe appreciation<br>"
    "9. <strong>powerful</strong> = strong &mdash; both describe great strength<br>"
    "10. <strong>wonderful</strong> = fantastic &mdash; both describe something excellent<br>"
    "11. <strong>carefully</strong> = cautiously &mdash; both describe being careful<br>"
    "12. <strong>brilliant</strong> = bright &mdash; both describe shining light<br><br>"
    "Remember: using synonyms makes your writing more interesting!"
)

# =====================================================================
# MONDAY DATA - Nature exploration theme
# =====================================================================
MONDAY_STORY = (
    'On Saturday, we visited the <strong>beautiful</strong> nature preserve. '
    'An <strong>enormous</strong> tree stood at the entrance, its branches reaching to the sky. '
    'The <strong>friendly</strong> guide showed us around, pointing out every <strong>amazing</strong> sight. '
    'We walked <strong>quickly</strong> along the trail to reach the waterfall. '
    'The view was <strong>wonderful</strong> &mdash; water falling from great heights. '
    'Lunch was <strong>delicious</strong> &mdash; sandwiches made by my <strong>grateful</strong> grandmother. '
    'She was <strong>powerful</strong> — carrying our snacks and maps all day. '
    'The river had <strong>valuable</strong> rocks that sparkled in the sun. '
    'We crossed the bridge <strong>carefully</strong>, holding on to the railings. '
    'The sun was <strong>brilliant</strong> that afternoon, and the birds sang their songs.'
)

MONDAY_GRAMMAR_PRACTICE = [
    "The food was delicious and everyone enjoyed it",
    "The storm was powerful but no one was hurt",
    "The gift was valuable so she kept it safe",
]

MONDAY_FILL_DATA = [
    ("The garden was so ____ with colorful flowers.", "beautiful"),
    ("The elephant is an ____ animal.", "enormous"),
    ("My ____ neighbor helped me move the boxes.", "friendly"),
    ("The runner finished the race ____.", "quickly"),
]

MONDAY_OPPOSITE_WORDS = ["beautiful", "enormous", "carefully"]
MONDAY_SENTENCE_WORDS = WORD_NAMES[:4]

# =====================================================================
# TUESDAY DATA - Community theme
# =====================================================================
TUESDAY_LEARNING = (
    "Today we practice our Synonym Words. For each word, find its partner "
    "that means the same thing. Then use both words in sentences."
)

TUESDAY_READING = (
    'Our town had a <strong>beautiful</strong> park in the center. '
    'An <strong>enormous</strong> oak tree provided shade for everyone. '
    'The <strong>friendly</strong> librarian Ms. Parker hosted a reading club. '
    'Books flew <strong>quickly</strong> off the shelves every week. '
    'The children were <strong>grateful</strong> for the free stories. '
    'The food at the library picnic was <strong>delicious</strong>. '
    'Ms. Parker said, &quot;Reading is a <strong>valuable</strong> skill.&quot; '
    'We listened <strong>carefully</strong> to every word. '
    'The sun was <strong>brilliant</strong> that day. '
    'It was an <strong>amazing</strong> experience for all the children. '
    'What a <strong>wonderful</strong> community we have!'
)

TUESDAY_COMP_QUESTIONS = [
    "What was at the center of the town park?",
    "Who hosted the reading club?",
    "Why were the children grateful?",
]

TUESDAY_REMEMBER_1 = (
    "Remember This!",
    '<table style="width:100%;border-collapse:separate;border-spacing:4px;font-size:11px;"><tr>'
    '<td style="vertical-align;top;width:50%;">'
    'Synonym Pairs:<br>'
    '- <strong>beautiful</strong> = lovely<br>'
    '- <strong>enormous</strong> = huge<br>'
    '- <strong>friendly</strong> = kind<br>'
    '- <strong>quickly</strong> = fast<br>'
    '</td>'
    '<td style="vertical-align;top;width:50%;">'
    '- <strong>delicious</strong> = tasty<br>'
    '- <strong>grateful</strong> = thankful<br>'
    '- <strong>powerful</strong> = strong<br>'
    '- <strong>brilliant</strong> = bright<br><br>'
    '<strong>Try This:</strong> What is a synonym for "amazing"? ___'
    '</td>'
    '</tr></table>'
)

TUESDAY_REMEMBER_2 = (
    "Remember This!",
    '<table style="width:100%;border-collapse:separate;border-spacing:4px;font-size:11px;"><tr>'
    '<td style="vertical-align;top;width:50%;">'
    'Compound Sentences use and/but/so:<br><br>'
    'The food was delicious, <strong>and</strong> we ate more.<br>'
    'The storm was powerful, <strong>but</strong> we stayed safe.<br>'
    '</td>'
    '<td style="vertical-align;top;width:50%;">'
    'The gift was valuable, <strong>so</strong> I kept it.<br><br>'
    '<strong>Try This:</strong> Write a compound sentence using "and." ___'
    '</td>'
    '</tr></table>'
)

TUESDAY_SWAP_DATA = [
    ("The beautiful garden had enormous trees.", ("beautiful", "wonderful"), ("enormous", "powerful")),
    ("The friendly librarian helped us quickly.", ("friendly", "grateful"), ("quickly", "carefully")),
    ("The delicious food was valuable to the family.", ("delicious", "brilliant"), ("valuable", "amazing")),
]

TUESDAY_BUILDER_PROMPTS = [
    ("Write a sentence describing a place.", "beautiful"),
    ("Write a sentence about someone helpful.", "friendly"),
    ("Write a compound sentence using 'but'.", "powerful"),
]

# =====================================================================
# WEDNESDAY DATA - Adventure theme
# =====================================================================
WEDNESDAY_LEARNING = (
    "Today we use our Synonym Words in reading and writing. "
    "Practice finding the right word for every situation."
)

WEDNESDAY_READING = (
    'The <strong>amazing</strong> adventure began at dawn. '
    'We packed our <strong>valuable</strong> supplies and set out <strong>quickly</strong>. '
    'The mountains ahead were <strong>beautiful</strong> and <strong>enormous</strong>. '
    'Our guide was <strong>friendly</strong> and knew every trail. '
    'We climbed <strong>carefully</strong> up the rocky path. '
    'At the summit, the view was <strong>brilliant</strong>. '
    'The sun shone <strong>brilliant</strong> on the lake below. '
    'Dinner was <strong>delicious</strong> &mdash; soup and bread from our backpack. '
    'We were <strong>grateful</strong> for such a <strong>wonderful</strong> day. '
    'The adventure had been <strong>powerful</strong> and exciting.'
)

WEDNESDAY_VOCAB_Q = (
    "In the sentence 'The mountains ahead were beautiful and enormous,' what do the synonyms tell us?<br><br>"
    "A) The mountains were small and ugly<br>"
    "B) The mountains were pleasing to see and very large<br>"
    "C) The mountains were far away<br>"
    "D) The mountains were made of rocks"
)

WEDNESDAY_SYN_ANT = ["beautiful", "enormous", "friendly", "quickly", "delicious", "grateful"]

WEDNESDAY_SORT_DATA = [
    "The amazing adventure began at dawn",
    "The view was brilliant from the summit",
]

WEDNESDAY_CORRECT = [
    "the beautiful garden had enormous trees.",
    "my friendly neighbor helped us quickly.",
    "the delicious food made us grateful.",
]

WEDNESDAY_FILL = [
    ("The view from the top was ____.", "brilliant"),
    ("We climbed the mountain ____.", "carefully"),
    ("The food was ____ after the long hike.", "delicious"),
]

WEDNESDAY_CONTEXT = (
    'Read this sentence: "She was grateful for the gift." <br><br>'
    "What does <strong>grateful</strong> mean?<br>"
    "A) Angry about the gift<br>"
    "B) Feeling thankful for something<br>"
    "C) Not interested in the gift<br>"
    "D) Surprised by the gift"
)

WEDNESDAY_DICTATION = ["beautiful", "enormous", "friendly", "quickly", "delicious", "grateful"]

# =====================================================================
# THURSDAY DATA - Storytelling theme
# =====================================================================
THURSDAY_LEARNING = (
    "Today we use our Synonym Words in original stories and writing. "
    "Choose the best word for every situation."
)

THURSDAY_STORY = (
    'Once upon a time, a <strong>beautiful</strong> forest hid a <strong>valuable</strong> treasure. '
    'An <strong>enormous</strong> tree guarded the path. '
    'The <strong>friendly</strong> animals of the forest helped those who asked nicely. '
    'A young explorer walked <strong>quickly</strong> toward the tree. '
    'She had <strong>carefully</strong> planned her journey. '
    'The treasure was <strong>delicious</strong> berries that healed any illness. '
    'The explorer was <strong>grateful</strong> and promised to share them. '
    'Her adventure was <strong>amazing</strong> and <strong>wonderful</strong>. '
    'The sun was <strong>brilliant</strong> as she returned home. '
    'What a <strong>powerful</strong> story the forest told!'
)

THURSDAY_COMP_QUESTIONS = [
    "What guarded the path in the forest?",
    "What was the treasure?",
    "What did the explorer promise to do?",
]

THURSDAY_SORT_DATA = [
    "The beautiful forest hid a valuable treasure",
    "The friendly animals helped the explorer",
]

THURSDAY_DETECTIVE = [
    "beutiful", "enorms", "frindly", "quckly", "amzing", "delicios",
    "gratful", "powerfl", "wonderfl", "valuabel", "carefll", "briliant"
]

THURSDAY_SWAP_DATA = [
    ("The beautiful garden had enormous trees.", ("beautiful", "wonderful"), ("enormous", "amazing")),
    ("The friendly guide walked quickly.", ("friendly", "grateful"), ("quickly", "carefully")),
]

THURSDAY_PARA_PROMPTS = [
    "Write a paragraph describing a beautiful place you would like to visit.",
    "Write a paragraph about a friendly person in your life.",
]

# =====================================================================
# FRIDAY DATA - Review and celebration
# =====================================================================
FRIDAY_REVIEW_STORY = (
    'On Friday, our class had a <strong>beautiful</strong> spelling celebration. '
    'The <strong>enormous</strong> poster on the wall showed all our synonym pairs. '
    'The <strong>friendly</strong> teacher praised every student. '
    'We completed the test <strong>quickly</strong> and <strong>carefully</strong>. '
    'The celebration snack was <strong>delicious</strong>. '
    'Everyone was <strong>grateful</strong> for the learning we had done. '
    'It was an <strong>amazing</strong> and <strong>wonderful</strong> day. '
    'The sun was <strong>brilliant</strong> outside the windows. '
    'Our class had become <strong>powerful</strong> readers and writers. '
    'What <strong>valuable</strong> skills we have learned!'
)

FRIDAY_STORY_QUESTIONS = [
    "What showed all the synonym pairs?",
    "How did the students complete the test?",
    "What skills had the class learned?",
]

FRIDAY_OPPOSITE_WORDS = ["beautiful", "enormous", "carefully"]
FRIDAY_BUILDER_WORDS = ["amazing", "wonderful", "delicious", "friendly"]
FRIDAY_JOURNAL_WORDS = ["grateful", "valuable", "brilliant", "powerful"]

# =====================================================================
# TEACHER GUIDE DATA
# =====================================================================
TEACHER_MONDAY_PHONICS_EXPLANATION = (
    "SYNONYMS are words with the same or very similar meanings. Using synonyms "
    "enriches vocabulary and makes writing more interesting.<br><br>"
    "&bull; <strong>beautiful</strong> = lovely &mdash; very pleasant to look at<br>"
    "&bull; <strong>enormous</strong> = huge &mdash; extremely large in size<br>"
    "&bull; <strong>friendly</strong> = kind &mdash; pleasant and helpful to others<br>"
    "&bull; <strong>quickly</strong> = fast &mdash; moving or happening at high speed<br>"
    "&bull; <strong>amazing</strong> = incredible &mdash; causing great surprise or admiration<br>"
    "&bull; <strong>delicious</strong> = tasty &mdash; having a pleasant flavor<br>"
    "&bull; <strong>grateful</strong> = thankful &mdash; feeling or showing appreciation<br>"
    "&bull; <strong>powerful</strong> = strong &mdash; having great strength or force<br>"
    "&bull; <strong>wonderful</strong> = fantastic &mdash; extremely good or pleasing<br>"
    "&bull; <strong>valuable</strong> = precious &mdash; worth a lot or very important<br>"
    "&bull; <strong>carefully</strong> = cautiously &mdash; done with attention and caution<br>"
    "&bull; <strong>brilliant</strong> = bright &mdash; shining brightly or very clever<br><br>"
    "Important: Teach students to think of synonyms as word partners. "
    "Practice substituting synonyms in sentences to build fluency."
)

TEACHER_MONDAY_GRAMMAR_FOCUS = "Compound Sentences -- Joining Ideas with And, But, So"

TEACHER_MONDAY_GRAMMAR_EXPLANATION = (
    "Compound sentences join two complete ideas (independent clauses) with a comma and a "
    "coordinating conjunction.<br><br>"
    "The three main conjunctions: <strong>and, but, so</strong><br><br>"
    "&bull; <strong>and</strong> adds information: The food was delicious, and we ate more.<br>"
    "&bull; <strong>but</strong> shows contrast: The storm was powerful, but we stayed safe.<br>"
    "&bull; <strong>so</strong> shows result: The gift was valuable, so I kept it safe.<br><br>"
    "Rule: Complete sentence + comma + and/but/so + complete sentence = compound sentence."
)

TEACHER_MONDAY_SORT_LABELS = ["positive", "describing size", "describing speed", "describing taste", "describing feelings", "describing appearance"]

TEACHER_MONDAY_SORT_ANSWERS = [
    ["beautiful", "friendly", "wonderful", "delicious", "amazing"],
    ["enormous"],
    ["quickly", "carefully"],
    ["delicious"],
    ["grateful"],
    ["beautiful", "brilliant"],
]

TEACHER_MONDAY_FILL_ANSWERS = ["beautiful", "enormous", "friendly", "quickly"]

TEACHER_MONDAY_OPPOSITE_ANSWERS = [
    ("beautiful", "ugly"),
    ("enormous", "tiny"),
    ("carefully", "carelessly"),
]

TEACHER_MONDAY_SENTENCE_WORDS = ["beautiful", "enormous", "friendly", "quickly"]

# Tuesday
TEACHER_TUESDAY_PHONICS_EXPLANATION = (
    "Students continue building synonym fluency. Today's focus shifts from identification "
    "to APPLICATION &mdash; finding synonyms in context (reading passage), discriminating "
    "synonyms from non-synonyms (Pattern Hunt), and using them in original sentences (Builder)."
)

TEACHER_TUESDAY_SCRAMBLE_ANSWERS = [
    ("fiulbtea", "beautiful"),
    ("rousneme", "enormous"),
    ("ndliyrfe", "friendly"),
    ("ylkciuq", "quickly"),
    ("azimngam", "amazing"),
    ("cedilious", "delicious"),
    ("ratgeful", "grateful"),
    ("rlefuowp", "powerful"),
    ("dlufnwro", "wonderful"),
    ("luevaabl", "valuable"),
    ("fluyercea", "carefully"),
    ("tnairlilrb", "brilliant"),
]

TEACHER_TUESDAY_COMP_QUESTIONS = [
    "What was at the center of the town park?",
    "Who hosted the reading club?",
    "Why were the children grateful?",
]

TEACHER_TUESDAY_COMP_ANSWERS = [
    "A beautiful park with an enormous oak tree.",
    "The friendly librarian Ms. Parker.",
    "For the free stories at the library reading club.",
]

TEACHER_TUESDAY_PATTERN_HUNT = {
    "match": ["beautiful", "enormous", "friendly", "quickly", "amazing", "delicious", "grateful", "powerful", "wonderful", "valuable", "carefully", "brilliant"],
    "decoy": ["cat", "run", "big", "happy", "fast"],
}

TEACHER_TUESDAY_SWAP_ANSWERS = [
    "wonderful, powerful",
    "grateful, carefully",
    "brilliant, amazing",
]

TEACHER_TUESDAY_BUILDER_PROMPTS = [
    ("Write a sentence describing a place.", "beautiful"),
    ("Write a sentence about someone helpful.", "friendly"),
    ("Write a compound sentence using 'but'.", "powerful"),
]

# Wednesday
TEACHER_WEDNESDAY_PHONICS_EXPLANATION = (
    "Mid-week deepening. Students now move beyond recognition into ANALYSIS &mdash; "
    "understanding word relationships (synonym substitution), connecting vocabulary (word web), "
    "and applying listening skills (dictation). This is where synonym knowledge becomes functional."
)

TEACHER_WEDNESDAY_VOCAB_Q_QUESTION = (
    "In 'The mountains ahead were beautiful and enormous,' what do the synonyms tell us?"
)

TEACHER_WEDNESDAY_VOCAB_Q_ANSWER = "B) The mountains were pleasing to see and very large"

TEACHER_WEDNESDAY_SYN_ANT_WORDS = ["beautiful", "enormous", "friendly", "quickly", "delicious", "grateful"]

TEACHER_WEDNESDAY_WORD_WEB_CENTER = "describing words"

TEACHER_WEDNESDAY_WORD_WEB_SUGGESTIONS = [
    "beautiful", "enormous", "friendly", "quickly", "amazing", "delicious",
    "grateful", "powerful", "wonderful", "valuable", "carefully", "brilliant"
]

TEACHER_WEDNESDAY_SORT_ANSWERS = {
    "sentences": [
        "The amazing adventure began at dawn",
        "The view was brilliant from the summit",
    ],
    "correct_order": [
        "The amazing adventure began at dawn.",
        "The view was brilliant from the summit.",
    ],
}

TEACHER_WEDNESDAY_CORRECT_ANSWERS = [
    ("the beautiful garden had enormous trees.", "The beautiful garden had enormous trees."),
    ("my friendly neighbor helped us quickly.", "My friendly neighbor helped us quickly."),
    ("the delicious food made us grateful.", "The delicious food made us grateful."),
]

TEACHER_WEDNESDAY_FILL_ANSWERS = ["brilliant", "carefully", "delicious"]

TEACHER_WEDNESDAY_CONTEXT_CLUE_QUESTION = (
    "In 'She was grateful for the gift,' what does grateful mean?"
)

TEACHER_WEDNESDAY_CONTEXT_CLUE_ANSWER = "B) Feeling thankful for something"

# Thursday
TEACHER_THURSDAY_PHONICS_EXPLANATION = (
    "Students apply synonym knowledge in writing contexts. They choose the best word "
    "for each situation, write original stories, and find misspelled words."
)

TEACHER_THURSDAY_DETECTIVE_ANSWERS = [
    ("beutiful", "beautiful"),
    ("enorms", "enormous"),
    ("frindly", "friendly"),
    ("quckly", "quickly"),
    ("amzing", "amazing"),
    ("delicios", "delicious"),
    ("gratful", "grateful"),
    ("powerfl", "powerful"),
    ("wonderfl", "wonderful"),
    ("valuabel", "valuable"),
    ("carefll", "carefully"),
    ("briliant", "brilliant"),
]

TEACHER_THURSDAY_COMP_QUESTIONS = [
    "What guarded the path in the forest?",
    "What was the treasure?",
    "What did the explorer promise to do?",
]

TEACHER_THURSDAY_COMP_ANSWERS = [
    "An enormous tree guarded the path.",
    "Delicious berries that healed any illness.",
    "She promised to share them with others.",
]

# Friday
TEACHER_FRIDAY_REVIEW_STORY_QUESTIONS = [
    "What showed all the synonym pairs?",
    "How did the students complete the test?",
    "What skills had the class learned?",
]

TEACHER_FRIDAY_REVIEW_STORY_ANSWERS = [
    "The enormous poster on the wall.",
    "Quickly and carefully.",
    "Reading and writing skills (valuable skills).",
]

TEACHER_FRIDAY_OPPOSITE_ANSWERS = [
    ("beautiful", "ugly"),
    ("enormous", "tiny"),
    ("carefully", "carelessly"),
]

# =====================================================================
# GENERATE ALL DAYS
# =====================================================================
if __name__ == "__main__":
    # Generate each day
    print("Generating Monday...")
    generate_monday(week_dir=WEEK, week_num=14, phonics_label=PHONICS_LABEL, words=WORDS,
                    learning_text=LEARNING_TEXT, vowel_examples=SYNONYM_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)

    print("Generating Tuesday...")
    generate_tuesday(week_dir=WEEK, week_num=14, phonics_label=PHONICS_LABEL, words=WORDS,
                     learning_text=TUESDAY_LEARNING, vowel_examples=SYNONYM_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)

    print("Generating Wednesday...")
    generate_wednesday(week_dir=WEEK, week_num=14, 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="describing words",
                       sentence_sort_data=WEDNESDAY_SORT_DATA,
                       correct_sentences=WEDNESDAY_CORRECT,
                       fill_data=WEDNESDAY_FILL,
                       context_clue=WEDNESDAY_CONTEXT)

    print("Generating Thursday...")
    generate_thursday(week_dir=WEEK, week_num=14, phonics_label=PHONICS_LABEL, words=WORDS,
                      learning_text=THURSDAY_LEARNING,
                      remember_text=REMINDER_TEXT,
                      story_text=THURSDAY_STORY,
                      comp_questions=THURSDAY_COMP_QUESTIONS,
                      map_word="synonym",
                      sentence_sort_data=THURSDAY_SORT_DATA,
                      detective_words=THURSDAY_DETECTIVE,
                      swap_data=THURSDAY_SWAP_DATA,
                      para_prompts=THURSDAY_PARA_PROMPTS)

    print("Generating Friday...")
    generate_friday(week_dir=WEEK, week_num=14, 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)

    # Friday phonics explanation
    TEACHER_FRIDAY_PHONICS_EXPLANATION = (
        "Friday is review day. Students demonstrate mastery of all synonym words "
        "through reading, spelling, and writing activities. Celebrate their progress!"
    )

    print("Generating Teacher Guide...")
    generate_teacher_guide(week_dir=WEEK, week_num=14, phonics_label=PHONICS_LABEL, words=WORDS,
                           monday_phonics_explanation=TEACHER_MONDAY_PHONICS_EXPLANATION,
                           monday_grammar_focus=TEACHER_MONDAY_GRAMMAR_FOCUS,
                           monday_grammar_explanation=TEACHER_MONDAY_GRAMMAR_EXPLANATION,
                           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_phonics_explanation=TEACHER_TUESDAY_PHONICS_EXPLANATION,
                           tuesday_scramble_answers=TEACHER_TUESDAY_SCRAMBLE_ANSWERS,
                           tuesday_comp_questions=TEACHER_TUESDAY_COMP_QUESTIONS,
                           tuesday_comp_answers=TEACHER_TUESDAY_COMP_ANSWERS,
                           tuesday_pattern_hunt=TEACHER_TUESDAY_PATTERN_HUNT,
                           tuesday_swap_answers=TEACHER_TUESDAY_SWAP_ANSWERS,
                           tuesday_builder_prompts=TEACHER_TUESDAY_BUILDER_PROMPTS,
                           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,
                           thursday_phonics_explanation=TEACHER_THURSDAY_PHONICS_EXPLANATION,
                           thursday_detective_answers=TEACHER_THURSDAY_DETECTIVE_ANSWERS,
                           thursday_comp_questions=TEACHER_THURSDAY_COMP_QUESTIONS,
                           thursday_comp_answers=TEACHER_THURSDAY_COMP_ANSWERS,
                           friday_review_story_questions=TEACHER_FRIDAY_REVIEW_STORY_QUESTIONS,
                           friday_review_story_answers=TEACHER_FRIDAY_REVIEW_STORY_ANSWERS,
                           friday_opposite_answers=TEACHER_FRIDAY_OPPOSITE_ANSWERS,
                           friday_phonics_explanation=TEACHER_FRIDAY_PHONICS_EXPLANATION)

    print("Validating week...")
    word_names = [w[0] for w in WORDS]
    errors = validate_week(words=WORDS, word_names=word_names, phonetic_check=False)
    if errors:
        for e in errors:
            print(f"  [error] {e}")
        exit(1)
    print("[ok] All validation passed")

    print("Week 14 generation complete!")