@extends('backend.layouts.app')

@section('title')
    Edit Staff Type - Hotel Management System
@endsection

@section('content')
    <!-- Breadcrumb -->
    <div class="bg-white shadow-sm border-b border-gray-200 px-6 py-4">
        <div class="flex items-center justify-between">
            <div class="flex items-center text-sm text-gray-600">
                <i class="fas fa-home mr-2"></i>
                <span>/ Staff Section / Staff Types / Edit</span>
            </div>
            <a href="{{ route('staff-types.index') }}" class="bg-gray-600 hover:bg-gray-700 text-white px-4 py-2 rounded-lg transition-colors">
                <i class="fas fa-arrow-left mr-2"></i>Back to Staff Types
            </a>
        </div>
    </div>

    <!-- Content -->
    <div class="p-6">
        <div class="max-w-2xl mx-auto">
            <div class="bg-white rounded-lg shadow-md">
                <div class="px-6 py-4 border-b border-gray-200">
                    <h2 class="text-xl font-semibold text-gray-800">Edit Staff Type</h2>
                </div>
                
                <form action="{{ route('staff-types.update', $staffType) }}" method="POST" class="p-6 space-y-6">
                    @csrf
                    @method('PUT')
                    
                    <div>
                        <label for="staff_type" class="block text-sm font-medium text-gray-700 mb-1">Staff Type *</label>
                        <input type="text" 
                               id="staff_type" 
                               name="staff_type" 
                               value="{{ old('staff_type', $staffType->staff_type) }}" 
                               class="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 @error('staff_type') border-red-500 @enderror"
                               placeholder="e.g., Manager, Receptionist, Housekeeping"
                               required>
                        @error('staff_type')
                            <p class="mt-1 text-sm text-red-600">{{ $message }}</p>
                        @enderror
                        <p class="mt-1 text-sm text-gray-500">Enter the name of the staff type (e.g., Manager, Receptionist, Housekeeping)</p>
                    </div>
                    
                    <!-- Form Actions -->
                    <div class="flex items-center justify-end space-x-3 pt-4">
                        <a href="{{ route('staff-types.index') }}" class="px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors">
                            Cancel
                        </a>
                        <button type="submit" class="px-6 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg transition-colors">
                            Update Staff Type
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
@endsection 