<?php
    $settings = \App\GeneralSettings::first();
?>



<?php $__env->startSection('title', 'Forum - ' . ($topics->count() > 0 ? $topics[0]->category->forum_category_name : 'Category')); ?>

<?php $__env->startPush('styles'); ?>
<style>
  

    .content-card {
        background: rgba(255,255,255,0.95);
        backdrop-filter: blur(10px);
        border-radius: 20px;
        box-shadow: 0 20px 50px rgba(0,0,0,0.4);
        overflow: hidden;
    }

    .content-card .card-body {
        background: white;
        color: #212529;
    }

    .topic-card {
        background: white;
        border-radius: 16px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.12);
        transition: all 0.4s ease;
    }

    .topic-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    }

    .category-badge {
        background: var(--primary);
        color: white;
        padding: 0.8rem 2rem;
        border-radius: 50px;
        font-weight: 700;
        font-size: 1.1rem;
        box-shadow: 0 0 25px rgba(108,92,231,0.5);
        display: inline-block;
    }
</style>
<?php $__env->stopPush(); ?>

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


<div class="hero-section text-white text-center position-relative">
    <div class="container position-relative">
        <h1 class="display-3 fw-bold text-uppercase mb-3">FORUMS</h1>
        <h5 class="fw-light fs-3 opacity-90"><?php echo e($settings->website_name); ?> Community</h5>
    </div>
</div>

<div class="container my-5">

    
    <div class="d-flex justify-content-end mb-5 gap-3 flex-wrap">
        <a href="<?php echo e(route('topic.create')); ?>" class="btn btn-primary px-5 py-3 fw-bold">
            Add New Topic
        </a>
        <a href="<?php echo e(route('topicmanager.index')); ?>" class="btn btn-outline-light border-2 px-5 py-3 fw-bold">
            My Topics
        </a>
    </div>

    
    <div class="text-center mb-5">
        <?php if($topics->count() > 0): ?>
            <div class="category-badge mb-4">
                <?php echo e($topics[0]->category->forum_category_name); ?>

            </div>
            <h1 class="display-4 fw-bold mb-4"><?php echo e($topics[0]->category->forum_category_name); ?></h1>
            <p class="lead text-white fs-5 px-3">
                <?php echo $topics[0]->category->forum_category_description ?? 'Join the discussion and share your thoughts!'; ?>

            </p>
        <?php else: ?>
        <div class="text-center py-5">
    <i class="fas fa-folder-open fa-5x mb-4" style="color: #6c757d; opacity: 0.7;"></i>
    <h2 class="text-white fw-bold mb-3" style="text-shadow: 0 2px 10px rgba(0,0,0,0.6);">This category is empty</h2>
    <p class="text-light fs-4 opacity-90">Be the first to create a topic!</p>
</div>
        <?php endif; ?>
    </div>

    <div class="row g-5">
        
        <div class="col-lg-9">
            <?php $__empty_1 = true; $__currentLoopData = $topics; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $topic): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <div class="topic-card card shadow mb-4">
                    <div class="card-body p-5">
                        <h3 class="fw-bold mb-3">
                            <a href="<?php echo e(route('topic.show', $topic->topic_id)); ?>" class="text-decoration-none text-primary">
                                <?php echo e($topic->topic_title); ?>

                            </a>
                        </h3>
                        <div class="text-dark opacity-90 lh-lg mb-4 fs-5">
                            <?php echo Str::limit(strip_tags($topic->topic_content), 300); ?>

                        </div>
                        <div class="d-flex flex-wrap gap-4 text-muted small">
                            <span>By <strong><?php echo e(optional($topic->user)->name ?? 'Guest'); ?></strong></span>
                            <span><?php echo e($topic->topic_views); ?> views</span>
                            <span><?php echo e($topic->comments->count()); ?> replies</span>
                            <span><?php echo e($topic->created_at->diffForHumans()); ?></span>
                        </div>
                    </div>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <div class="text-center py-6">
                    <i class="fas fa-inbox fa-6x text-muted opacity-25 mb-4"></i>
                    <h4 class="text-white">No topics yet</h4>
                </div>
            <?php endif; ?>

            <div class="mt-5 d-flex justify-content-center">
                <?php echo e($topics->onEachSide(2)->links()); ?>

            </div>
        </div>

        
        <div class="col-lg-3">
            <div class="card shadow-lg border-0 sticky-top content-card" style="top: 100px;">
                <div class="card-header text-white text-center fw-bold py-4" style="background: var(--primary); border-radius: 20px 20px 0 0;">
                    Forum Categories
                </div>
                <div class="card-body p-4 bg-white">
                    <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <a href="<?php echo e(route('forumcategory.show', $category->forum_category_id)); ?>"
                           class="d-block text-decoration-none py-3 px-4 rounded mb-2 fw-bold
                                  <?php echo e(request()->route('id') == $category->forum_category_id ? 'bg-primary text-white' : 'text-dark bg-light'); ?>">
                            <?php echo e($category->forum_category_name); ?>

                        </a>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            </div>
        </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 /home2/reckons1/public_html/store1.reckonsoul.fun/resources/views/forum/category.blade.php ENDPATH**/ ?>