<?php $__env->startSection('title', 'Ficha Académica de Egresado'); ?>
<?php $__env->startSection('content'); ?>
<div class="row justify-content-center">
    <div class="col-lg-10">
        
        <div class="no-print mb-4 d-flex flex-wrap justify-content-between align-items-center gap-3">
            <a href="<?php echo e(route('home')); ?>" class="btn btn-outline-secondary rounded-pill px-4">
                <i class="bi bi-arrow-left me-2"></i>Nueva Consulta
            </a>
            <div class="d-flex gap-2">
                <?php if(auth()->guard()->check()): ?>
                    <a href="<?php echo e(route('admin.records.export_excel', $record->id)); ?>" class="btn btn-outline-success rounded-pill px-4">
                        <i class="bi bi-file-earmark-excel me-2"></i>Excel
                    </a>
                <?php endif; ?>
                <button onclick="window.print()" class="btn btn-dark rounded-pill px-4">
                    <i class="bi bi-printer me-2"></i>Imprimir / PDF
                </button>
            </div>
        </div>

        
        <div class="card p-5 border-0 shadow-lg position-relative overflow-hidden">
            
            <div class="position-absolute top-0 end-0 opacity-10 p-4 no-print">
                <i class="bi bi-mortarboard" style="font-size: 15rem; margin-top: -5rem; margin-right: -5rem;"></i>
            </div>

            
            <div class="row border-bottom border-3 pb-4 mb-5 align-items-center position-relative">
                <div class="col-md-8">
                    <h1 class="text-primary fw-bold mb-1" style="letter-spacing: -1.5px; font-size: 2.5rem;">FICHA ACADÉMICA</h1>
                    <h4 class="text-secondary fw-light mb-0">EXPEDIENTE DE EGRESADO</h4>
                    <p class="text-muted small mt-2 mb-0"><i class="bi bi-info-circle me-1"></i>Documento de verificación institucional</p>
                </div>
                <div class="col-md-4 text-md-end mt-3 mt-md-0">
                    <div class="bg-primary text-white p-3 rounded-4 shadow-sm border border-white border-2">
                        <span class="small d-block opacity-75 fw-bold">COHORTE</span>
                        <span class="fs-3 fw-bold"><?php echo e($record->cohort); ?></span>
                    </div>
                </div>
            </div>

            <div class="row g-5 position-relative">
                
                <div class="col-md-6">
                    <h5 class="fw-bold mb-4 text-dark border-start border-4 border-primary ps-3">1. DATOS PERSONALES</h5>
                    <div class="mb-4">
                        <label class="text-muted small text-uppercase fw-bold d-block mb-1">Apellidos y Nombres</label>
                        <span class="fs-5 fw-bold text-dark"><?php echo e($record->last_names); ?>, <?php echo e($record->first_names); ?></span>
                    </div>
                    <div class="mb-4">
                        <label class="text-muted small text-uppercase fw-bold d-block mb-1">Cédula de Identidad</label>
                        <span class="fs-5 fw-bold font-monospace text-dark"><?php echo e(number_format((int)$record->dni, 0, ',', '.')); ?></span>
                    </div>
                    <div class="mb-4">
                        <label class="text-muted small text-uppercase fw-bold d-block mb-1">Fecha de Nacimiento</label>
                        <span class="fs-5 fw-bold text-dark"><?php echo e($record->birth_date->format('d/m/Y')); ?></span>
                    </div>

                    
                    <?php if($record->custom_values): ?>
                        <?php $__currentLoopData = $customFields->where('section', 'personal'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $field): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php if(isset($record->custom_values[$field->label]) && !empty($record->custom_values[$field->label])): ?>
                                <div class="mb-4">
                                    <label class="text-muted small text-uppercase fw-bold d-block mb-1"><?php echo e($field->label); ?></label>
                                    <span class="fs-5 fw-bold text-dark"><?php echo e($record->custom_values[$field->label]); ?></span>
                                </div>
                            <?php endif; ?>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>
                </div>

                
                <div class="col-md-6">
                    <h5 class="fw-bold mb-4 text-dark border-start border-4 border-primary ps-3">2. EXPEDIENTE ACADÉMICO</h5>
                    <div class="mb-4">
                        <label class="text-muted small text-uppercase fw-bold d-block mb-1">Especialidad / Título Obtenido</label>
                        <span class="fs-5 fw-bold text-primary text-uppercase"><?php echo e($record->specialty); ?></span>
                    </div>

                    
                    <?php if($record->custom_values): ?>
                        <?php $__currentLoopData = $customFields->where('section', 'academic'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $field): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php if(isset($record->custom_values[$field->label]) && !empty($record->custom_values[$field->label])): ?>
                                <div class="mb-4">
                                    <label class="text-muted small text-uppercase fw-bold d-block mb-1"><?php echo e($field->label); ?></label>
                                    <span class="fs-5 fw-bold text-dark"><?php echo e($record->custom_values[$field->label]); ?></span>
                                </div>
                            <?php endif; ?>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>

                    <div class="row g-3">
                        <div class="col-6">
                            <div class="mb-4 p-3 bg-light rounded-3 border">
                                <label class="text-muted small text-uppercase fw-bold d-block mb-1">Libro</label>
                                <span class="fs-5 fw-bold text-dark"><?php echo e($record->book); ?></span>
                            </div>
                        </div>
                        <div class="col-6">
                            <div class="mb-4 p-3 bg-light rounded-3 border">
                                <label class="text-muted small text-uppercase fw-bold d-block mb-1">Folio</label>
                                <span class="fs-5 fw-bold text-dark"><?php echo e($record->folio); ?></span>
                            </div>
                        </div>
                    </div>
                    <div class="mb-4">
                        <label class="text-muted small text-uppercase fw-bold d-block mb-1">Fecha de Registro Oficial</label>
                        <span class="fs-5 fw-bold text-dark"><?php echo e($record->registration_date->format('d/m/Y')); ?></span>
                    </div>
                    <div class="mb-0">
                        <label class="text-muted small text-uppercase fw-bold d-block mb-1">Ubicación de Archivo Físico</label>
                        <span class="fs-6 fw-medium text-dark border-bottom border-primary"><?php echo e($record->location); ?></span>
                    </div>
                </div>

                
                <?php
                    $additionalFields = $customFields->where('section', 'additional')->filter(function($f) use ($record) {
                        return isset($record->custom_values[$f->label]) && !empty($record->custom_values[$f->label]);
                    });
                ?>

                <?php if($additionalFields->count() > 0): ?>
                    <div class="col-12 mt-4">
                        <h5 class="fw-bold mb-4 text-success border-start border-4 border-success ps-3">3. INFORMACIÓN COMPLEMENTARIA</h5>
                        <div class="row row-cols-1 row-cols-md-2 g-4">
                            <?php $__currentLoopData = $additionalFields; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $field): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="col">
                                    <div class="p-3 bg-white border border-start border-success border-4 rounded-3 h-100 shadow-sm">
                                        <label class="text-muted small text-uppercase fw-bold d-block mb-1"><?php echo e($field->label); ?></label>
                                        <span class="fs-5 fw-bold text-dark"><?php echo e($record->custom_values[$field->label]); ?></span>
                                    </div>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    </div>
                <?php endif; ?>
            </div>

            
            <div class="mt-5 pt-5">
                <div class="row justify-content-center text-center">
                    <div class="col-md-5">
                        <div class="border-top border-2 pt-3">
                            <p class="mb-0 fw-bold text-dark">FIRMA AUTORIZADA Y SELLO</p>
                            <p class="small text-muted text-uppercase">Dirección de Control de Estudios</p>
                        </div>
                    </div>
                </div>
            </div>

            
            <div class="mt-5 pt-4 border-top text-center">
                <p class="small text-muted mb-0">
                    <i class="bi bi-clock-history me-1"></i> Documento generado por el sistema el <?php echo e(date('d/m/Y H:i:s')); ?>

                </p>
                <p class="small text-muted font-monospace no-print">Ref: <?php echo e(strtoupper(substr(md5($record->dni . time()), 0, 12))); ?></p>
            </div>
        </div>

        
        <div class="alert alert-light mt-4 no-print border shadow-sm">
            <h6 class="fw-bold"><i class="bi bi-file-pdf me-2"></i>¿Cómo guardar como PDF?</h6>
            <ol class="small mb-0">
                <li>Haga clic en el botón <strong>"Imprimir / PDF"</strong> de arriba.</li>
                <li>En la ventana que se abre, seleccione <strong>"Guardar como PDF"</strong> en la opción de Destino.</li>
                <li>Haga clic en Guardar y elija una ubicación en su computadora.</li>
            </ol>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/fichaacademicaup/public_html/ficha_academica/resources/views/public/ficha.blade.php ENDPATH**/ ?>