@extends('layouts.app')

@section('title', 'Tambah Jenis Ketunaan')

@section('content')
<div class="container-fluid">
    <div class="row mb-3">
        <div class="col-12">
            <nav aria-label="breadcrumb">
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="{{ route('superadmin.disability-types.index') }}">Jenis Ketunaan</a></li>
                    <li class="breadcrumb-item active">Tambah</li>
                </ol>
            </nav>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-8">
            <div class="card shadow-sm">
                <div class="card-header bg-primary text-white">
                    <h5 class="mb-0">Tambah Jenis Ketunaan Baru</h5>
                </div>
                <div class="card-body">
                    <form action="{{ route('superadmin.disability-types.store') }}" method="POST">
                        @csrf

                        <div class="mb-3">
                            <label for="code" class="form-label">Kode <span class="text-danger">*</span></label>
                            <input type="text" 
                                   class="form-control @error('code') is-invalid @enderror" 
                                   id="code" 
                                   name="code" 
                                   value="{{ old('code') }}" 
                                   placeholder="Contoh: A, B, C, dll"
                                   maxlength="10"
                                   required>
                            @error('code')
                                <div class="invalid-feedback">{{ $message }}</div>
                            @enderror
                            <small class="text-muted">Kode unik untuk jenis ketunaan (maksimal 10 karakter)</small>
                        </div>

                        <div class="mb-3">
                            <label for="name" class="form-label">Nama Jenis Ketunaan <span class="text-danger">*</span></label>
                            <input type="text" 
                                   class="form-control @error('name') is-invalid @enderror" 
                                   id="name" 
                                   name="name" 
                                   value="{{ old('name') }}" 
                                   placeholder="Contoh: Tunanetra, Tunarungu, dll"
                                   required>
                            @error('name')
                                <div class="invalid-feedback">{{ $message }}</div>
                            @enderror
                        </div>

                        <div class="mb-3">
                            <label for="description" class="form-label">Deskripsi</label>
                            <textarea class="form-control @error('description') is-invalid @enderror" 
                                      id="description" 
                                      name="description" 
                                      rows="4"
                                      placeholder="Deskripsi singkat tentang jenis ketunaan ini">{{ old('description') }}</textarea>
                            @error('description')
                                <div class="invalid-feedback">{{ $message }}</div>
                            @enderror
                        </div>

                        <div class="mb-3">
                            <div class="form-check">
                                <input class="form-check-input" 
                                       type="checkbox" 
                                       name="is_active" 
                                       id="is_active" 
                                       value="1"
                                       {{ old('is_active', true) ? 'checked' : '' }}>
                                <label class="form-check-label" for="is_active">
                                    Aktif
                                </label>
                            </div>
                            <small class="text-muted">Jenis ketunaan yang aktif dapat dipilih saat menambah data siswa</small>
                        </div>

                        <div class="d-flex gap-2">
                            <button type="submit" class="btn btn-primary">
                                <i class="bi bi-save me-1"></i> Simpan
                            </button>
                            <a href="{{ route('superadmin.disability-types.index') }}" class="btn btn-secondary">
                                <i class="bi bi-x-circle me-1"></i> Batal
                            </a>
                        </div>
                    </form>
                </div>
            </div>
        </div>

        <div class="col-lg-4">
            <div class="card shadow-sm">
                <div class="card-header bg-info text-white">
                    <h6 class="mb-0"><i class="bi bi-info-circle me-1"></i> Informasi</h6>
                </div>
                <div class="card-body">
                    <h6>Contoh Jenis Ketunaan:</h6>
                    <ul class="small">
                        <li>Tunanetra (A)</li>
                        <li>Tunarungu (B)</li>
                        <li>Tunagrahita (C)</li>
                        <li>Tunadaksa (D)</li>
                        <li>Tunalaras (E)</li>
                        <li>Tunawicara (F)</li>
                        <li>Tunaganda (G)</li>
                        <li>Autis (H)</li>
                    </ul>
                    <hr>
                    <p class="small mb-0">
                        <i class="bi bi-exclamation-triangle text-warning"></i> 
                        Pastikan kode dan nama jenis ketunaan sesuai dengan standar yang berlaku.
                    </p>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
