@extends('layouts.app')

@section('content')
<div class="container">
    <div class="d-flex justify-content-between align-items-center mb-4">
        <h2>Postulantes Registrados</h2>
        <span class="badge bg-primary">{{ count($postulantes) }} Inscritos</span>
    </div>

    <div class="card shadow">
        <div class="card-body">
            <table class="table table-hover">
                <thead class="table-dark">
                    <tr>
                        <th>Nombre</th>
                        <th>Categoría</th>
                        <th>Pseudónimo</th>
                        <th>Fotos</th>
                        <th>Fecha</th>
                        <th>Acciones</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach($postulantes as $p)
                    <tr>
                        <td>{{ $p->nombre_apellido }}</td>
                        <td>
                            <span class="badge {{ $p->categoria == 'historica' ? 'bg-secondary' : 'bg-success' }}">
                                {{ ucfirst($p->categoria) }}
                            </span>
                        </td>
                        <td>{{ $p->pseudonimo }}</td>
                        <td>{{ count($p->fotos) }} fotos</td>
                        <td>{{ $p->created_at->format('d/m/Y') }}</td>
                        <td>
                            <a href="{{ route('admin.show', $p->id) }}" class="btn btn-sm btn-info text-white">Ver Ficha</a>
                        </td>
                    </tr>
                    @endforeach
                </tbody>
            </table>
        </div>
    </div>
</div>
@endsection