import React, { createContext, useContext, useEffect } from "react"; export interface ThemeConfig { id: "mint" | "prod"; code: string; name: string; accent: string; accentHover: string; accentText: string; accentGlow: string; badgeBg: string; badgeBorder: string; badgeText: string; buttonBg: string; buttonText: string; chartColor1: string; chartColor2: string; chartColor3: string; chartColor4: string; chartColor5: string; bgGradientFrom: string; bgGradientTo: string; heroOrbitalColor: string; heroOrbitalColor2: string; tagline: string; taglineHighlight: string; description: string; } export const MINT_THEME: ThemeConfig = { id: "mint", code: "03 Mint", name: "Bioluminescent Mint", accent: "#00e5bc", accentHover: "#34d399", accentText: "#00e5bc", accentGlow: "rgba(0, 229, 188, 0.4)", badgeBg: "rgba(0, 229, 188, 0.12)", badgeBorder: "rgba(0, 229, 188, 0.3)", badgeText: "#00e5bc", buttonBg: "#00e5bc", buttonText: "#05070a", chartColor1: "#00e5bc", chartColor2: "#10b981", chartColor3: "#a78bfa", chartColor4: "#64748b", chartColor5: "#334155", bgGradientFrom: "rgba(0, 229, 188, 0.12)", bgGradientTo: "rgba(16, 185, 129, 0.05)", heroOrbitalColor: "#00e5bc", heroOrbitalColor2: "#a78bfa", tagline: "Keep growth", taglineHighlight: "healthy.", description: "Autonomous outbound infrastructure with reputation shielding, multi-mailbox rotation, and live sequence telemetry.", }; /** Module S platform palette — the original "prod indigo" identity, preserved. */ export const PROD_THEME: ThemeConfig = { id: "prod", code: "01 Prod", name: "Prod Indigo", accent: "#6366f1", accentHover: "#818cf8", accentText: "#a5b4fc", accentGlow: "rgba(99, 102, 241, 0.4)", badgeBg: "rgba(99, 102, 241, 0.12)", badgeBorder: "rgba(99, 102, 241, 0.3)", badgeText: "#a5b4fc", buttonBg: "#6366f1", buttonText: "#ffffff", chartColor1: "#818cf8", chartColor2: "#6366f1", chartColor3: "#22d3ee", chartColor4: "#64748b", chartColor5: "#334155", bgGradientFrom: "rgba(99, 102, 241, 0.14)", bgGradientTo: "rgba(56, 189, 248, 0.05)", heroOrbitalColor: "#818cf8", heroOrbitalColor2: "#22d3ee", tagline: "Ship outbound", taglineHighlight: "faster.", description: "Advanced campaign management, sequences, unified inbox, email warmup, lead database, analytics, and webhook automation.", }; interface ThemeContextType { theme: "mint" | "prod"; config: ThemeConfig; } export const ThemeContext = createContext({ theme: "mint", config: MINT_THEME, }); /** Applies a module palette to CSS custom properties consumed by chrome + primitives. */ export function applyThemeVars(config: ThemeConfig) { const root = document.documentElement; root.setAttribute("data-theme", config.id); root.style.setProperty("--theme-accent", config.accent); root.style.setProperty("--theme-accent-hover", config.accentHover); root.style.setProperty("--theme-accent-text", config.accentText); root.style.setProperty("--theme-accent-glow", config.accentGlow); root.style.setProperty("--theme-badge-bg", config.badgeBg); root.style.setProperty("--theme-badge-border", config.badgeBorder); root.style.setProperty("--theme-badge-text", config.badgeText); root.style.setProperty("--theme-btn-bg", config.buttonBg); root.style.setProperty("--theme-btn-text", config.buttonText); } export const ThemeProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => { const config = MINT_THEME; useEffect(() => { applyThemeVars(config); }, []); return ( {children} ); }; export const useTheme = () => useContext(ThemeContext);