from cycler import cycler
from morethemes.fonts import set_family_from_file

darker_theme = {
    "name": "darker",
    "description": "A sleek, no-frills dark theme with high contrast and a modern feel",
    "author": "Joseph Barbier",
    "theme": {
        "font.family": set_family_from_file("Oswald.ttf"),
        "axes.spines.top": False,
        "axes.spines.right": False,
        "xtick.minor.visible": False,
        "xtick.major.size": 0,
        "ytick.major.size": 0,
        "ytick.minor.visible": False,
        "scatter.marker": "H",
        "lines.linewidth": 2.5,
        "axes.labelsize": 12,
        "axes.linewidth": 1.5,
        "text.color": "#fff",
        "axes.facecolor": "#282828",
        "figure.facecolor": "#282828",
        "axes.labelcolor": "#eeeeee",
        "axes.edgecolor": "#eeeeee",
        "xtick.color": "#eeeeee",
        "ytick.color": "#eeeeee",
        "axes.prop_cycle": cycler(
            "color", ["#FED789", "#A4BED5", "#72874E", "#023743", "#476F84", "#453947"]
        ),
    },
}


yellowish_theme = {
    "name": "yellowish",
    "description": "A bold, National Geographic-inspired theme with a warm yellow backdrop",
    "author": "Joseph Barbier",
    "theme": {
        "font.family": set_family_from_file("Delius.ttf"),
        "ytick.minor.visible": False,
        "xtick.minor.visible": False,
        "xtick.major.size": 0,
        "ytick.major.size": 0,
        "axes.spines.top": False,
        "axes.spines.right": False,
        "ytick.major.pad": 5,
        "xtick.major.pad": 5,
        "axes.grid": True,
        "grid.linewidth": 0.6,
        "grid.alpha": 0.6,
        "grid.linestyle": "-",
        "grid.color": "#bcbcbc",
        "axes.edgecolor": "#be1414",
        "axes.labelcolor": "#be1414",
        "axes.titlecolor": "#be1414",
        "text.color": "#be1414",
        "axes.facecolor": "#ffcc04",
        "figure.facecolor": "#ffcc04",
        "axes.linewidth": 1.2,
        "axes.prop_cycle": cycler(
            "color", ["#000000", "#555555", "#7e7e7e", "#b1b1b1", "#ececec"]
        ),
    },
}

urban_theme = {
    "name": "urban",
    "description": "A clean, professional theme featuring the Urbanist font and muted tones.",
    "author": "Joseph Barbier",
    "theme": {
        "font.family": set_family_from_file("Urbanist.ttf"),
        "ytick.minor.visible": False,
        "xtick.minor.visible": False,
        "xtick.major.size": 0,
        "ytick.major.size": 0,
        "ytick.major.pad": 5,
        "xtick.major.pad": 5,
        "axes.spines.top": False,
        "axes.spines.right": False,
        "axes.grid": True,
        "grid.linewidth": 0.6,
        "grid.alpha": 0.1,
        "grid.linestyle": "-",
        "axes.linewidth": 1.2,
        "grid.color": "#1e1d1d",
        "axes.edgecolor": "#efefef",
        "axes.facecolor": "#efefef",
        "figure.facecolor": "#efefef",
        "axes.prop_cycle": cycler(
            "color", ["#F56455", "#15134B", "#87C785", "#572F30"]
        ),
    },
}

wsj_theme = {
    "name": "wsj",
    "description": "A refined, newspaper-style theme inspired by the Wall Street Journal.",
    "author": "Joseph Barbier",
    "theme": {
        "font.family": set_family_from_file("Crimson.ttf"),
        "ytick.minor.visible": False,
        "xtick.minor.visible": False,
        "xtick.major.size": 0,
        "ytick.major.size": 0,
        "axes.spines.top": False,
        "axes.spines.right": False,
        "axes.spines.left": False,
        "ytick.major.pad": 5,
        "xtick.major.pad": 5,
        "axes.grid": True,
        "grid.linewidth": 0.8,
        "grid.linestyle": "-",
        "axes.linewidth": 1.2,
        "grid.alpha": 0.1,
        "grid.color": "#1e1d1d",
        "axes.edgecolor": "#1f1f1f",
        "axes.facecolor": "#f8ecdc",
        "figure.facecolor": "#f8ecdc",
        "axes.prop_cycle": cycler(
            "color",
            [
                "#855C75",
                "#D9AF6B",
                "#AF6458",
                "#736F4C",
                "#526A83",
                "#625377",
                "#68855C",
                "#9C9C5E",
                "#A06177",
                "#8C785D",
                "#467378",
                "#7C7C7C",
            ],
        ),
    },
}

economist_theme = {
    "name": "economist",
    "description": "A crisp, data-focused theme with subtle gridlines and sharp contrasts.",
    "author": "Joseph Barbier",
    "theme": {
        "font.family": set_family_from_file("RobotoFlex.ttf"),
        "ytick.minor.visible": False,
        "xtick.minor.visible": True,
        "xtick.major.size": 6,
        "xtick.minor.size": 3,
        "ytick.major.size": 0,
        "axes.spines.top": False,
        "axes.spines.right": False,
        "axes.spines.left": False,
        "ytick.major.pad": 5,
        "xtick.major.pad": 5,
        "axes.grid": True,
        "grid.linewidth": 0.4,
        "grid.linestyle": "-",
        "axes.linewidth": 1.2,
        "axes.grid.axis": "y",
        "text.color": "#3d3d3d",
        "grid.color": "#989797",
        "axes.edgecolor": "#1f1f1f",
        "axes.facecolor": "#e8f4f4",
        "figure.facecolor": "#e8f4f4",
        "axes.prop_cycle": cycler(
            "color",
            [
                "#DB444B",
                "#006BA2",
                "#3EBCD2",
                "#379A8B",
                "#EBB434",
                "#B4BA39",
                "#9A607F",
                "#D1B07C",
                "#758D99",
            ],
        ),
    },
}

minimal_theme = {
    "name": "minimal",
    "description": "A pure, distraction-free theme with a simple monochrome palette.",
    "author": "Joseph Barbier",
    "theme": {
        "font.family": set_family_from_file("Inter.ttf"),
        "ytick.minor.visible": False,
        "xtick.minor.visible": False,
        "xtick.major.size": 0,
        "ytick.major.size": 0,
        "axes.spines.top": False,
        "axes.spines.right": False,
        "axes.spines.left": False,
        "axes.spines.bottom": False,
        "ytick.major.pad": 5,
        "xtick.major.pad": 5,
        "axes.grid": True,
        "grid.linewidth": 0.8,
        "grid.linestyle": "-",
        "grid.alpha": 0.1,
        "axes.linewidth": 1.2,
        "grid.color": "#383838",
        "text.color": "#000000",
        "axes.edgecolor": "#000000",
        "axes.facecolor": "#ffffff",
        "figure.facecolor": "#ffffff",
        "axes.prop_cycle": cycler(
            "color",
            ["#678096", "#ACC2CF", "#CD5733", "#979461", "#A12A19"],
        ),
    },
}

lex_theme = {
    "name": "lex",
    "description": "A sophisticated, no-nonsense theme with a muted palette and strong typographic clarity, echoing the Financial Times' aesthetic.",
    "author": "Joseph Barbier",
    "theme": {
        "font.family": set_family_from_file("NotoSans.ttf"),
        "ytick.minor.visible": False,
        "xtick.minor.visible": False,
        "xtick.major.size": 10,
        "ytick.major.size": 0,
        "axes.spines.top": False,
        "axes.spines.right": False,
        "axes.spines.left": False,
        "axes.spines.bottom": True,
        "ytick.major.pad": 5,
        "xtick.major.pad": 5,
        "axes.grid": False,
        "lines.linewidth": 2.5,
        "axes.linewidth": 0.8,
        "text.color": "#ebebeb",
        "axes.labelcolor": "#a2a2a2",
        "axes.edgecolor": "#a2a2a2",
        "xtick.color": "#a2a2a2",
        "ytick.color": "#a2a2a2",
        "axes.facecolor": "#302c34",
        "figure.facecolor": "#302c34",
        "axes.prop_cycle": cycler(
            "color",
            ["#f4245c", "#FF8811", "#9DD9D2", "#046E8F"],
        ),
    },
}

retro_theme = {
    "name": "retro",
    "description": "A nostalgic theme inspired by vintage graphics and retro gaming.",
    "author": "Joseph Barbier",
    "theme": {
        "font.family": set_family_from_file("VT323.ttf"),
        "axes.spines.top": False,
        "axes.spines.right": False,
        "xtick.minor.visible": False,
        "ytick.minor.visible": False,
        "xtick.major.size": 5,
        "ytick.major.size": 5,
        "axes.grid": True,
        "grid.linewidth": 1.0,
        "grid.linestyle": ":",
        "grid.color": "#cccccc",
        "axes.linewidth": 1.5,
        "axes.facecolor": "#000033",
        "figure.facecolor": "#000033",
        "text.color": "#ffffff",
        "axes.labelcolor": "#ffffff",
        "axes.edgecolor": "#ffffff",
        "xtick.color": "#ffffff",
        "ytick.color": "#ffffff",
        "axes.prop_cycle": cycler(
            "color",
            ["#FF69B4", "#00FF00", "#00FFFF", "#FFD700", "#FF4500"],  # Neon colors
        ),
    },
}

nature_theme = {
    "name": "nature",
    "description": "A calming theme inspired by natural landscapes, with earthy tones and organic shapes.",
    "author": "Joseph Barbier",
    "theme": {
        "font.family": set_family_from_file("Quicksand.ttf"),
        "axes.spines.top": False,
        "axes.spines.right": False,
        "xtick.minor.visible": False,
        "ytick.minor.visible": False,
        "xtick.major.size": 4,
        "ytick.major.size": 4,
        "axes.grid": True,
        "grid.linewidth": 0.5,
        "grid.linestyle": "--",
        "grid.alpha": 0.2,
        "grid.color": "#656565",
        "axes.edgecolor": "#A9A9A9",
        "axes.facecolor": "#F5F5DC",
        "figure.facecolor": "#F5F5DC",
        "axes.prop_cycle": cycler(
            "color", ["#6B8E23", "#3D9970", "#8B4513", "#87CEEB", "#FFD700", "#FFA500"]
        ),
        "text.color": "#3D9970",
        "axes.labelcolor": "#3D9970",
        "axes.titlecolor": "#3D9970",
    },
}

monoblue_theme = {
    "name": "monoblue",
    "description": "A high-contrast theme using shades of blue to emphasize data trends and maintain a clean, professional aesthetic.",
    "author": "Your Name",
    "theme": {
        "font.family": set_family_from_file("Roboto-Regular.ttf"),
        "axes.spines.top": False,
        "axes.spines.right": False,
        "xtick.minor.visible": False,
        "xtick.major.size": 5,
        "ytick.major.size": 5,
        "ytick.minor.visible": False,
        "scatter.marker": "o",
        "lines.linewidth": 2.0,
        "axes.labelsize": 12,
        "axes.linewidth": 1.0,
        "text.color": "#002060",
        "axes.facecolor": "#EBF5FF",
        "figure.facecolor": "#EBF5FF",
        "axes.labelcolor": "#002060",
        "axes.edgecolor": "#002060",
        "xtick.color": "#002060",
        "ytick.color": "#002060",
        "axes.prop_cycle": cycler(
            "color", ["#002060", "#4682B4", "#ADD8E6", "#B0C4DE", "#778899"]
        ),
    },
}


ALL_THEMES = {
    "darker": darker_theme,
    "yellowish": yellowish_theme,
    "urban": urban_theme,
    "wsj": wsj_theme,
    "economist": economist_theme,
    "minimal": minimal_theme,
    "lex": lex_theme,
    "retro": retro_theme,
    "nature": nature_theme,
    "monoblue": monoblue_theme,
}
