
<?php if (isset($component)) { $__componentOriginalf2a1b2b34b0a376d40858ac9c2a946a5 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalf2a1b2b34b0a376d40858ac9c2a946a5 = $attributes; } ?>
<?php $component = App\View\Components\SiteLayout::resolve(['title' => ''.e($seoMetadata['title'] ?? $category->name . ' - Knowledge Base').'','metaDescription' => ''.e($seoMetadata['description'] ?? $category->description).''] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('site-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\SiteLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
    
    <?php if(isset($breadcrumbSchema)): ?>
        <?php echo $breadcrumbSchema; ?>

    <?php endif; ?>
    
    
    <div class="bg-gradient-to-r from-blue-600 to-blue-700 shadow-lg">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
            
            
            <div class="flex items-start">
                <div class="flex-shrink-0 w-16 h-16 rounded-xl <?php echo e($category->color ? "bg-{$category->color}-500" : 'bg-white'); ?> bg-opacity-20 flex items-center justify-center mr-4">
                    <i class="fas <?php echo e($category->icon ?? 'fa-folder'); ?> text-white text-2xl"></i>
                </div>
                <div>
                    <h1 class="text-3xl font-bold text-white"><?php echo e($category->name); ?></h1>
                    <?php if($category->description): ?>
                        <p class="text-blue-100 mt-2 max-w-5xl"><?php echo e($category->description); ?></p>
                    <?php endif; ?>
                </div>
            </div>
            
            
            <div class="mt-6 flex flex-wrap gap-4">
                <div class="bg-white bg-opacity-20 backdrop-blur-sm rounded-lg px-4 py-2">
                    <span class="text-blue-100 text-sm">Questions</span>
                    <p class="text-white text-xl font-bold"><?php echo e(number_format($category->published_questions_count ?? $questions->total())); ?></p>
                </div>
                <?php if($category->parent): ?>
                    <div class="bg-white bg-opacity-20 backdrop-blur-sm rounded-lg px-4 py-2">
                        <span class="text-blue-100 text-sm">Parent Category</span>
                        <p class="text-white text-sm">
                            <a href="<?php echo e(route('public.knowledge-base.category', $category->parent->slug)); ?>" class="hover:underline">
                                <?php echo e($category->parent->name); ?>

                            </a>
                        </p>
                    </div>
                <?php endif; ?>
            </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-blue-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>
                <a href="<?php echo e(route('public.knowledge-base.index')); ?>" class="hover:text-blue-600 transition">Knowledge Base</a>
                <i class="fas fa-chevron-right text-gray-400 text-xs"></i>
                <span class="text-gray-900 font-medium"><?php echo e($category->name); ?></span>
            </nav>
        </div>
    </div>

    
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
        <div class="grid grid-cols-1 lg:grid-cols-4 gap-8">
            
            
            <div class="lg:col-span-1 order-2 lg:order-1">
                <div class="sticky top-4 space-y-6">
                    
                    
                    <?php if($category->children->isNotEmpty()): ?>
                        <div class="bg-theme-card rounded-lg shadow-sm overflow-hidden">
                            <div class="bg-gradient-to-r from-blue-600 to-blue-700 px-4 py-3">
                                <h3 class="text-lg font-semibold text-white flex items-center">
                                    <i class="fas fa-folder-open mr-2"></i>
                                    Subcategories
                                </h3>
                            </div>
                            <ul class="divide-y theme-divider">
                                <?php $__currentLoopData = $category->children; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $child): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <li>
                                        <a href="<?php echo e(route('public.knowledge-base.category', $child->slug)); ?>" 
                                           class="flex items-center justify-between p-3 hover:bg-theme-body transition">
                                            <span class="flex items-center">
                                                <i class="fas <?php echo e($child->icon ?? 'fa-folder'); ?> <?php echo e($child->color ? "text-{$child->color}-500" : 'text-blue-500'); ?> mr-2"></i>
                                                <?php echo e($child->name); ?>

                                            </span>
                                            <span class="text-xs bg-theme-body px-2 py-1 rounded-full text-theme-body">
                                                <?php echo e($child->published_questions_count ?? 0); ?>

                                            </span>
                                        </a>
                                    </li>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </ul>
                        </div>
                    <?php endif; ?>
                    
                    
                    <div class="bg-theme-card rounded-lg shadow-sm p-4">
                        <h3 class="text-lg font-semibold text-theme-heading mb-3 flex items-center">
                            <i class="fas fa-signal text-blue-600 mr-2"></i>
                            Difficulty Level
                        </h3>
                        <div class="space-y-2">
                            <a href="<?php echo e(route('public.knowledge-base.category', [$category->slug, 'difficulty' => 'beginner'])); ?>" 
                               class="flex items-center p-2 rounded-lg hover:bg-theme-body transition <?php echo e(request('difficulty') === 'beginner' ? 'bg-green-50 text-green-700' : ''); ?>">
                                <span class="w-3 h-3 rounded-full bg-green-500 mr-2"></span>
                                Beginner
                            </a>
                            <a href="<?php echo e(route('public.knowledge-base.category', [$category->slug, 'difficulty' => 'intermediate'])); ?>" 
                               class="flex items-center p-2 rounded-lg hover:bg-theme-body transition <?php echo e(request('difficulty') === 'intermediate' ? 'bg-yellow-50 text-yellow-700' : ''); ?>">
                                <span class="w-3 h-3 rounded-full bg-yellow-500 mr-2"></span>
                                Intermediate
                            </a>
                            <a href="<?php echo e(route('public.knowledge-base.category', [$category->slug, 'difficulty' => 'advanced'])); ?>" 
                               class="flex items-center p-2 rounded-lg hover:bg-theme-body transition <?php echo e(request('difficulty') === 'advanced' ? 'bg-red-50 text-red-700' : ''); ?>">
                                <span class="w-3 h-3 rounded-full bg-red-500 mr-2"></span>
                                Advanced
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            
            
            <div class="lg:col-span-2 order-1 lg:order-2">
                
                
                <div class="bg-theme-card rounded-lg shadow-sm p-4 mb-6">
                    <form method="GET" class="flex flex-col md:flex-row gap-4">
                        <div class="flex-1 relative">
                            <input type="text" 
                                   name="q" 
                                   value="<?php echo e(request('q')); ?>"
                                   placeholder="Search in <?php echo e($category->name); ?>..."
                                   class="w-full pl-10 pr-4 py-2 border theme-divider rounded-lg bg-theme-body text-theme-body focus:ring-2 focus:ring-blue-500 focus:border-transparent">
                            <i class="fas fa-search absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"></i>
                        </div>
                        
                        <select name="sort" class="px-4 py-2 border theme-divider rounded-lg bg-theme-body text-theme-body focus:ring-2 focus:ring-blue-500">
                            <option value="recent" <?php echo e(request('sort') === 'recent' ? 'selected' : ''); ?>>Recent</option>
                            <option value="popular" <?php echo e(request('sort') === 'popular' ? 'selected' : ''); ?>>Popular</option>
                            <option value="helpful" <?php echo e(request('sort') === 'helpful' ? 'selected' : ''); ?>>Most Helpful</option>
                        </select>
                        
                        <button type="submit" class="px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition">
                            <i class="fas fa-filter mr-2"></i>
                            Filter
                        </button>
                    </form>
                </div>
                
                
                <div class="space-y-4">
                    <?php $__empty_1 = true; $__currentLoopData = $questions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $question): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <?php echo $__env->make('public.knowledge-base.partials.question-card', ['question' => $question], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <div class="bg-theme-card rounded-lg shadow-sm p-8 text-center">
                            <i class="fas fa-book text-4xl text-gray-300 mb-4"></i>
                            <h3 class="text-lg font-medium text-theme-heading mb-2">No questions in this category</h3>
                            <p class="text-theme-body mb-4">
                                <?php if(request('q')): ?>
                                    No questions match your search in this category.
                                <?php else: ?>
                                    No questions have been added to this category yet.
                                <?php endif; ?>
                            </p>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('create knowledge base questions')): ?>
                                <a href="<?php echo e(route('knowledge-sharing.knowledge-base.create', ['category_id' => $category->id])); ?>" 
                                   class="inline-flex items-center px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition">
                                    <i class="fas fa-plus mr-2"></i>
                                    Add Question
                                </a>
                            <?php endif; ?>
                        </div>
                    <?php endif; ?>
                </div>
                
                
                <?php if($questions->hasPages()): ?>
                    <div class="mt-6">
                        <?php echo e($questions->links()); ?>

                    </div>
                <?php endif; ?>
            </div>
            
            
            <div class="lg:col-span-1 order-3">
                <div class="sticky top-4 space-y-6">
                    
                    
                    <div class="bg-theme-card rounded-lg shadow-sm overflow-hidden">
                        <div class="bg-gradient-to-r from-blue-600 to-blue-700 px-4 py-3">
                            <h3 class="text-lg font-semibold text-white flex items-center">
                                <i class="fas fa-folder mr-2"></i>
                                All Categories
                            </h3>
                        </div>
                        <ul class="divide-y theme-divider max-h-64 overflow-y-auto">
                            <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <li>
                                    <a href="<?php echo e(route('public.knowledge-base.category', $cat->slug)); ?>" 
                                       class="flex items-center justify-between p-3 hover:bg-theme-body transition <?php echo e($category->id === $cat->id ? 'bg-blue-50 border-l-4 border-blue-600' : ''); ?>">
                                        <span class="flex items-center">
                                            <i class="fas <?php echo e($cat->icon ?? 'fa-folder'); ?> <?php echo e($cat->color ? "text-{$cat->color}-500" : 'text-blue-500'); ?> mr-2"></i>
                                            <?php echo e($cat->name); ?>

                                        </span>
                                        <span class="text-xs bg-theme-body px-2 py-1 rounded-full text-theme-body">
                                            <?php echo e($cat->published_questions_count ?? 0); ?>

                                        </span>
                                    </a>
                                </li>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </ul>
                    </div>
                    
                    
                    <div class="bg-theme-card rounded-lg shadow-sm p-4">
                        <h3 class="text-lg font-semibold text-theme-heading mb-3 flex items-center">
                            <i class="fas fa-tags text-blue-600 mr-2"></i>
                            Popular Tags
                        </h3>
                        <div class="flex flex-wrap gap-2">
                            <?php $__currentLoopData = $tags; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tag => $count): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php if($count > 0): ?>
                                    <a href="<?php echo e(route('public.knowledge-base.tag', $tag)); ?>" 
                                       class="px-3 py-1 bg-theme-body text-theme-body rounded-full text-sm hover:bg-blue-100 hover:text-blue-700 transition">
                                        <?php echo e($tag); ?>

                                        <span class="text-xs text-gray-400 ml-1"><?php echo e($count); ?></span>
                                    </a>
                                <?php endif; ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalf2a1b2b34b0a376d40858ac9c2a946a5)): ?>
<?php $attributes = $__attributesOriginalf2a1b2b34b0a376d40858ac9c2a946a5; ?>
<?php unset($__attributesOriginalf2a1b2b34b0a376d40858ac9c2a946a5); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalf2a1b2b34b0a376d40858ac9c2a946a5)): ?>
<?php $component = $__componentOriginalf2a1b2b34b0a376d40858ac9c2a946a5; ?>
<?php unset($__componentOriginalf2a1b2b34b0a376d40858ac9c2a946a5); ?>
<?php endif; ?>
<?php /**PATH /home/www/sshia.org/sshia/resources/views/public/knowledge-base/category.blade.php ENDPATH**/ ?>