package de.gecheckt.pdf.umbenenner.adapter.in.gui.editor;

/**
 * Defines the four fixed severity levels for messages displayed in the central message area
 * of the GUI configuration editor.
 * <p>
 * Each level carries a German-language prefix string that is displayed in colour at the start
 * of each message line. The remainder of the message text is always rendered in black,
 * regardless of severity.
 * <p>
 * The colour hints in this enum are expressed as CSS colour strings to avoid a compile-time
 * dependency on JavaFX. Rendering code in the GUI layer must convert the hint to a
 * {@code javafx.scene.paint.Color} or equivalent.
 * <p>
 * Severity levels ordered from least to most critical:
 * <ol>
 *   <li>{@link #INFO}</li>
 *   <li>{@link #HINT}</li>
 *   <li>{@link #WARNING}</li>
 *   <li>{@link #ERROR}</li>
 * </ol>
 * <p>
 * This enum contains no JavaFX references and is safe to use in unit-tested view-model code.
 */
public enum GuiMessageSeverity {

    /** Neutral informational message, no action required. */
    INFO("Info:", "#1565c0"),

    /** Helpful hint that the user may want to act on. */
    HINT("Hinweis:", "#558b2f"),

    /** Configuration value is technically acceptable but risky or unusual. */
    WARNING("Warnung:", "#e65100"),

    /** Configuration value is invalid or the state is not operational. */
    ERROR("Fehler:", "#b71c1c");

    private final String prefixLabel;
    private final String prefixCssColour;

    GuiMessageSeverity(String prefixLabel, String prefixCssColour) {
        this.prefixLabel = prefixLabel;
        this.prefixCssColour = prefixCssColour;
    }

    /**
     * Returns the German-language prefix label shown at the start of each message line of this severity.
     * <p>
     * Only the prefix is rendered in colour; the remaining message text is always black.
     *
     * @return the prefix label; never {@code null}
     */
    public String getPrefixLabel() {
        return prefixLabel;
    }

    /**
     * Returns a CSS colour string hint that the GUI layer uses to render the prefix in the
     * appropriate colour.
     * <p>
     * The returned value is a CSS hex colour (e.g., {@code "#b71c1c"}) that can be passed to
     * {@code Color.web()} in JavaFX. The GUI layer is responsible for this conversion; this
     * enum itself contains no JavaFX dependency.
     *
     * @return a CSS colour hint string; never {@code null}
     */
    public String getPrefixCssColour() {
        return prefixCssColour;
    }
}
