import { ReactNode } from 'react';
import { z } from 'zod';

/**
 * Theme token overrides. Each key maps 1:1 to a CSS variable.
 * All optional — defaults come from Elevasis design system.
 */
interface ElevasisTokenOverrides {
    primary?: string;
    /** Text color that contrasts with `primary`. Defaults to '#fff'. */
    primaryContrast?: string;
    background?: string;
    surface?: string;
    surfaceHover?: string;
    /** Opaque surface for floating overlays (modals, menus, popovers) — guarantees readable contrast against decorative backgrounds. */
    elevatedSurface?: string;
    text?: string;
    textDimmed?: string;
    textSubtle?: string;
    border?: string;
    error?: string;
    warning?: string;
    success?: string;
    glassBackground?: string;
    glassBlur?: string;
    shadow?: string;
    cardShadow?: string;
    durationFast?: string;
    durationNormal?: string;
    easing?: string;
    /** Foreground text color for destructive/error buttons. Defaults to '#fff'. */
    destructiveFg?: string;
    /** Heading font family — used for titles, section headers. */
    fontHeading?: string;
    /** Body font family — used for general text. */
    fontSans?: string;
}

/** Framework-agnostic theme overrides bundled with a preset (fonts, radius, component styles). */
interface FrameworkThemeOverrides {
    fontFamily?: string;
    defaultRadius?: string;
    headings?: {
        fontFamily?: string;
        fontWeight?: string;
    };
    components?: Record<string, unknown>;
}
/** Tokens every preset must define. `elevatedSurface` is progressively adopted and stays optional. */
type PresetTokens = Required<Omit<ElevasisTokenOverrides, 'elevatedSurface'>> & Pick<ElevasisTokenOverrides, 'elevatedSurface'>;
interface ThemePreset {
    light: PresetTokens;
    dark: PresetTokens;
    /** Optional framework theme overrides bundled with this preset (fonts, radius, etc.). */
    framework?: FrameworkThemeOverrides;
    /**
     * Subtitle font family — used for card names, section labels, and nav items.
     * Sits between heading and body in the typographic hierarchy.
     */
    subtitleFontFamily?: string;
    /** Google Fonts URLs to load when this preset is active. */
    fontImports?: string[];
    /** Display label for settings UI (e.g. "Tactical"). Built-in presets define this; custom presets must provide it. */
    label?: string;
    /** Short description for settings UI (e.g. "Tactical command center aesthetic"). */
    description?: string;
    /** Three representative hex colors for swatch display: [primary, dark-bg, light-bg]. */
    colors?: [string, string, string];
    /**
     * Background layers rendered behind app content when this preset is active.
     * Overridden by `theme.background` on the provider if both are set.
     */
    background?: ReactNode;
    /**
     * Loader element used in loading states when this preset is active.
     * Overridden by `theme.loader` on the provider if both are set.
     */
    loader?: ReactNode;
}
type PresetName = 'default' | 'tactical' | 'regal' | 'cyber-volt' | 'aurora' | 'rose-gold' | 'midnight' | 'titanium' | 'canopy' | 'slate' | 'cyber-strike' | 'cyber-chrome' | 'cyber-void' | 'nirvana' | 'wave' | 'synapse' | 'cortex' | 'helios' | 'graphite' | 'quarry';

/** 10-shade color tuple (light → dark), compatible with Mantine's color format. */
type ColorShadesTuple = [string, string, string, string, string, string, string, string, string, string];
/**
 * Generate a 10-shade Mantine color tuple from a single hex color.
 * Input color maps to shade 6 (Mantine's default primary shade).
 * Shades 0-5 are progressively lighter, 7-9 are progressively darker.
 */
declare function generateShades(hex: string): ColorShadesTuple;

declare const THEME_PRESETS: readonly ["default", "tactical", "slate", "regal", "midnight", "aurora", "titanium", "rose-gold", "wave", "canopy", "quarry", "nirvana", "cortex", "synapse", "graphite", "helios", "cyber-void", "cyber-volt", "cyber-chrome", "cyber-strike"];
type ThemePresetName = (typeof THEME_PRESETS)[number];
declare const ThemePresetEnum: z.ZodEnum<{
    default: "default";
    tactical: "tactical";
    regal: "regal";
    "cyber-volt": "cyber-volt";
    aurora: "aurora";
    "rose-gold": "rose-gold";
    midnight: "midnight";
    titanium: "titanium";
    canopy: "canopy";
    slate: "slate";
    "cyber-strike": "cyber-strike";
    "cyber-chrome": "cyber-chrome";
    "cyber-void": "cyber-void";
    nirvana: "nirvana";
    wave: "wave";
    synapse: "synapse";
    cortex: "cortex";
    helios: "helios";
    graphite: "graphite";
    quarry: "quarry";
}>;

declare const PRESETS: Record<PresetName, ThemePreset>;

/** Look up a preset by name. Falls back to default preset for unknown names. */
declare function getPreset(name: PresetName | (string & {}), presetsMap?: Record<string, ThemePreset>): ThemePreset;

export { THEME_PRESETS, ThemePresetEnum, generateShades, getPreset, PRESETS as presets };
export type { FrameworkThemeOverrides, PresetName, ThemePreset, ThemePresetName };
