@model LittleShop.DTOs.UpdateCategoryDto

@{
    ViewData["Title"] = "Edit Category";
    var categoryId = ViewData["CategoryId"];
}

<div class="row mb-4">
    <div class="col">
        <h1><i class="fas fa-edit"></i> Edit Category</h1>
    </div>
</div>

<div class="row">
    <div class="col-md-8">
        <div class="card">
            <div class="card-body">
                <form method="post" action="@Url.Action("Edit", new { id = categoryId })">
                    @if (ViewData.ModelState.ErrorCount > 0)
                    {
                        <div class="alert alert-danger" role="alert">
                            @Html.ValidationSummary()
                        </div>
                    }
                    
                    <div class="mb-3">
                        <label asp-for="Name" class="form-label">Name</label>
                        <input asp-for="Name" class="form-control" />
                        <span asp-validation-for="Name" class="text-danger"></span>
                    </div>
                    
                    <div class="mb-3">
                        <label asp-for="Description" class="form-label">Description</label>
                        <textarea asp-for="Description" class="form-control" rows="3"></textarea>
                        <span asp-validation-for="Description" class="text-danger"></span>
                    </div>
                    
                    <div class="mb-3">
                        <div class="form-check">
                            <input asp-for="IsActive" class="form-check-input" type="checkbox" />
                            <label asp-for="IsActive" class="form-check-label">
                                Active
                            </label>
                        </div>
                        <small class="form-text text-muted">Inactive categories are hidden from the public catalog</small>
                    </div>
                    
                    <div class="d-flex justify-content-between">
                        <a href="@Url.Action("Index")" class="btn btn-secondary">
                            <i class="fas fa-arrow-left"></i> Back to Categories
                        </a>
                        <button type="submit" class="btn btn-primary">
                            <i class="fas fa-save"></i> Save Changes
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>