package dev.lions.user.manager.client.view;

import jakarta.enterprise.context.SessionScoped;
import jakarta.inject.Named;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Named("guestPreferences")
@SessionScoped
public class GuestPreferences implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    private String theme = "blue-light";
    private String layout = "light";
    private String componentTheme = "blue-light";
    private String darkMode = "light";
    private String menuMode = "layout-sidebar";
    private String topbarTheme = "light";
    private String menuTheme = "light";
    private String inputStyle = "outlined";
    private boolean lightLogo = false;
    
    public String getTheme() {
        return theme;
    }
    
    public void setTheme(String theme) {
        this.theme = theme;
    }
    
    public String getLayout() {
        return layout;
    }
    
    public void setLayout(String layout) {
        this.layout = layout;
    }
    
    public String getComponentTheme() {
        return componentTheme;
    }
    
    public void setComponentTheme(String componentTheme) {
        this.componentTheme = componentTheme;
    }
    
    public String getDarkMode() {
        return darkMode;
    }
    
    public void setDarkMode(String darkMode) {
        this.darkMode = darkMode;
        this.lightLogo = "dark".equals(darkMode);
    }
    
    public String getMenuMode() {
        return menuMode;
    }
    
    public void setMenuMode(String menuMode) {
        this.menuMode = menuMode;
    }
    
    public String getTopbarTheme() {
        return topbarTheme;
    }
    
    public void setTopbarTheme(String topbarTheme) {
        this.topbarTheme = topbarTheme;
    }
    
    public String getMenuTheme() {
        return menuTheme;
    }
    
    public void setMenuTheme(String menuTheme) {
        this.menuTheme = menuTheme;
    }
    
    public String getInputStyle() {
        return inputStyle;
    }
    
    public void setInputStyle(String inputStyle) {
        this.inputStyle = inputStyle;
    }
    
    public boolean isLightLogo() {
        return lightLogo;
    }
    
    public void setLightLogo(boolean lightLogo) {
        this.lightLogo = lightLogo;
    }
    
    public String getInputStyleClass() {
        return "p-input-" + inputStyle;
    }
    
    public String getLayoutClass() {
        return "layout-" + layout + " layout-theme-" + theme;
    }
    
    public List<ComponentTheme> getComponentThemes() {
        List<ComponentTheme> themes = new ArrayList<>();
        themes.add(new ComponentTheme("blue-light", "Blue", "#007ad9"));
        themes.add(new ComponentTheme("green-light", "Green", "#28a745"));
        themes.add(new ComponentTheme("orange-light", "Orange", "#fd7e14"));
        themes.add(new ComponentTheme("purple-light", "Purple", "#6f42c1"));
        themes.add(new ComponentTheme("pink-light", "Pink", "#e83e8c"));
        themes.add(new ComponentTheme("indigo-light", "Indigo", "#6610f2"));
        themes.add(new ComponentTheme("teal-light", "Teal", "#20c997"));
        themes.add(new ComponentTheme("cyan-light", "Cyan", "#17a2b8"));
        return themes;
    }
    
    public void onMenuTypeChange() {
        // Called when menu type changes
    }
    
    public static class ComponentTheme {
        private String file;
        private String name;
        private String color;
        
        public ComponentTheme(String file, String name, String color) {
            this.file = file;
            this.name = name;
            this.color = color;
        }
        
        public String getFile() {
            return file;
        }
        
        public String getName() {
            return name;
        }
        
        public String getColor() {
            return color;
        }
    }
}

