<?php $__env->startSection('title', 'Dashboard'); ?>
<?php $__env->startSection('page-title', 'Dashboard'); ?>

<?php $__env->startSection('content'); ?>
<!-- Stats Cards -->
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
    <!-- Total Products Card -->
    <div class="bg-white dark:bg-gray-950 border border-gray-200 dark:border-gray-800 rounded-lg p-6 hover:shadow-md transition-shadow">
        <div class="flex items-center justify-between mb-4">
            <div class="w-12 h-12 bg-blue-100 dark:bg-blue-900/30 rounded-lg flex items-center justify-center">
                <i class="fas fa-box text-blue-600 dark:text-blue-400 text-xl"></i>
            </div>
        </div>
        <div>
            <p class="text-sm font-medium text-gray-600 dark:text-gray-400 mb-1">Total Products</p>
            <p class="text-3xl font-semibold text-gray-900 dark:text-white"><?php echo e($stats['products']); ?></p>
            <p class="text-xs text-gray-500 dark:text-gray-500 mt-1">All products</p>
        </div>
    </div>

    <!-- Categories Card -->
    <div class="bg-white dark:bg-gray-950 border border-gray-200 dark:border-gray-800 rounded-lg p-6 hover:shadow-md transition-shadow">
        <div class="flex items-center justify-between mb-4">
            <div class="w-12 h-12 bg-green-100 dark:bg-green-900/30 rounded-lg flex items-center justify-center">
                <i class="fas fa-tags text-green-600 dark:text-green-400 text-xl"></i>
            </div>
        </div>
        <div>
            <p class="text-sm font-medium text-gray-600 dark:text-gray-400 mb-1">Categories</p>
            <p class="text-3xl font-semibold text-gray-900 dark:text-white"><?php echo e($stats['categories']); ?></p>
            <p class="text-xs text-gray-500 dark:text-gray-500 mt-1">Main categories</p>
        </div>
    </div>

    <!-- Subcategories Card -->
    <div class="bg-white dark:bg-gray-950 border border-gray-200 dark:border-gray-800 rounded-lg p-6 hover:shadow-md transition-shadow">
        <div class="flex items-center justify-between mb-4">
            <div class="w-12 h-12 bg-purple-100 dark:bg-purple-900/30 rounded-lg flex items-center justify-center">
                <i class="fas fa-sitemap text-purple-600 dark:text-purple-400 text-xl"></i>
            </div>
        </div>
        <div>
            <p class="text-sm font-medium text-gray-600 dark:text-gray-400 mb-1">Subcategories</p>
            <p class="text-3xl font-semibold text-gray-900 dark:text-white"><?php echo e($stats['subcategories']); ?></p>
            <p class="text-xs text-gray-500 dark:text-gray-500 mt-1">Child categories</p>
        </div>
    </div>

    <!-- Active Slides Card -->
    <div class="bg-white dark:bg-gray-950 border border-gray-200 dark:border-gray-800 rounded-lg p-6 hover:shadow-md transition-shadow">
        <div class="flex items-center justify-between mb-4">
            <div class="w-12 h-12 bg-orange-100 dark:bg-orange-900/30 rounded-lg flex items-center justify-center">
                <i class="fas fa-images text-orange-600 dark:text-orange-400 text-xl"></i>
            </div>
        </div>
        <div>
            <p class="text-sm font-medium text-gray-600 dark:text-gray-400 mb-1">Active Slides</p>
            <p class="text-3xl font-semibold text-gray-900 dark:text-white"><?php echo e($stats['active_slides']); ?>/<?php echo e($stats['slides']); ?></p>
            <p class="text-xs text-gray-500 dark:text-gray-500 mt-1">Currently active</p>
        </div>
    </div>
</div>

<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
    <!-- Recent Products -->
    <div class="bg-white dark:bg-gray-950 border border-gray-200 dark:border-gray-800 rounded-lg overflow-hidden">
        <div class="px-6 py-4 border-b border-gray-200 dark:border-gray-800">
            <div class="flex items-center justify-between">
                <h3 class="text-lg font-semibold text-gray-900 dark:text-white flex items-center">
                    <i class="fas fa-box mr-2 text-gray-500 dark:text-gray-400"></i>Recent Products
                </h3>
                <a href="<?php echo e(route('admin.products.index')); ?>" class="text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white font-medium transition-colors">
                    View All <i class="fas fa-arrow-right ml-1 text-xs"></i>
                </a>
            </div>
        </div>
        <div class="p-6">
            <?php if($recentProducts->count() > 0): ?>
                <div class="space-y-3">
                    <?php $__currentLoopData = $recentProducts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="flex items-center justify-between p-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-900 transition-colors border border-gray-100 dark:border-gray-800">
                            <div class="flex items-center space-x-3 flex-1 min-w-0">
                                <?php
                                    $productImage = null;
                                    if (!empty($product->images) && is_array($product->images) && count($product->images) > 0) {
                                        $productImage = $product->images[0];
                                    } elseif ($product->image_profile) {
                                        $productImage = $product->image_profile;
                                    }
                                ?>
                                <?php if($productImage): ?>
                                    <img src="<?php echo e($productImage); ?>" alt="<?php echo e($product->name); ?>" 
                                         class="w-12 h-12 rounded-lg object-cover border border-gray-200 dark:border-gray-700 flex-shrink-0">
                                <?php else: ?>
                                    <div class="w-12 h-12 bg-gray-100 dark:bg-gray-800 rounded-lg flex items-center justify-center flex-shrink-0">
                                        <i class="fas fa-image text-gray-400 dark:text-gray-500 text-sm"></i>
                                    </div>
                                <?php endif; ?>
                                <div class="flex-1 min-w-0">
                                    <p class="font-medium text-gray-900 dark:text-white text-sm truncate"><?php echo e($product->name); ?></p>
                                    <p class="text-xs text-gray-500 dark:text-gray-400">$<?php echo e(number_format($product->price, 2)); ?></p>
                                </div>
                            </div>
                            <a href="<?php echo e(route('admin.products.show', $product)); ?>" 
                               class="ml-3 p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors flex-shrink-0">
                                <i class="fas fa-eye text-sm"></i>
                            </a>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            <?php else: ?>
                <div class="text-center py-12">
                    <i class="fas fa-box-open text-gray-300 dark:text-gray-700 text-5xl mb-4"></i>
                    <p class="text-gray-500 dark:text-gray-400 font-medium text-sm mb-2">No products yet</p>
                    <a href="<?php echo e(route('admin.products.create')); ?>" class="text-sm text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium">
                        Create your first product <i class="fas fa-arrow-right ml-1 text-xs"></i>
                    </a>
                </div>
            <?php endif; ?>
        </div>
    </div>

    <!-- Recent Categories -->
    <div class="bg-white dark:bg-gray-950 border border-gray-200 dark:border-gray-800 rounded-lg overflow-hidden">
        <div class="px-6 py-4 border-b border-gray-200 dark:border-gray-800">
            <div class="flex items-center justify-between">
                <h3 class="text-lg font-semibold text-gray-900 dark:text-white flex items-center">
                    <i class="fas fa-tags mr-2 text-gray-500 dark:text-gray-400"></i>Recent Categories
                </h3>
                <a href="<?php echo e(route('admin.categories.index')); ?>" class="text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white font-medium transition-colors">
                    View All <i class="fas fa-arrow-right ml-1 text-xs"></i>
                </a>
            </div>
        </div>
        <div class="p-6">
            <?php if($recentCategories->count() > 0): ?>
                <div class="space-y-3">
                    <?php $__currentLoopData = $recentCategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="flex items-center justify-between p-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-900 transition-colors border border-gray-100 dark:border-gray-800">
                            <div class="flex items-center space-x-3 flex-1 min-w-0">
                                <?php if($category->image): ?>
                                    <img src="<?php echo e($category->image); ?>" alt="<?php echo e($category->name); ?>" 
                                         class="w-12 h-12 rounded-lg object-cover border border-gray-200 dark:border-gray-700 flex-shrink-0">
                                <?php else: ?>
                                    <div class="w-12 h-12 bg-green-100 dark:bg-green-900/30 rounded-lg flex items-center justify-center flex-shrink-0">
                                        <i class="fas fa-tag text-green-600 dark:text-green-400 text-sm"></i>
                                    </div>
                                <?php endif; ?>
                                <div class="flex-1 min-w-0">
                                    <p class="font-medium text-gray-900 dark:text-white text-sm truncate"><?php echo e($category->name); ?></p>
                                    <p class="text-xs text-gray-500 dark:text-gray-400 truncate"><?php echo e($category->code); ?></p>
                                </div>
                            </div>
                            <a href="<?php echo e(route('admin.categories.show', $category)); ?>" 
                               class="ml-3 p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors flex-shrink-0">
                                <i class="fas fa-eye text-sm"></i>
                            </a>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            <?php else: ?>
                <div class="text-center py-12">
                    <i class="fas fa-folder-open text-gray-300 dark:text-gray-700 text-5xl mb-4"></i>
                    <p class="text-gray-500 dark:text-gray-400 font-medium text-sm mb-2">No categories yet</p>
                    <a href="<?php echo e(route('admin.categories.create')); ?>" class="text-sm text-green-600 dark:text-green-400 hover:text-green-700 dark:hover:text-green-300 font-medium">
                        Create your first category <i class="fas fa-arrow-right ml-1 text-xs"></i>
                    </a>
                </div>
            <?php endif; ?>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Users/mac/Documents/360monicaAPI/resources/views/admin/dashboard.blade.php ENDPATH**/ ?>