<?php $__env->startSection('title', 'Careers'); ?>
<?php $__env->startSection('header', 'Manage Careers'); ?>

<?php $__env->startSection('content'); ?>
<div class="bg-white rounded-lg shadow">
    <div class="p-6 border-b border-gray-200 flex justify-between items-center">
        <h3 class="text-lg font-medium text-gray-900">All Career Listings</h3>
        <a href="<?php echo e(route('admin.careers.create')); ?>" 
           class="inline-flex items-center px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 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>
            Add New Career
        </a>
    </div>

    <div class="overflow-x-auto">
        <table class="w-full">
            <thead class="bg-gray-50">
                <tr>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Title</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Department</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Location</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Type</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Applications</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Valid Through</th>
                    <th class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
                </tr>
            </thead>
            <tbody class="divide-y divide-gray-200">
                <?php $__empty_1 = true; $__currentLoopData = $careers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $career): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr class="hover:bg-gray-50">
                        <td class="px-6 py-4">
                            <div class="text-sm font-medium text-gray-900"><?php echo e($career->title); ?></div>
                            <div class="text-sm text-gray-500"><?php echo e(Str::limit($career->slug, 30)); ?></div>
                        </td>
                        <td class="px-6 py-4 text-sm text-gray-900"><?php echo e($career->department ?? 'N/A'); ?></td>
                        <td class="px-6 py-4 text-sm text-gray-900"><?php echo e($career->location); ?></td>
                        <td class="px-6 py-4">
                            <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full 
                                <?php switch($career->employment_type):
                                    case ('full-time'): ?> bg-blue-100 text-blue-800 <?php break; ?>
                                    <?php case ('part-time'): ?> bg-yellow-100 text-yellow-800 <?php break; ?>
                                    <?php case ('contract'): ?> bg-purple-100 text-purple-800 <?php break; ?>
                                    <?php case ('internship'): ?> bg-green-100 text-green-800 <?php break; ?>
                                    <?php case ('remote'): ?> bg-indigo-100 text-indigo-800 <?php break; ?>
                                    <?php default: ?> bg-gray-100 text-gray-800
                                <?php endswitch; ?>">
                                <?php echo e(ucfirst($career->employment_type)); ?>

                            </span>
                        </td>
                        <td class="px-6 py-4">
                            <form action="<?php echo e(route('admin.careers.toggle', $career)); ?>" method="POST" class="inline">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('PATCH'); ?>
                                <button type="submit" 
                                        class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full cursor-pointer transition
                                            <?php echo e($career->is_active ? 'bg-green-100 text-green-800 hover:bg-green-200' : 'bg-red-100 text-red-800 hover:bg-red-200'); ?>">
                                    <?php echo e($career->is_active ? 'Active' : 'Inactive'); ?>

                                </button>
                            </form>
                        </td>
                        <td class="px-6 py-4 text-sm text-gray-900">
                            <a href="<?php echo e(route('admin.applications.index', ['career_id' => $career->id])); ?>" 
                               class="text-blue-600 hover:text-blue-800">
                                <?php echo e($career->applications_count); ?>

                            </a>
                        </td>
                        <td class="px-6 py-4 text-sm text-gray-500">
                            <?php echo e($career->valid_through ? $career->valid_through->format('M d, Y') : 'No expiry'); ?>

                        </td>
                        <td class="px-6 py-4 text-right space-x-2">
                            <a href="<?php echo e(route('admin.careers.show', $career)); ?>" 
                               class="text-blue-600 hover:text-blue-900 text-sm font-medium">View</a>
                            <a href="<?php echo e(route('admin.careers.edit', $career)); ?>" 
                               class="text-indigo-600 hover:text-indigo-900 text-sm font-medium">Edit</a>
                            <form action="<?php echo e(route('admin.careers.destroy', $career)); ?>" method="POST" class="inline">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('DELETE'); ?>
                                <button type="submit" 
                                        class="text-red-600 hover:text-red-900 text-sm font-medium"
                                        onclick="return confirm('Are you sure you want to delete this career?')">
                                    Delete
                                </button>
                            </form>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr>
                        <td colspan="8" class="px-6 py-10 text-center text-gray-500">
                            <div class="flex flex-col items-center">
                                <svg class="w-12 h-12 text-gray-300 mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
                                </svg>
                                <p class="text-lg font-medium">No careers found</p>
                                <p class="text-sm mt-1">Get started by creating a new career listing.</p>
                                <a href="<?php echo e(route('admin.careers.create')); ?>" 
                                   class="mt-4 inline-flex items-center px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition">
                                    Add New Career
                                </a>
                            </div>
                        </td>
                    </tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>

    <?php if($careers->hasPages()): ?>
        <div class="px-6 py-4 border-t border-gray-200">
            <?php echo e($careers->links()); ?>

        </div>
    <?php endif; ?>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\Arshad\technology site\galtech-nextjs\admin-panel\resources\views/admin/careers/index.blade.php ENDPATH**/ ?>