@extends('admin.layout')

@section('title', 'Solicitar Pase - Admin OnAPB')

@section('content')
<div class="page-header">
    <h2><i class="bi bi-arrow-left-right"></i> Solicitar Pase</h2>
    <a href="{{ route('admin.pases.index') }}" class="btn-admin-outline">
        <i class="bi bi-arrow-left"></i> Volver
    </a>
</div>

<div class="admin-card">
    <div class="card-body">
        <form method="POST" action="{{ route('admin.pases.store') }}" class="admin-form">
            @csrf
            
            <div class="alert alert-info border-0 shadow-sm rounded-4">
                <i class="bi bi-info-circle-fill"></i> Ingrese el DNI del jugador que desea solicitar para su club.
            </div>

            <div class="row">
                <div class="col-md-6">
                    <div class="mb-3">
                        <label class="form-label">DNI del Jugador *</label>
                        <input type="text" name="documento" class="form-control form-control-lg rounded-pill px-4 shadow-sm" placeholder="Ej: 41234567" required>
                        @error('documento')
                            <div class="text-danger small mt-1 ps-3">{{ $message }}</div>
                        @enderror
                    </div>
                </div>

                @if(session('admin_role') == 1)
                <div class="col-md-6">
                    <div class="mb-3">
                        <label class="form-label">Club Destino (Como Superadmin, ¿para qué club solicita?)</label>
                        <select name="id_club_destino" class="form-select form-select-lg rounded-pill shadow-sm" required>
                            <option value="">Seleccione club</option>
                            @foreach(\App\Models\Club::orderBy('nombre')->get() as $club)
                                <option value="{{ $club->id_club }}">{{ $club->nombre }}</option>
                            @endforeach
                        </select>
                        @error('id_club_destino')
                            <div class="text-danger small mt-1 ps-3">{{ $message }}</div>
                        @enderror
                    </div>
                </div>
                @endif
            </div>

            <div class="mt-4">
                <button type="submit" class="btn-admin w-100 p-2 fs-5">
                    <i class="bi bi-send-fill"></i> Enviar Solicitud
                </button>
            </div>
        </form>
    </div>
</div>
@endsection
