<?php $__env->startSection('title', 'Research & Innovation Centre'); ?>
<?php $__env->startSection('meta-description', 'Explore published research, clinical studies, and innovative projects from our community.'); ?>

<?php $__env->startSection('content'); ?>

<div class="bg-gradient-to-r from-emerald-600 to-teal-700 shadow-lg">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
        <div class="flex items-center justify-between mb-6">
            <div class="flex items-center">
                <i class="fas fa-microscope text-white text-4xl mr-4"></i>
                <div>
                    <h1 class="text-4xl font-bold text-white font-serif">
                        Research & Innovation Centre
                    </h1>
                    <p class="text-emerald-100 mt-2 text-lg">
                        Discover groundbreaking research and scholarly publications from our academic community
                    </p>
                </div>
            </div>
        </div>

        
        <div class="bg-white bg-opacity-20 backdrop-blur-sm rounded-xl p-6">
            <form action="<?php echo e(route('research.public.index')); ?>" method="GET" class="flex flex-col md:flex-row gap-4">
                <div class="flex-1">
                    <div class="relative">
                        <i class="fas fa-search absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-400"></i>
                        <input type="text" 
                               name="q" 
                               value="<?php echo e($filters['q'] ?? ''); ?>"
                               placeholder="Search publications by title, abstract, or keywords..."
                               class="w-full pl-12 pr-4 py-3 rounded-lg border-0 focus:ring-2 focus:ring-emerald-500 focus:outline-none">
                    </div>
                </div>
                <div class="w-full md:w-64">
                    <select name="category" 
                            class="w-full px-4 py-3 rounded-lg border-0 focus:ring-2 focus:ring-emerald-500 focus:outline-none">
                        <option value="">All Categories</option>
                        <option value="clinical" <?php echo e(($filters['category'] ?? '') === 'clinical' ? 'selected' : ''); ?>>
                            Clinical Research
                        </option>
                        <option value="tech" <?php echo e(($filters['category'] ?? '') === 'tech' ? 'selected' : ''); ?>>
                            Technology & Innovation
                        </option>
                        <option value="social" <?php echo e(($filters['category'] ?? '') === 'social' ? 'selected' : ''); ?>>
                            Social Sciences
                        </option>
                    </select>
                </div>
                <button type="submit" 
                        class="px-6 py-3 bg-emerald-800 text-white rounded-lg hover:bg-emerald-900 transition font-medium">
                    <i class="fas fa-filter mr-2"></i>
                    Filter
                </button>
            </form>
        </div>
    </div>
</div>


<div class="bg-gray-50 border-b border-gray-200">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-3">
        <nav class="flex items-center space-x-2 text-sm text-gray-600" aria-label="Breadcrumb">
            <a href="<?php echo e(url('/')); ?>" class="hover:text-emerald-600 transition flex items-center">
                <i class="fas fa-home mr-1"></i>Home
            </a>
            <i class="fas fa-chevron-right text-gray-400 text-xs"></i>
            <span class="text-gray-900 font-medium">Research & Innovation Centre</span>
        </nav>
    </div>
</div>


<?php if($featured->count() > 0): ?>
<section class="py-12 bg-gray-50">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
        <div class="flex items-center justify-between mb-8">
            <div>
                <h2 class="text-2xl font-bold text-gray-900 font-serif flex items-center">
                    <i class="fas fa-star text-yellow-500 mr-3"></i>
                    Featured Research
                </h2>
                <p class="text-gray-600 mt-1">Highlighted publications selected by our editorial team</p>
            </div>
            <a href="<?php echo e(route('research.public.featured')); ?>" 
               class="text-emerald-600 hover:text-emerald-700 font-medium flex items-center">
                View all featured
                <i class="fas fa-arrow-right ml-2"></i>
            </a>
        </div>

        <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
            <?php $__currentLoopData = $featured; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $publication): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <article class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-xl transition-shadow duration-300">
                <?php if($publication->cover_image): ?>
                <div class="h-48 overflow-hidden">
                    <img src="<?php echo e(Storage::url($publication->cover_image)); ?>" 
                         alt="<?php echo e($publication->title); ?>"
                         class="w-full h-full object-cover">
                </div>
                <?php else: ?>
                <div class="h-48 bg-gradient-to-br from-emerald-400 to-teal-500 flex items-center justify-center">
                    <i class="fas fa-book-open text-white text-5xl opacity-50"></i>
                </div>
                <?php endif; ?>
                
                <div class="p-6">
                    <div class="flex items-center gap-2 mb-3">
                        <span class="px-2 py-1 bg-emerald-100 text-emerald-700 text-xs font-semibold rounded-full uppercase">
                            <?php echo e($publication->category_label); ?>

                        </span>
                        <?php if($publication->is_featured): ?>
                        <span class="px-2 py-1 bg-yellow-100 text-yellow-700 text-xs font-semibold rounded-full">
                            <i class="fas fa-star mr-1"></i>Featured
                        </span>
                        <?php endif; ?>
                    </div>
                    
                    <h3 class="text-lg font-bold text-gray-900 font-serif mb-2 line-clamp-2">
                        <a href="<?php echo e(route('research.public.show', $publication)); ?>" 
                           class="hover:text-emerald-600 transition">
                            <?php echo e($publication->title); ?>

                        </a>
                    </h3>
                    
                    <p class="text-gray-600 text-sm mb-4 line-clamp-3">
                        <?php echo e(Str::limit($publication->abstract, 150)); ?>

                    </p>
                    
                    <div class="flex items-center justify-between">
                        <div class="flex items-center text-sm text-gray-500">
                            <i class="fas fa-user mr-2"></i>
                            <?php echo e($publication->user->name ?? 'Unknown Author'); ?>

                        </div>
                        <span class="text-xs text-gray-400">
                            <?php echo e($publication->approved_at?->format('M d, Y') ?? 'N/A'); ?>

                        </span>
                    </div>
                </div>
            </article>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    </div>
</section>
<?php endif; ?>


<section class="py-12">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
        <div class="flex items-center justify-between mb-8">
            <div>
                <h2 class="text-2xl font-bold text-gray-900 font-serif">
                    All Publications
                </h2>
                <p class="text-gray-600 mt-1">
                    <?php echo e($publications->total()); ?> research publications available
                </p>
            </div>
            
            <div class="flex items-center gap-4">
                <?php if(auth()->guard()->check()): ?>
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('create publications')): ?>
                <a href="<?php echo e(route('research.create')); ?>" 
                   class="px-4 py-2 bg-emerald-600 text-white rounded-lg hover:bg-emerald-700 transition font-medium">
                    <i class="fas fa-plus mr-2"></i>
                    Submit Research
                </a>
                <?php endif; ?>
                <?php else: ?>
                <a href="<?php echo e(route('login')); ?>" 
                   class="px-4 py-2 bg-emerald-600 text-white rounded-lg hover:bg-emerald-700 transition font-medium">
                    <i class="fas fa-sign-in-alt mr-2"></i>
                    Login to Submit
                </a>
                <?php endif; ?>
            </div>
        </div>

        <?php if($publications->count() > 0): ?>
        <div class="space-y-6">
            <?php $__currentLoopData = $publications; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $publication): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <article class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden hover:shadow-md transition-shadow duration-300">
                <div class="flex flex-col md:flex-row">
                    
                    <div class="w-full md:w-64 h-48 md:h-auto flex-shrink-0">
                        <?php if($publication->cover_image): ?>
                        <img src="<?php echo e(Storage::url($publication->cover_image)); ?>" 
                             alt="<?php echo e($publication->title); ?>"
                             class="w-full h-full object-cover">
                        <?php else: ?>
                        <div class="w-full h-full bg-gradient-to-br from-gray-100 to-gray-200 flex items-center justify-center">
                            <i class="fas fa-file-alt text-gray-400 text-4xl"></i>
                        </div>
                        <?php endif; ?>
                    </div>
                    
                    
                    <div class="flex-1 p-6">
                        <div class="flex items-center gap-2 mb-3">
                            <span class="px-2 py-1 bg-emerald-100 text-emerald-700 text-xs font-semibold rounded-full uppercase">
                                <?php echo e($publication->category_label); ?>

                            </span>
                            <span class="px-2 py-1 bg-blue-100 text-blue-700 text-xs font-semibold rounded-full">
                                <?php echo e($publication->author_badge); ?>

                            </span>
                        </div>
                        
                        <h3 class="text-xl font-bold text-gray-900 font-serif mb-2">
                            <a href="<?php echo e(route('research.public.show', $publication)); ?>" 
                               class="hover:text-emerald-600 transition">
                                <?php echo e($publication->title); ?>

                            </a>
                        </h3>
                        
                        <p class="text-gray-600 mb-4 line-clamp-2">
                            <?php echo e(Str::limit($publication->abstract, 250)); ?>

                        </p>
                        
                        <div class="flex flex-wrap items-center justify-between gap-4">
                            <div class="flex items-center gap-4 text-sm text-gray-500">
                                <span class="flex items-center">
                                    <i class="fas fa-user mr-2"></i>
                                    <?php echo e($publication->user->name ?? 'Unknown'); ?>

                                </span>
                                <span class="flex items-center">
                                    <i class="fas fa-calendar mr-2"></i>
                                    <?php echo e($publication->approved_at?->format('M d, Y') ?? 'N/A'); ?>

                                </span>
                                <?php if($publication->files->count() > 0): ?>
                                <span class="flex items-center">
                                    <i class="fas fa-paperclip mr-2"></i>
                                    <?php echo e($publication->files->count()); ?> file(s)
                                </span>
                                <?php endif; ?>
                            </div>
                            
                            <a href="<?php echo e(route('research.public.show', $publication)); ?>" 
                               class="text-emerald-600 hover:text-emerald-700 font-medium flex items-center">
                                Read more
                                <i class="fas fa-arrow-right ml-2"></i>
                            </a>
                        </div>
                    </div>
                </div>
            </article>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>

        
        <div class="mt-8">
            <?php echo e($publications->links()); ?>

        </div>
        <?php else: ?>
        <div class="text-center py-16 bg-gray-50 rounded-xl">
            <i class="fas fa-search text-gray-300 text-6xl mb-4"></i>
            <h3 class="text-xl font-semibold text-gray-700 mb-2">No publications found</h3>
            <p class="text-gray-500 mb-4">
                <?php if(!empty($filters['q']) || !empty($filters['category'])): ?>
                Try adjusting your search filters
                <?php else: ?>
                Be the first to submit a research publication!
                <?php endif; ?>
            </p>
            <?php if(!empty($filters['q']) || !empty($filters['category'])): ?>
            <a href="<?php echo e(route('research.public.index')); ?>" 
               class="text-emerald-600 hover:text-emerald-700 font-medium">
                Clear all filters
            </a>
            <?php endif; ?>
        </div>
        <?php endif; ?>
    </div>
</section>


<section class="py-16 bg-gradient-to-r from-emerald-600 to-teal-700">
    <div class="max-w-4xl mx-auto px-4 text-center">
        <h2 class="text-3xl font-bold text-white font-serif mb-4">
            Share Your Research
        </h2>
        <p class="text-emerald-100 text-lg mb-8">
            Join our community of researchers and contribute to the advancement of knowledge. 
            Submit your research papers, clinical studies, or innovative projects for peer review.
        </p>
        <?php if(auth()->guard()->check()): ?>
        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('create publications')): ?>
        <a href="<?php echo e(route('research.create')); ?>" 
           class="inline-flex items-center px-6 py-3 bg-white text-emerald-700 rounded-lg font-semibold hover:bg-gray-100 transition">
            <i class="fas fa-upload mr-2"></i>
            Submit Your Research
        </a>
        <?php endif; ?>
        <?php else: ?>
        <a href="<?php echo e(route('register')); ?>" 
           class="inline-flex items-center px-6 py-3 bg-white text-emerald-700 rounded-lg font-semibold hover:bg-gray-100 transition">
            <i class="fas fa-user-plus mr-2"></i>
            Create Account to Submit
        </a>
        <?php endif; ?>
    </div>
</section>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.site', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/www/sshia.org/sshia/resources/views/research/public/index.blade.php ENDPATH**/ ?>