<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Registro de Evaluaciones - DIAGNOSTIKA</title>
    <script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-gray-50">

    <main class="max-w-7xl mx-auto px-6 py-12">
        <!-- Header -->
        <div class="mb-12">
            <h1 class="text-4xl font-bold text-gray-900 mb-4">📋 Registro de Evaluaciones Completadas</h1>
            <p class="text-gray-600 text-lg">Aquí puedes ver todas tus evaluaciones finalizadas con éxito.</p>
        </div>

        <?php if($evaluacionesCompletadas->count() > 0): ?>
            <!-- Tabla Responsiva -->
            <div class="bg-white rounded-lg shadow-lg overflow-hidden">
                <div class="overflow-x-auto">
                    <table class="w-full">
                        <thead class="bg-gradient-to-r from-blue-600 to-blue-900 text-white">
                            <tr>
                                <th class="px-6 py-4 text-left text-sm font-semibold">Institución Educativa</th>
                                <th class="px-6 py-4 text-left text-sm font-semibold">Método de Pago</th>
                                <th class="px-6 py-4 text-left text-sm font-semibold">Monto Pagado</th>
                                <th class="px-6 py-4 text-left text-sm font-semibold">Fecha de Finalización</th>
                                <th class="px-6 py-4 text-center text-sm font-semibold">Acciones</th>
                            </tr>
                        </thead>
                        <tbody class="divide-y divide-gray-200">
                            <?php $__currentLoopData = $evaluacionesCompletadas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $evaluacion): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr class="hover:bg-blue-50 transition">
                                    <td class="px-6 py-4">
                                        <div class="text-sm font-semibold text-gray-900"><?php echo e($evaluacion->nombre_ie ?? 'N/A'); ?></div>
                                        <div class="text-xs text-gray-500 mt-1">Código: <?php echo e($evaluacion->codigo_local ?? 'N/A'); ?></div>
                                    </td>
                                    <td class="px-6 py-4">
                                        <div class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-blue-100 text-blue-800">
                                            <?php switch($evaluacion->metodo_pago):
                                                case ('tarjeta'): ?>
                                                    💳 Tarjeta
                                                    <?php break; ?>
                                                <?php case ('yape'): ?>
                                                    📱 Yape
                                                    <?php break; ?>
                                                <?php case ('plin'): ?>
                                                    📲 Plin
                                                    <?php break; ?>
                                                <?php default: ?>
                                                    <?php echo e(ucfirst($evaluacion->metodo_pago)); ?>

                                            <?php endswitch; ?>
                                        </div>
                                    </td>
                                    <td class="px-6 py-4">
                                        <div class="text-sm font-semibold text-green-700">S/ <?php echo e(number_format($evaluacion->monto, 2)); ?></div>
                                    </td>
                                    <td class="px-6 py-4">
                                        <div class="text-sm text-gray-700"><?php echo e($evaluacion->created_at->format('d/m/Y')); ?></div>
                                        <div class="text-xs text-gray-500"><?php echo e($evaluacion->created_at->format('H:i A')); ?></div>
                                    </td>
                                    <td class="px-6 py-4 text-center">
                                        <a href="/compromiso1" class="inline-flex items-center justify-center px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-semibold rounded-lg transition">
                                            <svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"></path>
                                            </svg>
                                            Ver Evaluación
                                        </a>
                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                </div>
            </div>

            <!-- Resumen -->
            <div class="mt-8 grid grid-cols-1 md:grid-cols-3 gap-6">
                <div class="bg-white rounded-lg shadow p-6">
                    <div class="flex items-center justify-between">
                        <div>
                            <p class="text-gray-600 text-sm font-medium">Total Evaluaciones</p>
                            <p class="text-3xl font-bold text-blue-600 mt-2"><?php echo e($evaluacionesCompletadas->count()); ?></p>
                        </div>
                        <div class="bg-blue-100 rounded-full p-4">
                            <svg class="w-8 h-8 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
                            </svg>
                        </div>
                    </div>
                </div>

                <div class="bg-white rounded-lg shadow p-6">
                    <div class="flex items-center justify-between">
                        <div>
                            <p class="text-gray-600 text-sm font-medium">Monto Total Invertido</p>
                            <p class="text-3xl font-bold text-green-600 mt-2">S/ <?php echo e(number_format($evaluacionesCompletadas->sum('monto'), 2)); ?></p>
                        </div>
                        <div class="bg-green-100 rounded-full p-4">
                            <svg class="w-8 h-8 text-green-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
                            </svg>
                        </div>
                    </div>
                </div>

                <div class="bg-white rounded-lg shadow p-6">
                    <div class="flex items-center justify-between">
                        <div>
                            <p class="text-gray-600 text-sm font-medium">Última Evaluación</p>
                            <p class="text-2xl font-bold text-purple-600 mt-2"><?php echo e($evaluacionesCompletadas->first()->created_at->diffForHumans()); ?></p>
                        </div>
                        <div class="bg-purple-100 rounded-full p-4">
                            <svg class="w-8 h-8 text-purple-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
                            </svg>
                        </div>
                    </div>
                </div>
            </div>

        <?php else: ?>
            <!-- Mensaje cuando no hay evaluaciones -->
            <div class="bg-blue-50 rounded-lg border-l-4 border-blue-500 p-8 text-center">
                <div class="inline-flex items-center justify-center w-16 h-16 bg-blue-100 rounded-full mb-6">
                    <svg class="w-8 h-8 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
                    </svg>
                </div>
                <h3 class="text-2xl font-bold text-gray-800 mb-2">Aún no tienes evaluaciones completadas</h3>
                <p class="text-gray-600 mb-6 text-lg">Una vez que completes una evaluación y realices el pago, aparecerá aquí.</p>
                <a href="/evaluaciones-institucionales" class="inline-flex items-center px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-semibold rounded-lg transition">
                    <svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"></path>
                    </svg>
                    Comenzar una Evaluación
                </a>
            </div>
        <?php endif; ?>

        <!-- Botón volver al dashboard -->
        <div class="mt-12 text-center">
            <a href="/dashboard" class="inline-flex items-center px-6 py-3 border-2 border-gray-300 hover:border-blue-600 text-gray-700 hover:text-blue-600 font-semibold rounded-lg transition">
                <svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"></path>
                </svg>
                Volver al Dashboard
            </a>
        </div>
    </main>
</body>
</html>
<?php /**PATH D:\proyecto-web\diagnostika\src\resources\views/registro-evaluaciones.blade.php ENDPATH**/ ?>