

<?php $__env->startSection('header-title', 'Sohbet Kategorileri'); ?>

<?php $__env->startSection('content'); ?>
<div class="page-header">
    <div class="page-header-content">
        <div>
            <h1 class="page-title">🏷️ Sohbet Kategorileri</h1>
            <p class="page-subtitle">Sohbet odalarını gruplamak için kategorileri yönetin</p>
        </div>
        <a href="<?php echo e(route('admin.chat-categories.create')); ?>" style="padding:12px 24px;background:linear-gradient(135deg,#3b82f6,#2563eb);color:white;border-radius:10px;font-size:14px;font-weight:600;text-decoration:none;display:inline-flex;align-items:center;gap:8px;box-shadow:0 4px 12px rgba(59,130,246,.3);">
            + Yeni Kategori
        </a>
    </div>
</div>

<?php if(session('success')): ?>
    <div style="background:#d1fae5;border:1px solid #6ee7b7;color:#065f46;padding:14px 18px;border-radius:10px;margin-bottom:24px;font-weight:500;">
        ✅ <?php echo e(session('success')); ?>

    </div>
<?php endif; ?>
<?php if(session('error')): ?>
    <div style="background:#fee2e2;border:1px solid #fca5a5;color:#991b1b;padding:14px 18px;border-radius:10px;margin-bottom:24px;font-weight:500;">
        ❌ <?php echo e(session('error')); ?>

    </div>
<?php endif; ?>

<div style="background:white;border-radius:12px;border:1px solid #e5e7eb;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,0.05);">
    <div style="padding:20px 24px;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;align-items:center;">
        <h2 style="margin:0;font-size:18px;font-weight:600;color:#111827;">Kategoriler</h2>
        <span style="font-size:13px;color:#6b7280;background:#f3f4f6;padding:4px 12px;border-radius:20px;"><?php echo e($categories->count()); ?> kategori</span>
    </div>

    <?php if($categories->count() > 0): ?>
        <table style="width:100%;border-collapse:collapse;">
            <thead>
                <tr style="background:#f9fafb;border-bottom:1px solid #e5e7eb;">
                    <th style="padding:12px 24px;text-align:left;font-size:12px;font-weight:600;color:#6b7280;text-transform:uppercase;letter-spacing:0.5px;">Sıra</th>
                    <th style="padding:12px 24px;text-align:left;font-size:12px;font-weight:600;color:#6b7280;text-transform:uppercase;letter-spacing:0.5px;">Kategori</th>
                    <th style="padding:12px 24px;text-align:left;font-size:12px;font-weight:600;color:#6b7280;text-transform:uppercase;letter-spacing:0.5px;">Renk / İkon</th>
                    <th style="padding:12px 24px;text-align:left;font-size:12px;font-weight:600;color:#6b7280;text-transform:uppercase;letter-spacing:0.5px;">Oda Sayısı</th>
                    <th style="padding:12px 24px;text-align:left;font-size:12px;font-weight:600;color:#6b7280;text-transform:uppercase;letter-spacing:0.5px;">Durum</th>
                    <th style="padding:12px 24px;text-align:left;font-size:12px;font-weight:600;color:#6b7280;text-transform:uppercase;letter-spacing:0.5px;">İşlemler</th>
                </tr>
            </thead>
            <tbody>
                <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr style="border-bottom:1px solid #e5e7eb;transition:background 0.2s;" onmouseover="this.style.background='#f9fafb'" onmouseout="this.style.background=''">
                    <td style="padding:16px 24px;font-size:14px;color:#6b7280;font-weight:600;"><?php echo e($category->order); ?></td>
                    <td style="padding:16px 24px;">
                        <div style="display:flex;align-items:center;gap:12px;">
                            <div style="width:40px;height:40px;border-radius:10px;background:<?php echo e($category->color ?? '#3b82f6'); ?>;display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0;">
                                <?php echo e($category->icon ?? '💬'); ?>

                            </div>
                            <div>
                                <div style="font-weight:600;color:#111827;font-size:14px;"><?php echo e($category->name); ?></div>
                                <?php if($category->description): ?>
                                    <div style="font-size:12px;color:#9ca3af;margin-top:2px;"><?php echo e(Str::limit($category->description, 60)); ?></div>
                                <?php endif; ?>
                            </div>
                        </div>
                    </td>
                    <td style="padding:16px 24px;">
                        <div style="display:flex;align-items:center;gap:8px;">
                            <?php if($category->color): ?>
                                <div style="width:20px;height:20px;border-radius:4px;background:<?php echo e($category->color); ?>;border:1px solid #e5e7eb;"></div>
                                <span style="font-size:13px;color:#6b7280;font-family:monospace;"><?php echo e($category->color); ?></span>
                            <?php else: ?>
                                <span style="font-size:13px;color:#9ca3af;">—</span>
                            <?php endif; ?>
                        </div>
                    </td>
                    <td style="padding:16px 24px;">
                        <span style="font-size:14px;font-weight:600;color:#111827;"><?php echo e($category->rooms_count); ?></span>
                        <span style="font-size:12px;color:#9ca3af;margin-left:4px;">oda</span>
                    </td>
                    <td style="padding:16px 24px;">
                        <?php if($category->is_active): ?>
                            <span style="background:#dcfce7;color:#16a34a;padding:4px 10px;border-radius:20px;font-size:12px;font-weight:600;">● Aktif</span>
                        <?php else: ?>
                            <span style="background:#fee2e2;color:#dc2626;padding:4px 10px;border-radius:20px;font-size:12px;font-weight:600;">● Pasif</span>
                        <?php endif; ?>
                    </td>
                    <td style="padding:16px 24px;">
                        <div style="display:flex;gap:6px;flex-wrap:wrap;">
                            <a href="<?php echo e(route('admin.chat-categories.edit', $category)); ?>" style="padding:6px 12px;background:#eff6ff;color:#2563eb;border-radius:6px;font-size:12px;font-weight:600;text-decoration:none;">✏️ Düzenle</a>
                            <form method="POST" action="<?php echo e(route('admin.chat-categories.toggle_active', $category)); ?>" style="display:inline;">
                                <?php echo csrf_field(); ?>
                                <button type="submit" style="padding:6px 12px;background:<?php echo e($category->is_active ? '#fff7ed' : '#f0fdf4'); ?>;color:<?php echo e($category->is_active ? '#ea580c' : '#16a34a'); ?>;border:none;border-radius:6px;font-size:12px;font-weight:600;cursor:pointer;">
                                    <?php echo e($category->is_active ? '🔕 Pasife Al' : '🔔 Aktife Al'); ?>

                                </button>
                            </form>
                            <form method="POST" action="<?php echo e(route('admin.chat-categories.destroy', $category)); ?>" style="display:inline;"
                                  onsubmit="return confirm('Bu kategoriyi silmek istediğinizden emin misiniz?')">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('DELETE'); ?>
                                <button type="submit" style="padding:6px 12px;background:#fef2f2;color:#dc2626;border:none;border-radius:6px;font-size:12px;font-weight:600;cursor:pointer;">🗑 Sil</button>
                            </form>
                        </div>
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
        </table>
    <?php else: ?>
        <div style="text-align:center;color:#9ca3af;padding:80px 20px;">
            <div style="font-size:56px;margin-bottom:16px;">🏷️</div>
            <div style="font-size:16px;margin-bottom:8px;">Henüz kategori yok.</div>
            <a href="<?php echo e(route('admin.chat-categories.create')); ?>" style="color:#3b82f6;font-weight:600;text-decoration:none;">İlk kategoriyi oluştur →</a>
        </div>
    <?php endif; ?>
</div>
<?php $__env->stopSection(); ?>

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