namespace ProviderApp
{
    partial class AddEditContractForm
    {
        private System.ComponentModel.IContainer components = null;
        private Guna.UI2.WinForms.Guna2ComboBox cmbClient;
        private Guna.UI2.WinForms.Guna2ComboBox cmbTariff;
        private Guna.UI2.WinForms.Guna2ComboBox cmbEmployee;
        private Guna.UI2.WinForms.Guna2DateTimePicker dtpSignDate;
        private Guna.UI2.WinForms.Guna2ComboBox cmbStatus;
        private Guna.UI2.WinForms.Guna2Button btnSave;
        private Guna.UI2.WinForms.Guna2Button btnCancel;
        private Guna.UI2.WinForms.Guna2Panel panel;

        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null)) components.Dispose();
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(500, 530);
            this.StartPosition = FormStartPosition.CenterParent;
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.BackColor = System.Drawing.Color.FromArgb(30, 30, 30);
            this.Text = "Договор";

            // panel
            this.panel = new Guna.UI2.WinForms.Guna2Panel();
            this.panel.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel.BackColor = System.Drawing.Color.FromArgb(30, 30, 30);
            this.panel.Padding = new System.Windows.Forms.Padding(20);
            this.Controls.Add(this.panel);

            int y = 20;
            int step = 70;

            // Title
            var lblTitle = new Guna.UI2.WinForms.Guna2HtmlLabel();
            lblTitle.Text = "Договор";
            lblTitle.Font = new System.Drawing.Font("Segoe UI", 20F, System.Drawing.FontStyle.Bold);
            lblTitle.ForeColor = System.Drawing.Color.White;
            lblTitle.BackColor = System.Drawing.Color.Transparent;
            lblTitle.Location = new System.Drawing.Point(20, 15);
            lblTitle.Size = new System.Drawing.Size(110, 39);
            this.panel.Controls.Add(lblTitle);
            y = 70;

            // Client
            AddLabel("Клиент", y, this.panel);
            this.cmbClient = CreateComboBox(130, y, 320);
            this.panel.Controls.Add(this.cmbClient);
            y += step;

            // Tariff
            AddLabel("Тариф", y, this.panel);
            this.cmbTariff = CreateComboBox(130, y, 320);
            this.panel.Controls.Add(this.cmbTariff);
            y += step;

            // Employee
            AddLabel("Сотрудник", y, this.panel);
            this.cmbEmployee = CreateComboBox(130, y, 320);
            this.panel.Controls.Add(this.cmbEmployee);
            y += step;

            // Sign Date
            AddLabel("Дата подписания", y, this.panel);
            this.dtpSignDate = CreateDatePicker(150, y);
            this.panel.Controls.Add(this.dtpSignDate);
            y += step;

            // Status
            AddLabel("Статус", y, this.panel);
            this.cmbStatus = CreateComboBox(130, y, 200);
            this.cmbStatus.Items.AddRange(new object[] { "active", "suspended", "closed" });
            this.cmbStatus.SelectedIndex = 0;
            this.panel.Controls.Add(this.cmbStatus);
            y += 60;

            // Buttons
            this.btnSave = CreateButton("Сохранить", 100, y, System.Drawing.Color.FromArgb(0, 120, 215));
            this.btnSave.Click += new System.EventHandler(this.BtnSave_Click);
            this.panel.Controls.Add(this.btnSave);

            this.btnCancel = CreateButton("Отмена", 260, y, System.Drawing.Color.FromArgb(108, 117, 125));
            this.btnCancel.Click += new System.EventHandler(this.BtnCancel_Click);
            this.panel.Controls.Add(this.btnCancel);
        }

        private void AddLabel(string text, int y, Guna.UI2.WinForms.Guna2Panel panel)
        {
            var lbl = new Guna.UI2.WinForms.Guna2HtmlLabel();
            lbl.Text = text;
            lbl.Font = new System.Drawing.Font("Segoe UI", 11F);
            lbl.ForeColor = System.Drawing.Color.FromArgb(200, 200, 200);
            lbl.BackColor = System.Drawing.Color.Transparent;
            lbl.Location = new System.Drawing.Point(20, y + 12);
            lbl.Size = new System.Drawing.Size(100, 22);
            panel.Controls.Add(lbl);
        }

        private Guna.UI2.WinForms.Guna2ComboBox CreateComboBox(int x, int y, int width)
        {
            var cb = new Guna.UI2.WinForms.Guna2ComboBox();
            cb.FillColor = System.Drawing.Color.FromArgb(45, 45, 45);
            cb.ForeColor = System.Drawing.Color.White;
            cb.BorderColor = System.Drawing.Color.FromArgb(80, 80, 80);
            cb.BorderRadius = 8;
            cb.BorderThickness = 1;
            cb.Location = new System.Drawing.Point(x, y);
            cb.Size = new System.Drawing.Size(width, 42);
            cb.Font = new System.Drawing.Font("Segoe UI", 11F);
            cb.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            return cb;
        }

        private Guna.UI2.WinForms.Guna2DateTimePicker CreateDatePicker(int x, int y)
        {
            var dt = new Guna.UI2.WinForms.Guna2DateTimePicker();
            dt.FillColor = System.Drawing.Color.FromArgb(45, 45, 45);
            dt.ForeColor = System.Drawing.Color.White;
            dt.BorderColor = System.Drawing.Color.FromArgb(80, 80, 80);
            dt.BorderRadius = 8;
            dt.BorderThickness = 1;
            dt.Format = System.Windows.Forms.DateTimePickerFormat.Short;
            dt.Location = new System.Drawing.Point(x, y);
            dt.Size = new System.Drawing.Size(200, 42);
            dt.Font = new System.Drawing.Font("Segoe UI", 11F);
            return dt;
        }

        private Guna.UI2.WinForms.Guna2Button CreateButton(string text, int x, int y, System.Drawing.Color color)
        {
            var btn = new Guna.UI2.WinForms.Guna2Button();
            btn.Text = text;
            btn.FillColor = color;
            btn.ForeColor = System.Drawing.Color.White;
            btn.BorderRadius = 8;
            btn.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Bold);
            btn.Location = new System.Drawing.Point(x, y);
            btn.Size = new System.Drawing.Size(130, 45);
            btn.HoverState.FillColor = System.Drawing.Color.FromArgb(
                color.R - 30 > 0 ? color.R - 30 : 0,
                color.G - 30 > 0 ? color.G - 30 : 0,
                color.B - 30 > 0 ? color.B - 30 : 0);
            return btn;
        }
    }
}