package com.ai.da.model.enums;

import java.util.*;

public class StyleKeywordMapper {

    private static final Map<StyleEnum, Map<String, List<String>>> styleCategoryKeywords = new HashMap<>();

    static {
        Map<String, List<String>> neoChineseKeywords = new HashMap<>();
        neoChineseKeywords.put("Moodboard", Arrays.asList("New Chinese"));
        neoChineseKeywords.put("Printboard", Arrays.asList("New Chinese", "traditional Chinese patterns", "dragons and phoenixes", "longevity peaches", "cloud patterns"));
        neoChineseKeywords.put("Sketchboard", Arrays.asList("New Chinese", "blouse", "bow tie", "stand-up collars", "cross collars", "Chinese buttons"));

        Map<String, List<String>> countryStyleKeywords = new HashMap<>();
        countryStyleKeywords.put("Moodboard", Arrays.asList("Pastoral style"));
        countryStyleKeywords.put("Printboard", Arrays.asList("fresh and natural feeling", "floral"));
        countryStyleKeywords.put("Sketchboard", Arrays.asList("soft and comfortable", "chiffon", "cotton"));

        Map<String, List<String>> futurismKeywords = new HashMap<>();
        futurismKeywords.put("Moodboard", Arrays.asList("high-tech", "luminous"));
        futurismKeywords.put("Printboard", Arrays.asList("geometric patterns", "lines and structured designs", "silver", "gold", "copper"));
        futurismKeywords.put("Sketchboard", Arrays.asList("high tech", "exaggerated cutting", "three-dimensional design"));

        Map<String, List<String>> minimalistKeywords = new HashMap<>();
        minimalistKeywords.put("Moodboard", Arrays.asList("Minimalist style"));
        minimalistKeywords.put("Printboard", Arrays.asList("Minimalist black and white"));
        minimalistKeywords.put("Sketchboard", Arrays.asList("soft and breathable"));

        Map<String, List<String>> lolitaKeywords = new HashMap<>();
        lolitaKeywords.put("Moodboard", Arrays.asList("Lolita style"));
        lolitaKeywords.put("Printboard", Arrays.asList("gentle", "cute", "elegant", "floral print"));
        lolitaKeywords.put("Sketchboard", Arrays.asList("Layered skirts", "puff sleeves", "bows"));

        Map<String, List<String>> y2kKeywords = new HashMap<>();
        y2kKeywords.put("Moodboard", Arrays.asList("Y2K Style"));
        y2kKeywords.put("Printboard", Arrays.asList("highly saturated colors", "glossy fabrics", "reflective fabrics"));
        y2kKeywords.put("Sketchboard", Arrays.asList("low-waist miniskirts"));

        Map<String, List<String>> businessKeywords = new HashMap<>();
        businessKeywords.put("Moodboard", Arrays.asList("Business-style"));
        businessKeywords.put("Printboard", Arrays.asList("colors are mostly black", "white", "gray", "dark blue", "brown", "neutral tones"));
        businessKeywords.put("Sketchboard", Arrays.asList("simple and smooth lines"));

        Map<String, List<String>> merladKeywords = new HashMap<>();
        merladKeywords.put("Moodboard", Arrays.asList("Maillard Style"));
        merladKeywords.put("Printboard", Arrays.asList("colors of Maillard-style clothing are mainly brown", "matched with tan", "reddish brown", "yellowish brown", "leopard print", "plaid"));
        merladKeywords.put("Sketchboard", Arrays.asList("wide shoulder design", "extra-long cuts"));

        Map<String, List<String>> outdoorFunctionalKeywords = new HashMap<>();
        outdoorFunctionalKeywords.put("Moodboard", Arrays.asList("outdoor functional"));
        outdoorFunctionalKeywords.put("Printboard", Arrays.asList("Simple"));
        outdoorFunctionalKeywords.put("Sketchboard", Arrays.asList("multiple pocket designs"));

        Map<String, List<String>> rockKeywords = new HashMap<>();
        rockKeywords.put("Moodboard", Arrays.asList("rock-style"));
        rockKeywords.put("Printboard", Arrays.asList("printed patterns include skulls", "flames", "music elements", "rock culture symbols"));
        rockKeywords.put("Sketchboard", Arrays.asList("Leather"));

        Map<String, List<String>> dopamineKeywords = new HashMap<>();
        dopamineKeywords.put("Moodboard", Arrays.asList("dopamine-style"));
        dopamineKeywords.put("Printboard", Arrays.asList("bright and highly saturated colors such as red", "orange", "yellow", "Cute and playful patterns such as flowers", "fruits", "animals"));
        dopamineKeywords.put("Sketchboard", Arrays.asList("sequins", "beads", "metal decorations", "cheerful and lively atmosphere"));

        Map<String, List<String>> gothicKeywords = new HashMap<>();
        gothicKeywords.put("Moodboard", Arrays.asList("Gothic style"));
        gothicKeywords.put("Printboard", Arrays.asList("deep and dark colors", "such as black", "dark purple", "dark red", "religious or mysterious patterns or prints such as crosses", "shackles", "bats", "skulls"));
        gothicKeywords.put("Sketchboard", Arrays.asList("mysterious and gloomy atmosphere", "lines and layers"));

        Map<String, List<String>> postApocalypticKeywords = new HashMap<>();
        postApocalypticKeywords.put("Moodboard", Arrays.asList("wasteland style"));
        postApocalypticKeywords.put("Printboard", Arrays.asList("damage", "graffiti", "smearing", "retro printing", "showing a shabby", "decadent", "cold appearance"));
        postApocalypticKeywords.put("Sketchboard", Arrays.asList("a gloomy and heavy feeling"));

        Map<String, List<String>> romanticKeywords = new HashMap<>();
        romanticKeywords.put("Moodboard", Arrays.asList("Romantic style"));
        romanticKeywords.put("Printboard", Arrays.asList("softness", "warmth and romance", "colors such as pink", "lavender", "light blue", "beige"));
        romanticKeywords.put("Sketchboard", Arrays.asList("X-shaped and A-shaped silhouettes", "organza", "satin"));

        Map<String, List<String>> wabiSabiKeywords = new HashMap<>();
        wabiSabiKeywords.put("Moodboard", Arrays.asList("Wabi-Sabi style"));
        wabiSabiKeywords.put("Printboard", Arrays.asList("natural materials such as wood", "stone", "hemp rope", "neutral tones and light colors"));
        wabiSabiKeywords.put("Sketchboard", Arrays.asList("a quiet and peaceful atmosphere"));

        styleCategoryKeywords.put(StyleEnum.NEW_CHINESE, neoChineseKeywords);
        styleCategoryKeywords.put(StyleEnum.COUNTRY_STYLE, countryStyleKeywords);
        styleCategoryKeywords.put(StyleEnum.FUTURISM, futurismKeywords);
        styleCategoryKeywords.put(StyleEnum.MINIMALISM, minimalistKeywords);
        styleCategoryKeywords.put(StyleEnum.LOLITA, lolitaKeywords);
        styleCategoryKeywords.put(StyleEnum.Y2K, y2kKeywords);
        styleCategoryKeywords.put(StyleEnum.BUSINESS, businessKeywords);
        styleCategoryKeywords.put(StyleEnum.MERLAD, merladKeywords);
        styleCategoryKeywords.put(StyleEnum.OUTDOOR_FUNCTIONAL, outdoorFunctionalKeywords);
        styleCategoryKeywords.put(StyleEnum.ROCK, rockKeywords);
        styleCategoryKeywords.put(StyleEnum.DOPAMINE, dopamineKeywords);
        styleCategoryKeywords.put(StyleEnum.GOTHIC, gothicKeywords);
        styleCategoryKeywords.put(StyleEnum.POST_APOCALYPTIC, postApocalypticKeywords);
        styleCategoryKeywords.put(StyleEnum.ROMANTIC, romanticKeywords);
        styleCategoryKeywords.put(StyleEnum.WABI_SABI, wabiSabiKeywords);
    }

    public static List<String> getKeywords(StyleEnum style, String category) {
        Map<String, List<String>> categoryKeywords = styleCategoryKeywords.get(style);
        if (categoryKeywords != null) {
            List<String> keywords = categoryKeywords.get(category);
            if (keywords != null) {
                return keywords;
            }
        }
        return Collections.emptyList();
    }

    public static Map<String, List<String>> getAllKeywordsByStyle(StyleEnum style) {
        Map<String, List<String>> allKeywords = new HashMap<>();
        allKeywords.put("Moodboard", getKeywords(style, "Moodboard"));
        allKeywords.put("Printboard", getKeywords(style, "Printboard"));
        allKeywords.put("Sketchboard", getKeywords(style, "Sketchboard"));
        return allKeywords;
    }
}
