@model foundation_system.Models.ViewModels.ColaboradorViewModel

@{
    ViewData["Title"] = "Editar Colaborador";
}

<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-10">
            <div class="card shadow">
                <div class="card-header bg-primary text-white d-flex justify-content-between align-items-center">
                    <h5 class="mb-0"><i class="bi bi-pencil-square me-2"></i>@ViewData["Title"]</h5>
                </div>
                <div class="card-body">
                    <form asp-action="Edit">
                        <input type="hidden" asp-for="Id" />
                        <input type="hidden" asp-for="PersonaId" />
                        <div asp-validation-summary="ModelOnly" class="text-danger mb-3"></div>

                        <h6 class="text-primary border-bottom pb-2 mb-3">Información Personal</h6>
                        <div class="row g-3 mb-4">
                            <div class="col-md-6">
                                <label asp-for="Nombres" class="form-label"></label>
                                <input asp-for="Nombres" class="form-control" />
                                <span asp-validation-for="Nombres" class="text-danger small"></span>
                            </div>
                            <div class="col-md-6">
                                <label asp-for="Apellidos" class="form-label"></label>
                                <input asp-for="Apellidos" class="form-control" />
                                <span asp-validation-for="Apellidos" class="text-danger small"></span>
                            </div>
                            <div class="col-md-4">
                                <label asp-for="Dui" class="form-label"></label>
                                <input asp-for="Dui" class="form-control" />
                                <span asp-validation-for="Dui" class="text-danger small"></span>
                            </div>
                            <div class="col-md-4">
                                <label asp-for="Nit" class="form-label"></label>
                                <input asp-for="Nit" class="form-control" />
                                <span asp-validation-for="Nit" class="text-danger small"></span>
                            </div>
                            <div class="col-md-4">
                                <label asp-for="Genero" class="form-label"></label>
                                <select asp-for="Genero" class="form-select">
                                    <option value="M">Masculino</option>
                                    <option value="F">Femenino</option>
                                    <option value="O">Otro</option>
                                </select>
                                <span asp-validation-for="Genero" class="text-danger small"></span>
                            </div>
                            <div class="col-md-4">
                                <label asp-for="FechaNacimiento" class="form-label"></label>
                                <input asp-for="FechaNacimiento" class="form-control" />
                                <span asp-validation-for="FechaNacimiento" class="text-danger small"></span>
                            </div>
                            <div class="col-md-4">
                                <label asp-for="Telefono" class="form-label"></label>
                                <input asp-for="Telefono" class="form-control" />
                                <span asp-validation-for="Telefono" class="text-danger small"></span>
                            </div>
                            <div class="col-md-4">
                                <label asp-for="Email" class="form-label"></label>
                                <input asp-for="Email" class="form-control" />
                                <span asp-validation-for="Email" class="text-danger small"></span>
                            </div>
                            <div class="col-12">
                                <label asp-for="Direccion" class="form-label"></label>
                                <textarea asp-for="Direccion" class="form-control" rows="2"></textarea>
                                <span asp-validation-for="Direccion" class="text-danger small"></span>
                            </div>
                        </div>

                        <h6 class="text-primary border-bottom pb-2 mb-3">Información Laboral</h6>
                        <div class="row g-3 mb-4">
                            <div class="col-md-6">
                                <label asp-for="CargoId" class="form-label"></label>
                                <select asp-for="CargoId" class="form-select" asp-items="@(new SelectList(ViewBag.Cargos, "Id", "Nombre"))">
                                    <option value="">Seleccione un cargo...</option>
                                </select>
                                <span asp-validation-for="CargoId" class="text-danger small"></span>
                            </div>
                            <div class="col-md-6">
                                <label asp-for="TipoColaborador" class="form-label"></label>
                                <select asp-for="TipoColaborador" class="form-select">
                                    <option value="Permanente">Permanente</option>
                                    <option value="Voluntario">Voluntario</option>
                                    <option value="Temporal">Temporal</option>
                                    <option value="Por Horas">Por Horas</option>
                                </select>
                                <span asp-validation-for="TipoColaborador" class="text-danger small"></span>
                            </div>
                            <div class="col-md-4">
                                <label asp-for="FechaIngreso" class="form-label"></label>
                                <input asp-for="FechaIngreso" class="form-control" />
                                <span asp-validation-for="FechaIngreso" class="text-danger small"></span>
                            </div>
                            <div class="col-md-4">
                                <label asp-for="HorarioEntrada" class="form-label"></label>
                                <input asp-for="HorarioEntrada" class="form-control" type="time" />
                                <span asp-validation-for="HorarioEntrada" class="text-danger small"></span>
                            </div>
                            <div class="col-md-4">
                                <label asp-for="HorarioSalida" class="form-label"></label>
                                <input asp-for="HorarioSalida" class="form-control" type="time" />
                                <span asp-validation-for="HorarioSalida" class="text-danger small"></span>
                            </div>
                            <div class="col-12">
                                <div class="form-check form-switch">
                                    <input class="form-check-input" type="checkbox" asp-for="Activo">
                                    <label class="form-check-label" asp-for="Activo">Colaborador Activo</label>
                                </div>
                            </div>
                        </div>

                        <div class="d-flex justify-content-between mt-4">
                            <a asp-action="Index" class="btn btn-outline-secondary">
                                <i class="bi bi-arrow-left me-2"></i> Volver
                            </a>
                            <button type="submit" class="btn btn-primary px-5">
                                <i class="bi bi-save me-2"></i> Guardar Cambios
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

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