<?php

declare(strict_types=1);

namespace App\Framework\Design\ValueObjects;

/**
 * Theme Mode Enum
 *
 * Generic theme mode for any themeable component in the framework.
 * Supports light, dark, and automatic (system preference) modes.
 */
enum ThemeMode: string
{
    case LIGHT = 'light';
    case DARK = 'dark';
    case AUTO = 'auto';

    public function isLight(): bool
    {
        return $this === self::LIGHT;
    }

    public function isDark(): bool
    {
        return $this === self::DARK;
    }

    public function isAuto(): bool
    {
        return $this === self::AUTO;
    }

    /**
     * Get CSS data-theme attribute value
     */
    public function toDataAttribute(): string
    {
        return match ($this) {
            self::LIGHT => 'light',
            self::DARK => 'dark',
            self::AUTO => '', // No attribute for auto mode
        };
    }

    /**
     * Get CSS class name
     */
    public function toCssClass(string $prefix = 'theme'): string
    {
        return "{$prefix}-{$this->value}";
    }
}
