@model Recepie.Models.Recipe

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

<div class="container mt-4">
    <div class="row">
        <div class="col-md-8 offset-md-2">
            <div class="card">
                <div class="card-header">
                    <h2>Create New Recipe</h2>
                </div>
                <div class="card-body">
                    <form asp-action="Create">
                        <div asp-validation-summary="ModelOnly" class="text-danger"></div>

                        <div class="mb-3">
                            <label asp-for="Title" class="form-label"></label>
                            <input asp-for="Title" class="form-control" />
                            <span asp-validation-for="Title" class="text-danger"></span>
                        </div>

                        <div class="mb-3">
                            <label asp-for="Description" class="form-label"></label>
                            <textarea asp-for="Description" class="form-control" rows="4"></textarea>
                            <span asp-validation-for="Description" class="text-danger"></span>
                        </div>

                        <div class="mb-3">
                            <label asp-for="Difficulty" class="form-label"></label>
                            <select asp-for="Difficulty" class="form-select">
                                <option value="">Select difficulty</option>
                                <option value="Easy">Easy</option>
                                <option value="Medium">Medium</option>
                                <option value="Hard">Hard</option>
                            </select>
                            <span asp-validation-for="Difficulty" class="text-danger"></span>
                        </div>

                        <div class="mb-3">
                            <label asp-for="Time" class="form-label"></label>
                            <input asp-for="Time" class="form-control" placeholder="e.g., 30 minutes" />
                            <span asp-validation-for="Time" class="text-danger"></span>
                        </div>

                        <div class="mb-3">
                            <label asp-for="Url" class="form-label"></label>
                            <input asp-for="Url" class="form-control" type="url" placeholder="https://..." />
                            <span asp-validation-for="Url" class="text-danger"></span>
                        </div>

                        <div class="d-grid gap-2 d-md-flex justify-content-md-end">
                            <a href="@Url.Action("Index")" class="btn btn-secondary">Cancel</a>
                            <button type="submit" class="btn btn-primary">Create</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

@section Scripts {
    @{
        await Html.RenderPartialAsync("_ValidationScriptsPartial");
    }
}