

<?php $__env->startSection('meta_title', 'Forum - Askeri Platform'); ?>
<?php $__env->startSection('meta_description', 'Askeri kariyer, KPSS ve mülakat hakkında tartışmalar yapın ve diğer adaylarla bağlantı kurun.'); ?>

<?php $__env->startSection('content'); ?>
<style>
/* ========================================
   XenForo-Style Forum Index - Modern Design
   ======================================== */

/* Hero Banner */
.forum-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1d4ed8 100%);
    color: white;
    padding: 48px 40px;
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.3);
    position: relative;
    overflow: hidden;
}
.forum-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    pointer-events: none;
}
.forum-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: 5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.hero-title-group h1 {
    font-size: 34px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}
.hero-title-group p {
    font-size: 15px;
    opacity: 0.8;
    max-width: 520px;
    line-height: 1.6;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.btn-hero-primary {
    padding: 12px 24px;
    background: white;
    color: #1d4ed8;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.btn-hero-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); }
.btn-hero-secondary {
    padding: 12px 24px;
    background: rgba(255,255,255,0.12);
    color: white;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.btn-hero-secondary:hover { background: rgba(255,255,255,0.2); }

/* Stats Strip */
.forum-stats {
    display: flex;
    gap: 0;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    overflow: hidden;
}
.stat-item {
    flex: 1;
    padding: 16px 20px;
    border-right: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}
.stat-item:last-child { border-right: none; }
.stat-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.stat-data {}
.stat-number {
    font-size: 22px;
    font-weight: 800;
    display: block;
    line-height: 1;
}
.stat-label {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 3px;
    display: block;
}
@media (max-width: 768px) {
    .forum-hero { padding: 28px 20px; }
    .hero-top { flex-direction: column; }
    .hero-title-group h1 { font-size: 24px; }
    .forum-stats { flex-wrap: wrap; }
    .stat-item { flex: 1 1 45%; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); }
}


/* ── Layout ── */
.forum-layout {
    display: block;
}

/* ── Bottom widgets grid ── */
.bottom-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 32px;
}
@media (max-width: 900px) {
    .bottom-widgets { grid-template-columns: 1fr; }
}

/* ── Section Headers ── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3b82f6;
}
.section-link {
    font-size: 12px;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
}
.section-link:hover { text-decoration: underline; }

/* ── XenForo Category Block ── */
.category-block {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}
.category-block:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: #d1d5db;
}
.category-block-header {
    display: flex;
    align-items: center;
    padding: 18px 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    gap: 16px;
}
.category-block-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25);
    transition: transform 0.25s ease;
}
.category-block:hover .category-block-icon {
    transform: scale(1.05);
}
.category-block-info { flex: 1; min-width: 0; }
.category-block-name {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
    transition: color 0.2s;
}
.category-block-name:hover { color: #1d4ed8; }
.category-block-desc {
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.category-block-stats {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
}
.cat-stat-box {
    text-align: center;
    min-width: 60px;
}
.cat-stat-num {
    font-size: 19px;
    font-weight: 800;
    color: #1d4ed8;
    display: block;
    line-height: 1;
    margin-bottom: 3px;
}
.cat-stat-lbl {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}

/* Sub-category rows */
.subcategory-list {
    border-top: 1px solid #f1f5f9;
}
.subcategory-row {
    display: grid;
    grid-template-columns: auto 1fr auto 200px;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    border-bottom: 1px solid #f8fafc;
    transition: all 0.2s ease;
}
.subcategory-row:last-child { border-bottom: none; }
.subcategory-row:hover {
    background: linear-gradient(90deg, #f8fafc 0%, #ffffff 100%);
    padding-left: 28px;
}

/* No-subcategory: single row for the category itself */
.category-row-single {
    display: grid;
    grid-template-columns: auto 1fr auto 200px;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    transition: all 0.2s ease;
}
.category-row-single:hover {
    background: linear-gradient(90deg, #f8fafc 0%, #ffffff 100%);
    padding-left: 28px;
}

.row-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
}
.row-info { min-width: 0; }
.row-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    display: block;
    margin-bottom: 3px;
    transition: color 0.2s;
}
.row-name:hover { color: #1d4ed8; }
.row-desc {
    font-size: 12px;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.row-counts {
    display: flex;
    gap: 14px;
    flex-shrink: 0;
}
.row-count {
    text-align: center;
    min-width: 48px;
}
.row-count-num {
    font-size: 15px;
    font-weight: 700;
    color: #475569;
    display: block;
}
.row-count-lbl {
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
}

/* Last post cell */
.last-post-cell { min-width: 0; }
.last-post-title {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
    transition: color 0.2s;
}
.last-post-title:hover { color: #1d4ed8; }
.last-post-meta {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.last-post-avatar {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 9px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(29, 78, 216, 0.2);
}
.no-posts-cell {
    font-size: 12px;
    color: #cbd5e1;
    font-style: italic;
}

@media (max-width: 768px) {
    .subcategory-row,
    .category-row-single { grid-template-columns: auto 1fr; }
    .row-counts, .last-post-cell { display: none; }
    .category-block-stats { display: none; }
}


/* ── Widget Cards (bottom grid) ── */
.sidebar-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}
.sidebar-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    border-color: #d1d5db;
}
.sidebar-card-header {
    padding: 14px 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-topic-item {
    padding: 11px 16px;
    border-bottom: 1px solid #f8fafc;
    display: block;
    text-decoration: none;
    transition: all 0.2s ease;
}
.sidebar-topic-item:last-child { border-bottom: none; }
.sidebar-topic-item:hover {
    background: linear-gradient(90deg, #f8fafc 0%, #ffffff 100%);
    padding-left: 20px;
}
.sidebar-topic-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    display: block;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s;
}
.sidebar-topic-item:hover .sidebar-topic-title { color: #1d4ed8; }
.sidebar-topic-meta {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sidebar-cat-badge {
    background: #eff6ff;
    color: #1d4ed8;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
}

/* ── Recent Activity (main) ── */
.activity-list {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.activity-item {
    display: flex;
    gap: 14px;
    padding: 15px 24px;
    border-bottom: 1px solid #f1f5f9;
    align-items: flex-start;
    transition: all 0.2s ease;
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover {
    background: linear-gradient(90deg, #f8fafc 0%, #ffffff 100%);
    padding-left: 28px;
}
.activity-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(29, 78, 216, 0.2);
}
.activity-body { flex: 1; min-width: 0; }
.activity-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
    transition: color 0.2s;
}
.activity-title:hover { color: #1d4ed8; }
.activity-meta {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.activity-meta .dot { color: #cbd5e1; }
.activity-excerpt {
    font-size: 12px;
    color: #64748b;
    margin-top: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.5;
}

/* ── Forum Statistics Panel ── */
.forum-stats-panel {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    margin-top: 16px;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.stats-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.stats-panel-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    transition: all 0.25s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-card-content {
    flex: 1;
    min-width: 0;
}
.stat-card-value {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    display: block;
    line-height: 1;
    margin-bottom: 2px;
}
.stat-card-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stats-footer {
    display: flex;
    gap: 24px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}
.stats-footer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
}
.stats-footer-icon {
    font-size: 16px;
}
.stats-footer-text {
    font-weight: 500;
}
@media (max-width: 600px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-footer { flex-direction: column; gap: 12px; }
}

/* ── Empty States ── */
.empty-row {
    padding: 24px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}
</style>


<div class="forum-hero">
    <div class="hero-content">
        <div class="hero-top">
            <div class="hero-title-group">
                <h1>🗨️ Forum Topluluğu</h1>
                <p>Askeri kariyer, KPSS, mülakat ve üniversite hakkında binlerce adayla tartışın, deneyimlerinizi paylaşın.</p>
            </div>
            <div class="hero-actions">
                <?php if(auth()->guard()->check()): ?>
                    <a href="<?php echo e(route('forum.create_topic')); ?>" class="btn-hero-primary">
                        <svg style="width:16px;height:16px" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M12 4v16m8-8H4"/>
                        </svg>
                        Yeni Konu Aç
                    </a>
                <?php else: ?>
                    <a href="<?php echo e(route('login')); ?>" class="btn-hero-primary">
                        <svg style="width:16px;height:16px" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"/>
                        </svg>
                        Giriş Yap
                    </a>
                    <a href="<?php echo e(route('register')); ?>" class="btn-hero-secondary">
                        Üye Ol
                    </a>
                <?php endif; ?>
                <a href="<?php echo e(route('forum.search')); ?>" class="btn-hero-secondary">
                    <svg style="width:15px;height:15px" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
                    </svg>
                    Ara
                </a>
            </div>
        </div>

        
        <div class="forum-stats">
            <div class="stat-item">
                <div class="stat-icon">💬</div>
                <div class="stat-data">
                    <span class="stat-number"><?php echo e(number_format($stats['total_topics'])); ?></span>
                    <span class="stat-label">Konu</span>
                </div>
            </div>
            <div class="stat-item">
                <div class="stat-icon">📝</div>
                <div class="stat-data">
                    <span class="stat-number"><?php echo e(number_format($stats['total_posts'])); ?></span>
                    <span class="stat-label">Mesaj</span>
                </div>
            </div>
            <div class="stat-item">
                <div class="stat-icon">👥</div>
                <div class="stat-data">
                    <span class="stat-number"><?php echo e(number_format($stats['total_members'])); ?></span>
                    <span class="stat-label">Üye</span>
                </div>
            </div>
            <?php if($stats['latest_user']): ?>
            <div class="stat-item">
                <div class="stat-icon">🆕</div>
                <div class="stat-data">
                    <span class="stat-number" style="font-size:14px;line-height:1.4;"><?php echo e($stats['latest_user']->name); ?></span>
                    <span class="stat-label">Son Üye</span>
                </div>
            </div>
            <?php endif; ?>
        </div>
    </div>
</div>


<div class="forum-layout">

    
    <div>
        
    <?php if($recentTopics->count() > 0): ?>
    <div class="section-header">
        <div class="section-title">
            <span class="section-title-dot"></span>
            Son Etkinlik
        </div>
    </div>
    <div class="activity-list" style="margin-bottom:28px;">
        <?php $__currentLoopData = $recentTopics->take(5); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $topic): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <div class="activity-item">
            <div class="activity-avatar" style="background: linear-gradient(135deg, hsl(<?php echo e(crc32($topic->user->name ?? 'A') % 360); ?>, 60%, 45%) 0%, hsl(<?php echo e((crc32($topic->user->name ?? 'A') % 360) + 30); ?>, 60%, 55%) 100%);">
                <?php echo e(strtoupper(substr($topic->user->name ?? 'A', 0, 1))); ?>

            </div>
            <div class="activity-body">
                <a href="<?php echo e(route('forum.topic', [$topic->category->slug, $topic->slug])); ?>" class="activity-title">
                    <?php echo e($topic->title); ?>

                </a>
                <div class="activity-meta">
                    <span><?php echo e($topic->user->name ?? 'Anonim'); ?></span>
                    <span class="dot">•</span>
                    <span><?php echo e($topic->last_reply_at ? $topic->last_reply_at->diffForHumans() : $topic->created_at->diffForHumans()); ?></span>
                    <span class="dot">•</span>
                    <span style="color:#3b82f6;"><?php echo e($topic->category->name ?? ''); ?></span>
                    <span class="dot">•</span>
                    <span><?php echo e($topic->reply_count ?? 0); ?> yanıt</span>
                </div>
                <div class="activity-excerpt"><?php echo e(Str::limit(strip_tags($topic->content ?? ''), 80)); ?></div>
            </div>
        </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
    <?php endif; ?>

        
        <div class="section-header">
            <div class="section-title">
                <span class="section-title-dot"></span>
                Kategoriler
            </div>
        </div>

        <?php $__empty_1 = true; $__currentLoopData = $forumCategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
        <div class="category-block">
            
            <div class="category-block-header">
                <div class="category-block-icon"><?php echo e($category->icon ?? '💬'); ?></div>
                <div class="category-block-info">
                    <a href="<?php echo e(route('forum.category', $category->slug)); ?>" class="category-block-name">
                        <?php echo e($category->name); ?>

                    </a>
                    <?php if($category->description): ?>
                        <div class="category-block-desc"><?php echo e($category->description); ?></div>
                    <?php endif; ?>
                </div>
                <div class="category-block-stats">
                    <div class="cat-stat-box">
                        <span class="cat-stat-num"><?php echo e($category->topics_count ?? 0); ?></span>
                        <span class="cat-stat-lbl">Konu</span>
                    </div>
                    <div class="cat-stat-box">
                        <span class="cat-stat-num"><?php echo e($category->posts_count ?? 0); ?></span>
                        <span class="cat-stat-lbl">Mesaj</span>
                    </div>
                    <div class="cat-stat-box">
                        <span class="cat-stat-num"><?php echo e(number_format($category->views_count ?? 0)); ?></span>
                        <span class="cat-stat-lbl">Görüntülenme</span>
                    </div>
                </div>
            </div>

            
            <?php if($category->children->count() > 0): ?>
            <div style="padding: 12px 20px; background: #f8fafc; border-top: 1px solid #f1f5f9; display: flex; gap: 8px; flex-wrap: wrap;">
                <?php $__currentLoopData = $category->children; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $child): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <a href="<?php echo e(route('forum.category', $child->slug)); ?>" style="display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: white; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 12px; color: #0f172a; text-decoration: none; transition: all 0.15s;">
                    <span><?php echo e($child->icon ?? '📁'); ?></span>
                    <span><?php echo e($child->name); ?></span>
                    <span style="color: #94a3b8; margin-left: 4px;">(<?php echo e($child->topics_count ?? 0); ?>)</span>
                </a>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
            <?php endif; ?>

            
            <?php
                $lastTopic = $category->topics()->with(['lastReplyUser', 'user'])->latest('last_reply_at')->first();
            ?>
            <?php if($lastTopic): ?>
            <div class="subcategory-list">
                <div class="category-row-single">
                    <div class="row-icon">📌</div>
                    <div class="row-info">
                        <a href="<?php echo e(route('forum.topic', [$category->slug, $lastTopic->slug])); ?>" class="row-name"><?php echo e(Str::limit($lastTopic->title, 55)); ?></a>
                        <div class="row-desc">
                            <?php echo e($lastTopic->lastReplyUser->name ?? $lastTopic->user->name ?? 'Anonim'); ?> tarafından
                        </div>
                    </div>
                    <div class="row-counts">
                        <div class="row-count">
                            <span class="row-count-num"><?php echo e($category->topics_count ?? 0); ?></span>
                            <span class="row-count-lbl">Konu</span>
                        </div>
                        <div class="row-count">
                            <span class="row-count-num"><?php echo e($category->posts_count ?? 0); ?></span>
                            <span class="row-count-lbl">Mesaj</span>
                        </div>
                    </div>
                    <div class="last-post-cell">
                        <a href="<?php echo e(route('forum.topic', [$category->slug, $lastTopic->slug])); ?>" class="last-post-title">
                            <?php echo e(Str::limit($lastTopic->title, 40)); ?>

                        </a>
                        <div class="last-post-meta">
                            <div class="last-post-avatar">
                                <?php echo e(strtoupper(substr($lastTopic->lastReplyUser->name ?? $lastTopic->user->name ?? 'A', 0, 1))); ?>

                            </div>
                            <?php echo e($lastTopic->lastReplyUser->name ?? $lastTopic->user->name ?? 'Anonim'); ?>

                            • <?php echo e($lastTopic->last_reply_at ? $lastTopic->last_reply_at->diffForHumans() : $lastTopic->created_at->diffForHumans()); ?>

                        </div>
                    </div>
                </div>
            </div>
            <?php else: ?>
            <div class="subcategory-list">
                <div class="empty-row">Bu kategoride henüz konu bulunmuyor.</div>
            </div>
            <?php endif; ?>
        </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <div style="text-align:center;padding:48px;color:#94a3b8;background:white;border-radius:12px;border:1px dashed #e2e8f0;">
                <div style="font-size:40px;margin-bottom:12px;">💬</div>
                <p style="font-size:15px;">Henüz kategori bulunmamaktadır.</p>
            </div>
        <?php endif; ?>

    </div>

    
    <div class="bottom-widgets">
        
        <div class="sidebar-card">
            <div class="sidebar-card-header">
                🕐 Son Konular
            </div>
            <?php $__empty_1 = true; $__currentLoopData = $recentTopics; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $topic): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <a href="<?php echo e(route('forum.topic', [$topic->category->slug, $topic->slug])); ?>" class="sidebar-topic-item">
                    <span class="sidebar-topic-title"><?php echo e($topic->title); ?></span>
                    <div class="sidebar-topic-meta">
                        <span class="sidebar-cat-badge"><?php echo e($topic->category->name ?? ''); ?></span>
                        <span><?php echo e($topic->last_reply_at ? $topic->last_reply_at->diffForHumans() : $topic->created_at->diffForHumans()); ?></span>
                    </div>
                </a>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <div class="empty-row">Henüz konu yok.</div>
            <?php endif; ?>
        </div>

        
        <?php if(isset($recentPosts) && $recentPosts->count() > 0): ?>
        <div class="sidebar-card">
            <div class="sidebar-card-header">
                💬 Son Mesajlar
            </div>
            <?php $__currentLoopData = $recentPosts->take(8); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $post): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php if($post->topic && $post->topic->category): ?>
                <a href="<?php echo e(route('forum.topic', [$post->topic->category->slug, $post->topic->slug])); ?>#post-<?php echo e($post->id); ?>" class="sidebar-topic-item">
                    <div style="display:flex;align-items:center;gap:8px;margin-bottom:4px;">
                        <div class="last-post-avatar" style="width:20px;height:20px;font-size:9px;background:linear-gradient(135deg, hsl(<?php echo e(crc32($post->user->name ?? 'A') % 360); ?>, 60%, 45%) 0%, hsl(<?php echo e((crc32($post->user->name ?? 'A') % 360) + 30); ?>, 60%, 55%) 100%);">
                            <?php echo e(strtoupper(substr($post->user->name ?? 'A', 0, 1))); ?>

                        </div>
                        <span style="font-size:12px;font-weight:600;color:#1e293b;"><?php echo e($post->user->name ?? 'Anonim'); ?></span>
                    </div>
                    <span class="sidebar-topic-title" style="font-weight:500;color:#475569;"><?php echo e(Str::limit(strip_tags($post->content), 60)); ?></span>
                    <div class="sidebar-topic-meta">
                        <span class="sidebar-cat-badge"><?php echo e(Str::limit($post->topic->title, 25)); ?></span>
                        <span><?php echo e($post->created_at->diffForHumans()); ?></span>
                    </div>
                </a>
                <?php endif; ?>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
        <?php endif; ?>

        
        <div class="sidebar-card">
            <div class="sidebar-card-header">🔗 Hızlı Erişim</div>
            <?php if(auth()->guard()->check()): ?>
            <a href="<?php echo e(route('forum.create_topic')); ?>" class="sidebar-topic-item" style="color:#1d4ed8;font-weight:600;font-size:13px;">
                ✏️ Yeni Konu Aç
            </a>
            <?php endif; ?>
            <a href="<?php echo e(route('forum.search')); ?>" class="sidebar-topic-item" style="color:#374151;font-size:13px;">
                🔍 Forum'da Ara
            </a>
            <?php $__currentLoopData = $forumCategories->take(5); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <a href="<?php echo e(route('forum.category', $cat->slug)); ?>" class="sidebar-topic-item" style="color:#374151;font-size:13px;">
                <?php echo e($cat->icon ?? '💬'); ?> <?php echo e($cat->name); ?>

            </a>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    </div>

    
    <div class="forum-stats-panel">
        <div class="stats-panel-header">
            <h3>📊 Forum İstatistikleri</h3>
        </div>
        <div class="stats-grid">
            <div class="stat-card">
                <div class="stat-card-icon" style="background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);">
                    💬
                </div>
                <div class="stat-card-content">
                    <div class="stat-card-value"><?php echo e(number_format($stats['total_topics'])); ?></div>
                    <div class="stat-card-label">Toplam Konu</div>
                </div>
            </div>
            <div class="stat-card">
                <div class="stat-card-icon" style="background: linear-gradient(135deg, #10b981 0%, #059669 100%);">
                    📝
                </div>
                <div class="stat-card-content">
                    <div class="stat-card-value"><?php echo e(number_format($stats['total_posts'])); ?></div>
                    <div class="stat-card-label">Toplam Mesaj</div>
                </div>
            </div>
            <div class="stat-card">
                <div class="stat-card-icon" style="background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);">
                    👥
                </div>
                <div class="stat-card-content">
                    <div class="stat-card-value"><?php echo e(number_format($stats['total_members'])); ?></div>
                    <div class="stat-card-label">Kayıtlı Üye</div>
                </div>
            </div>
            <?php if($stats['latest_user']): ?>
            <div class="stat-card">
                <div class="stat-card-icon" style="background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);">
                    🆕
                </div>
                <div class="stat-card-content">
                    <div class="stat-card-value" style="font-size:14px;line-height:1.3;"><?php echo e(Str::limit($stats['latest_user']->name, 18)); ?></div>
                    <div class="stat-card-label">Son Üye</div>
                </div>
            </div>
            <?php endif; ?>
        </div>
        <div class="stats-footer">
            <div class="stats-footer-item">
                <span class="stats-footer-icon">🔥</span>
                <span class="stats-footer-text"><?php echo e($stats['total_topics']); ?> konu, <?php echo e($stats['total_posts']); ?> mesaj</span>
            </div>
            <div class="stats-footer-item">
                <span class="stats-footer-icon">👁️</span>
                <span class="stats-footer-text"><?php echo e($stats['total_members']); ?> üye aktif</span>
            </div>
        </div>
    </div>

</div>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.public', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\askeribilgiler\resources\views\forum\index.blade.php ENDPATH**/ ?>