import random

# Dictionary containing activity recommendations based on different moods
ACTIVITY_RECOMMENDATIONS = {
    "happy": ["Go for a walk in the park", 
                "Attend a friend's party", 
                "Try out new hobbies", 
                "Listen to your favorite music",
                "Try something creative",
                "Exercise or play a sport",
                "Enjoy a favorite meal, dessert, or relaxing spa day",
                "Call or meet up with a friend and spread the joy",
                "Dance, sing along, or just vibe to the beat",
                "Take a spontaneous trip",
                "Help a friend, volunteer, or surprise someone with a small gift",
                "Watch a funny movie, read jokes, or play games",
                "Write in a journal",
                "Dance, sing along, or just vibe to the beat of your favorite playlist",
                "Take a spontaneous trip to a nearby city or go on a road trip",
                "Write a letter to your future self describing why you’re happy today and include small mementos. Open it in a year!",
                "Choose a recipe that makes you feel nostalgic (like grandma’s chocolate chip cookies), but add a fun twist—maybe sprinkles, sea salt, or stuffing them with caramel!",
                "Put on an upbeat playlist, stand in front of a mirror, and challenge yourself to a freestyle dance-off with exaggerated moves",
                "Pick a random theme (like “yellow objects” or “things shaped like hearts”) and take 10 cool photos around your home or neighborhood",
                "Write a 'Love Letter' to Your Favorite Thing",
                "Plan a 'Random Act of Kindness Scavenger Hunt'",
                "Turn Your Bed into a 'Movie Nest'",
                "Have a Picnic with Yourself",
                "Mix different juices, sodas, or teas to create a signature drink, and give it a funny name",
                "Write Down '50 Things That Make You Smile'",
                "Make a 'Memory Mixtape'",
                "Buy a Silly Small Gift for Yourself",
                "Recreate an Iconic Scene from a Movie"],
        
    
    "sad": ["Write in a journal", 
            "Meditate",
            "Get fresh air to clear your mind",
            "Watch a comforting movie",
            "Share how you feel with someone who cares",
            "Practice deep breathing",
            "Draw, paint, write, or play music to channel your feelings into art",
            "A little movement, like stretching, yoga, or a short walk, can boost your mood",
            "Cuddle with a pet",
            "Watch cute animal videos",
            "Draw, paint, write, or play music to channel your feelings into art",
            "A little movement, like stretching, yoga, or a short walk, can boost your mood",
            "Cuddle with a pet or watch cute animal videos to lift your spirits",
            "Try aromatherapy with calming scents like lavender or chamomile",
            "Read an uplifting book or listen to a soothing podcast",
            "Light candles, dim the lights, and take a long, warm bath",
            "Cook your comfort food and enjoy it mindfully",
            "Do something nostalgic, like revisiting old childhood photos or watching childhood cartoons",
            "Go outside and find the smallest detail to appreciate like a tiny flower in the sidewalk crack or the way the wind moves through the trees",
            "Put on the coziest socks you own and walk slowly around your house while focusing on the warmth and softness",
            "Write a list of all the things you have survived in life that you once thought you wouldn’t be able to get through",
            "Eat something with an unusual texture like a crunchy bell pepper or a chewy mochi and focus entirely on the way it feels in your mouth",
            "Watch a sad movie that allows you to cry fully and give yourself permission to release all your emotions without judgment",
            "Doodle random shapes and then turn them into little creatures or faces to surprise yourself with silly artwork",
            "Pick up a book and read one sentence aloud in the most dramatic voice possible as if you’re performing on a theater stage",
            "Find a childhood snack you haven’t had in years and eat it while imagining you are your younger self",
            "Open your phone’s voice recorder and talk to yourself as if you were your own best friend giving advice and comfort",
            "Pick a random word and search for it in a photo gallery or Pinterest to discover beautiful images related to it"],
    
    "stressed": ["Do deep breathing exercises", 
                 "Practice yoga", 
                 "Drink a hot cup of tea",
                 "Go for a walk or exercise",
                 "Play calming music, nature sounds, or even white noise to create a relaxing atmosphere",
                 "Take a warm shower or bath",
                 "Disconnect from screens and take a break from social media",
                 "Watch a funny movie or stand-up comedy to lighten your mood",
                 "Try aromatherapy with lavender or chamomile scents",
                 "Write down what's stressing you and break it into smaller, manageable steps",
                 "Watch a funny movie, stand-up comedy, or lighthearted TV show to distract yourself",
                 "Try aromatherapy with lavender or peppermint essential oils",
                 "Write down what's stressing you and break it into smaller, manageable steps",
                 "Spend time with animals, whether it's your pet or visiting an animal shelter",
                 "Declutter your workspace or bedroom for a sense of control",
                 "Do progressive muscle relaxation exercises to ease tension",
                 "Take a quick nap or power nap if you're feeling overwhelmed",
                 "Hold an ice cube in your hand and focus entirely on the sensation until it melts to ground yourself in the present moment",
                 "Squeeze a pillow tightly for ten seconds, then release and notice the relaxation in your arms",
                "Write down everything on your mind in a notebook without worrying about grammar or structure",
                "Stretch your arms above your head, then slowly roll your shoulders forward and backward",
                "Listen to a calming song with headphones and focus only on one instrument at a time",
                "Drink a warm cup of herbal tea and pay attention to the warmth spreading through your body",
                "Find a scented lotion and slowly massage it into your hands while breathing deeply",
                "Hold an ice cube in your hand and focus on its cold sensation as a way to reset your mind",
                "Do five slow jumping jacks, focusing on the movement of your body and the way your muscles feel",
                "Light a candle and watch the flame flicker while taking slow, steady breaths",
                "Stand in front of a window, look outside, and count all the different colors you can see",
                "Take five minutes to declutter a small space, like a desk or a drawer, and appreciate the order",
                "Write a single sentence about something good in your life and read it out loud three times",
                "Put a spoon in the freezer for a few minutes, then press it against your forehead to refresh yourself",
                "Hug yourself tightly, cross your arms over your chest, and gently rock side to side",
                "Doodle a simple repetitive pattern, like spirals or waves, to calm your mind",
                "Bite into a slice of citrus fruit and focus on the burst of flavor and freshness",
                "Lay down flat on the floor, close your eyes, and imagine yourself sinking into the ground like a heavy stone"],
    
    "bored": ["Try out a new hobby like painting, knitting, or photography", 
              "Learn a new skill through an online course or tutorial",
              "Read a book or listen to an audiobook",
              "Cook or bake something new and experiment with different recipes",
              "Explore a new place in your city or take a spontaneous road trip",
              "Solve a puzzle, play a board game, or try an escape room challenge",
              "Write a short story, poem, or start a blog",
              "Declutter and reorganize your room for a fresh start",
              "Volunteer for a local cause or help someone in need",
              "Challenge yourself with a DIY project or build something creative",
              "Volunteer for a local cause or help someone in need",
              "Challenge yourself with a DIY project or build something creative",
              "Try a new form of exercise like rock climbing, skating, or kickboxing",
              "Create a vision board with your goals and inspirations",
              "Play an instrument or learn a new song on guitar, piano, or another instrument",
              "Rearrange your phone apps in a completely new order and see how it feels to navigate differently",
              "Open your fridge and try to create a totally new snack using three random ingredients",
              "Take a piece of paper, fold it in half, and draw half of a face, then unfold and complete it in the weirdest way possible",
              "Type a random word into YouTube and watch the strangest video that comes up",
              "Learn how to say hello and goodbye in five new languages",
              "Set a timer for five minutes and try to list 50 things that are blue",
              "Put on two songs you love and pretend you're a music video director planning a scene for them",
              "Go outside and count how many different bird sounds you can hear",
              "Try to juggle with socks or any soft objects you can find",
              "Text a friend with only emojis and see if they can understand what you’re saying",
              "Find an old receipt in your wallet and make up a story about the person who bought those items",
              "Put a spoonful of peanut butter or Nutella on a cracker and eat it in the slowest, most dramatic way possible",
              "Close your eyes, scribble on a piece of paper, then try to turn it into a meaningful drawing",
              "Find a ridiculous conspiracy theory online and read about it just for fun",
              "Open a book to a random page, point at a sentence, and try to use it as an inspirational life quote",
              "Stand in front of a mirror and practice raising one eyebrow until you master it"],
    
    "motivated": ["Set a new goal and plan out the steps to achieve it", 
                  "Hit the gym or do an intense workout",
                  "Read an inspiring book or listen to a motivational podcast",
                  "Write down affirmations or visualize your success",
                  "Work on a passion project or learn a new skill",
                  "Surround yourself with like-minded, driven people",
                  "Watch TED talks or success stories to fuel your drive",
                  "Organize your workspace and create a productive environment",
                  "Surround yourself with like-minded, driven people to stay motivated",
                  "Watch TED talks, motivational speeches, or success stories",
                  "Organize your workspace and create a productive environment",
                  "Take an online masterclass in something that interests you",
                  "Join a challenge, like a 30-day fitness or personal growth challenge",
                  "Celebrate small wins to keep momentum going",
                  "Create a motivational playlist with pump-up songs to keep you going",
                  "Make a to-do list with three high-priority tasks and start the first one immediately",
                  "Set a 25-minute timer and challenge yourself to complete as much work as possible before it goes off",
                  "Record a short voice memo to your future self about why you feel motivated right now",
                  "Write down your biggest goal, then break it into five small, actionable steps",
                  "Do 10 push-ups or jumping jacks to channel your energy into movement",
                  "Create a vision board with images and words that represent your dreams and goals",
                  "Clean your workspace for five minutes to create a fresh and organized environment",
                  "Write an encouraging message to yourself and set it as your phone’s lock screen",
                  "Make a playlist of songs that make you feel unstoppable and play it while you work",
                  "Find a mentor or expert in your field and watch a short video of their advice",
                  "Write an email or message to someone you admire and tell them how they inspire you",
                  "Take a blank page and brainstorm as many creative ideas as possible in five minutes",
                  "Read one chapter of a self-improvement or business book and take notes",
                  "Make a progress tracker for a long-term goal and check off one small milestone",
                  "Record a short video of yourself talking about your goals to keep as a reminder",
                  "Spend 10 minutes learning a new skill related to your passion or career",
                  "Write down three things you have accomplished recently and take a moment to appreciate them",
                  "Set a bold challenge for yourself and commit to completing it by the end of the day",
                  "Reach out to a like-minded friend and discuss your goals or ideas",
                  "Stand in front of a mirror, smile, and say out loud why you believe in yourself"],
                  
    "angry": ["Do a high-intensity workout or go for a run", 
              "Write down your thoughts, then tear up the paper or burn it safely", 
              "Listen to aggressive music or play an instrument to release tension",
              "Practice controlled breathing exercises",
              "Hit a punching bag or squeeze a stress ball",
              "Take a cold shower to reset your emotions",
              "Talk it out with someone you trust",
              "Engage in a creative activity like painting, writing, or playing a video game to redirect your energy",
              "Engage in a creative activity like painting, writing, or playing a video game to redirect your energy",
              "Go for a long drive with your favorite music blasting",
              "Try guided meditation focused on anger management",
              "Walk outside or be in nature to physically distance yourself from the frustration",
              "Practice gratitude by listing things you’re thankful for",
              "Write an unsent letter to express your feelings privately",
              "Take a deep breath, hold it for four seconds, then exhale slowly for eight seconds, repeating five times",
              "Scream into a pillow as loudly as you can to release pent-up frustration",
              "Write down everything making you angry, then rip the paper into tiny pieces",
              "Go for a fast-paced walk and focus on each step hitting the ground",
              "Punch or squeeze a stress ball as hard as possible until you feel the tension release",
              "Put on an intense workout video and push yourself physically",
              "Play loud, aggressive music and jump around or headbang to let out energy",
              "Clench your fists for five seconds, then slowly release while focusing on the feeling",
              "Splash cold water on your face to shock your system into a calmer state",
              "Count backward from 100 in threes to shift your mind away from anger",
              "Doodle or scribble furiously on a piece of paper until the page is full",
              "Find something heavy and safe to lift, like a weighted object or resistance band",
              "Write an angry letter to the person or situation upsetting you, then destroy it",
              "Bite into something crunchy like an apple or carrot to physically exert frustration",
              "Go to a quiet place and scream silently with your mouth open",
              "Tightly wrap yourself in a blanket or hug yourself to feel secure",
              "Do a wall push-up or plank and hold until your muscles start burning",
              "Stomp your feet hard on the ground like a child throwing a tantrum",
              "Take slow sips of ice-cold water and feel it move down your throat",
              "Visualize your anger as a red ball of energy and imagine shrinking it down to nothing"]

}

"""
    Given a mood, recommend a random book from the corresponding category.

    Parameters:
        mood (str): The user's current mood.
    
    Returns:
        str: A recommended book title.
"""

def recommend_activity(mood: str) -> str:
    mood = mood.capitalize()  # Ensure consistency in capitalization
    return random.choice(ACTIVITY_RECOMMENDATIONS.get(mood.lower(), ["Try something new!"]))
