<x-guru-layout>
    <div class="mb-8">
        <h2 class="text-3xl font-bold text-gray-800 mb-2">Edit Absensi Santri</h2>
        <p class="text-gray-600">Perbarui data kehadiran santri</p>
    </div>
    <form action="{{ route('guru.absensis.update', $absensi) }}" method="POST" class="max-w-2xl mx-auto bg-white rounded-xl shadow-lg p-8">
        @csrf
        @method('PUT')
        <div class="mb-6">
            <label class="block font-semibold text-gray-700 mb-2">Nama Santri</label>
            <input type="text" class="w-full px-4 py-2 border border-gray-300 rounded-lg bg-gray-100" value="{{ $santri->nama }}" readonly>
        </div>
        <div class="mb-6">
            <label class="block font-semibold text-gray-700 mb-2">Status</label>
            <select name="status" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-green-500 transition-colors" required>
                <option value="">Pilih Status</option>
                <option value="hadir" {{ $absensi->status=='hadir'?'selected':'' }}>Hadir</option>
                <option value="izin" {{ $absensi->status=='izin'?'selected':'' }}>Izin</option>
                <option value="sakit" {{ $absensi->status=='sakit'?'selected':'' }}>Sakit</option>
                <option value="alfa" {{ $absensi->status=='alfa'?'selected':'' }}>Alpa</option>
            </select>
            @error('status')<div class="text-red-600 text-sm mt-1">{{ $message }}</div>@enderror
        </div>
        <div class="mb-6">
            <label class="block font-semibold text-gray-700 mb-2">Keterangan</label>
            <input type="text" name="keterangan" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-green-500 transition-colors" value="{{ old('keterangan', $absensi->keterangan) }}">
            @error('keterangan')<div class="text-red-600 text-sm mt-1">{{ $message }}</div>@enderror
        </div>
        <div class="flex gap-2 mt-4 justify-end">
            <button type="submit" class="inline-flex items-center px-6 py-3 text-sm font-medium text-white bg-green-600 rounded-lg hover:bg-green-700 transition-colors">
                <i class="fas fa-save mr-2"></i>
                Update
            </button>
            <a href="{{ route('guru.absensis.index', ['kelas_id'=>$absensi->kelas_id, 'tanggal'=>$absensi->tanggal]) }}" class="inline-flex items-center px-6 py-3 text-sm font-medium text-gray-700 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors">
                <i class="fas fa-arrow-left mr-2"></i>
                Kembali
            </a>
        </div>
    </form>
</x-guru-layout> 