@extends('layouts.anggota')

@section('content')
    <div class="container-fluid py-4">

        <div class="header-section">
            <nav aria-label="breadcrumb">
                <ol class="breadcrumb bg-transparent mb-0 pb-0 pt-1 px-0 me-sm-6 me-5">
                    <li class="breadcrumb-item text-sm"><a class="opacity-5 text-dark"
                            href="{{ route('admin.anggota.index') }}">Anggota</a></li>
                    <li class="breadcrumb-item text-sm text-dark active" aria-current="page">Edit Anggota</li>
                </ol>
            </nav>
            <h3 class="font-weight-bolder mb-0 text-primary">Edit Data Anggota</h3>
        </div>

        <div class="row mt-4">
            <div class="col-lg-8 col-md-10 mx-auto">
                <div class="card shadow-lg border-0 mb-4" style="border-radius: 1rem;">
                    <div class="card-header pb-0 bg-white"
                        style="border-top-left-radius: 1rem; border-top-right-radius: 1rem;">
                        <h5 class="font-weight-bolder text-primary mb-0">Form Edit Anggota 🖋️</h5>
                        <p class="mb-0 text-sm text-muted">Perbarui informasi anggota sesuai kebutuhan.</p>
                    </div>

                    <div class="card-body p-4">
                        <form action="{{ route('admin.anggota.update', $member->id) }}" method="POST">
                            @csrf
                            @method('PUT')

                            <div class="mb-4">
                                <label for="nama" class="form-label font-weight-bold">Nama Lengkap</label>
                                <input type="text" name="nama" id="nama" class="form-control form-control-lg"
                                    value="{{ old('nama', $member->nama) }}" required>
                            </div>

                            <div class="mb-4">
                                <label for="email" class="form-label font-weight-bold">Email</label>
                                <input type="email" name="email" id="email" class="form-control form-control-lg"
                                    value="{{ old('email', $member->email) }}" required>
                            </div>

                            <div class="mb-4">
                                <label for="alamat" class="form-label font-weight-bold">Alamat</label>
                                <textarea name="alamat" id="alamat" class="form-control form-control-lg" rows="4"
                                    required>{{ old('alamat', $member->alamat) }}</textarea>
                            </div>

                            <div class="d-flex justify-content-between pt-3">
                                <a href="{{ route('admin.anggota.index') }}" class="btn btn-outline-secondary btn-lg me-2">
                                    <i class="fas fa-arrow-left me-1"></i> Batal / Kembali
                                </a>
                                <button type="submit" class="btn btn-primary btn-lg">
                                    <i class="fas fa-check me-1"></i> Simpan Perubahan
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection