@model LittleShop.DTOs.CreateCategoryDto

@{
    ViewData["Title"] = "Create Category";
}

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

<div class="row">
    <div class="col-md-8">
        <div class="card">
            <div class="card-body">
                <form method="post" asp-area="Admin" asp-controller="Categories" asp-action="Create">
                    @Html.AntiForgeryToken()
                    @if (ViewData.ModelState[""] != null && ViewData.ModelState[""].Errors.Count > 0)
                    {
                        <div class="alert alert-danger" role="alert">
                            @foreach (var error in ViewData.ModelState[""].Errors)
                            {
                                <div>@error.ErrorMessage</div>
                            }
                        </div>
                    }
                    
                    <div class="mb-3">
                        <label for="Name" class="form-label">Name</label>
                        <input name="Name" id="Name" class="form-control" required />
                    </div>
                    
                    <div class="mb-3">
                        <label for="Description" class="form-label">Description</label>
                        <textarea name="Description" id="Description" class="form-control" rows="3"></textarea>
                    </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> Create Category
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>