using System.Drawing;
using System.Windows.Forms;
using Elfisa.UI.Theming;

namespace Elfisa.UI.Controls
{
    public class ModernTextBox : TextBox
    {
        private ThemeColors _theme;

        public ModernTextBox()
        {
            BorderStyle = BorderStyle.FixedSingle;
            Font = new Font("Segoe UI", 13f);
        }

        public void ApplyTheme(ThemeColors theme)
        {
            _theme = theme;
            BackColor = theme.InputBackground;
            ForeColor = theme.TextPrimary;
            Font = theme.FontRegular13;
            BorderStyle = BorderStyle.FixedSingle;
        }

        protected override void OnEnter(System.EventArgs e)
        {
            base.OnEnter(e);
            var theme = _theme ?? ThemeManager.Colors;
            BackColor = theme.InputBackground;
        }
    }
}
