@extends('layouts.admin')

@section('title', __('admin.nav.player_profiles'))

@section('content')
<form method="GET" class="card-arena p-4 mb-4">
    <div class="input-group">
        <input type="search" name="q" value="{{ request('q') }}" class="form-control" placeholder="{{ __('admin.users.search_placeholder') }}">
        <button class="btn-arena btn-primary">{{ __('admin.actions.search') }}</button>
    </div>
</form>

<div class="card-arena overflow-hidden">
    <div class="table-responsive">
        <table class="table table-dark table-hover mb-0">
            <thead>
                <tr>
                    <th>Profile</th>
                    <th>User</th>
                    <th>Completion</th>
                    <th>Visibility</th>
                </tr>
            </thead>
            <tbody>
                @forelse($profiles as $profile)
                    <tr>
                        <td>{{ $profile->display_name }}</td>
                        <td>{{ $profile->user?->username }}</td>
                        <td>{{ $profile->profile_completion_percentage ?? 0 }}%</td>
                        <td>{{ $profile->profile_visibility?->label() ?? '—' }}</td>
                    </tr>
                @empty
                    <tr><td colspan="4" class="text-center py-5 text-muted">{{ __('admin.empty.no_results') }}</td></tr>
                @endforelse
            </tbody>
        </table>
    </div>
</div>

<div class="mt-4">{{ $profiles->links() }}</div>
@endsection
