<?php $__env->startSection('title', 'Command Center'); ?>

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

    <div class="flex flex-col md:flex-row md:justify-between md:items-end mb-8 gap-4">
        <div>
            <h1 class="text-3xl font-extrabold text-white tracking-tight">Command Center</h1>
            <p class="text-slate-400 mt-1 text-sm">Real-time overview of your domain hosting infrastructure.</p>
        </div>
        <div class="bg-slate-800/60 border border-slate-700 px-4 py-2 rounded-xl flex items-center gap-3 shadow-lg">
            <span class="relative flex h-3 w-3">
                <span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"></span>
                <span class="relative inline-flex rounded-full h-3 w-3 bg-emerald-500"></span>
            </span>
            <span class="text-sm font-medium text-slate-300">API Connected</span>
        </div>
    </div>

    <div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-6 mb-8">
        
        <div class="bg-gradient-to-br from-slate-800 to-slate-800/50 border border-slate-700 rounded-2xl p-6 hover:border-blue-500/50 transition-colors group">
            <div class="flex justify-between items-start">
                <div>
                    <p class="text-slate-400 text-sm font-medium mb-1">Total Clients</p>
                    <h3 class="text-3xl font-bold text-white"><?php echo e(\App\Models\User::count()); ?></h3>
                </div>
                <div class="w-12 h-12 rounded-xl bg-blue-500/10 flex items-center justify-center text-blue-400 group-hover:scale-110 transition-transform">
                    <i class="fas fa-users text-xl"></i>
                </div>
            </div>
            <div class="mt-4 w-full bg-slate-700 h-1.5 rounded-full overflow-hidden">
                <div class="bg-blue-500 h-full w-3/4"></div>
            </div>
        </div>

        <div class="bg-gradient-to-br from-slate-800 to-slate-800/50 border border-slate-700 rounded-2xl p-6 hover:border-emerald-500/50 transition-colors group">
            <div class="flex justify-between items-start">
                <div>
                    <p class="text-slate-400 text-sm font-medium mb-1">Active Domains</p>
                    <h3 class="text-3xl font-bold text-white"><?php echo e(\App\Models\UserDomain::where('status', 'active')->count()); ?></h3>
                </div>
                <div class="w-12 h-12 rounded-xl bg-emerald-500/10 flex items-center justify-center text-emerald-400 group-hover:scale-110 transition-transform">
                    <i class="fas fa-globe text-xl"></i>
                </div>
            </div>
            <div class="mt-4 text-xs text-emerald-400 font-medium flex items-center gap-1">
                <i class="fas fa-check-circle"></i> Live on Cloudflare
            </div>
        </div>

        <div class="bg-gradient-to-br from-slate-800 to-slate-800/50 border border-slate-700 rounded-2xl p-6 hover:border-indigo-500/50 transition-colors group">
            <div class="flex justify-between items-start">
                <div>
                    <p class="text-slate-400 text-sm font-medium mb-1">Total Revenue</p>
                    <h3 class="text-3xl font-bold text-white">৳<?php echo e(number_format(\App\Models\UserDomain::sum('monthly_price'), 0)); ?></h3>
                </div>
                <div class="w-12 h-12 rounded-xl bg-indigo-500/10 flex items-center justify-center text-indigo-400 group-hover:scale-110 transition-transform">
                    <i class="fas fa-chart-line text-xl"></i>
                </div>
            </div>
            <div class="mt-4 text-xs text-indigo-400 font-medium flex items-center gap-1">
                <i class="fas fa-arrow-trend-up"></i> Based on Active Plans
            </div>
        </div>

        <div class="bg-gradient-to-br from-slate-800 to-slate-800/50 border border-slate-700 rounded-2xl p-6 hover:border-red-500/50 transition-colors group">
            <div class="flex justify-between items-start">
                <div>
                    <p class="text-slate-400 text-sm font-medium mb-1">Suspended / Expired</p>
                    <h3 class="text-3xl font-bold text-white"><?php echo e(\App\Models\UserDomain::whereIn('status', ['suspended', 'expired'])->count()); ?></h3>
                </div>
                <div class="w-12 h-12 rounded-xl bg-red-500/10 flex items-center justify-center text-red-400 group-hover:scale-110 transition-transform">
                    <i class="fas fa-ban text-xl"></i>
                </div>
            </div>
            <div class="mt-4 text-xs text-red-400 font-medium flex items-center gap-1">
                <i class="fas fa-exclamation-circle"></i> DNS Removed
            </div>
        </div>

    </div>

    <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
        
        <div class="lg:col-span-2 bg-slate-800/40 border border-slate-700 rounded-2xl p-6">
            <h2 class="text-lg font-bold text-white mb-6 flex items-center gap-2">
                <i class="fas fa-bolt text-yellow-500"></i> Domain Management
            </h2>
            
            <div class="grid grid-cols-2 sm:grid-cols-4 gap-4">
                <a href="<?php echo e(route('admin.domains.index')); ?>" class="bg-slate-800 border border-slate-600 hover:border-blue-500 hover:bg-blue-500/5 rounded-xl p-4 flex flex-col items-center text-center transition-all">
                    <i class="fas fa-list-ul text-2xl text-blue-400 mb-3"></i>
                    <span class="text-sm font-medium text-slate-300">All Domains</span>
                </a>
                <a href="<?php echo e(route('admin.users.index')); ?>" class="bg-slate-800 border border-slate-600 hover:border-emerald-500 hover:bg-emerald-500/5 rounded-xl p-4 flex flex-col items-center text-center transition-all">
                    <i class="fas fa-users-cog text-2xl text-emerald-400 mb-3"></i>
                    <span class="text-sm font-medium text-slate-300">Client List</span>
                </a>
                <a href="<?php echo e(route('admin.orders.index')); ?>" class="bg-slate-800 border border-slate-600 hover:border-purple-500 hover:bg-purple-500/5 rounded-xl p-4 flex flex-col items-center text-center transition-all">
                    <i class="fas fa-file-invoice text-2xl text-purple-400 mb-3"></i>
                    <span class="text-sm font-medium text-slate-300">View Invoices</span>
                </a>
                <a href="<?php echo e(route('admin.settings.bot')); ?>" class="bg-slate-800 border border-slate-600 hover:border-orange-500 hover:bg-orange-500/5 rounded-xl p-4 flex flex-col items-center text-center transition-all">
                    <i class="fas fa-robot text-2xl text-orange-400 mb-3"></i>
                    <span class="text-sm font-medium text-slate-300">Bot Config</span>
                </a>
            </div>

            <div class="mt-8 border-t border-slate-700 pt-6">
                <div class="flex justify-between items-center mb-4">
                    <h3 class="text-sm font-bold text-slate-400 uppercase tracking-wider">Latest Registrations</h3>
                    <a href="<?php echo e(route('admin.domains.index')); ?>" class="text-xs text-blue-400 hover:text-blue-300 font-medium">View All &rarr;</a>
                </div>
                
                <div class="overflow-x-auto">
                    <table class="w-full text-left text-sm text-slate-300">
                        <thead>
                            <tr>
                                <th class="pb-3 border-b border-slate-700 font-semibold text-slate-400">Domain Name</th>
                                <th class="pb-3 border-b border-slate-700 font-semibold text-slate-400">Client</th>
                                <th class="pb-3 border-b border-slate-700 font-semibold text-slate-400 text-right">Status</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $__empty_1 = true; $__currentLoopData = \App\Models\UserDomain::with('user')->orderBy('id', 'desc')->limit(4)->get(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $domain): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <tr onclick="window.location='<?php echo e(route('admin.domains.show', $domain->id)); ?>'" class="group hover:bg-slate-800/50 transition-colors cursor-pointer">
                                <td class="py-3 border-b border-slate-700/50 font-medium text-blue-400 group-hover:text-blue-300">
                                    <?php echo e($domain->domain_name); ?>

                                </td>
                                <td class="py-3 border-b border-slate-700/50">
                                    <?php echo e($domain->user->username ?? 'Unknown'); ?>

                                </td>
                                <td class="py-3 border-b border-slate-700/50 text-right">
                                    <?php if($domain->status == 'active'): ?>
                                        <span class="bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 px-2 py-1 rounded text-xs">Active</span>
                                    <?php else: ?>
                                        <span class="bg-red-500/10 text-red-400 border border-red-500/20 px-2 py-1 rounded text-xs"><?php echo e(ucfirst($domain->status)); ?></span>
                                    <?php endif; ?>
                                </td>
                            </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <tr>
                                <td colspan="3" class="py-4 text-center text-slate-500">No domains registered yet.</td>
                            </tr>
                            <?php endif; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <div class="bg-slate-800/40 border border-slate-700 rounded-2xl p-6">
            <h2 class="text-lg font-bold text-white mb-6"><i class="fas fa-shield-alt text-indigo-500 mr-2"></i> System Integrity</h2>
            
            <div class="space-y-4">
                <div class="p-4 bg-slate-800 rounded-xl border border-slate-700 flex justify-between items-center">
                    <div class="flex items-center gap-3">
                        <i class="fas fa-cloud text-orange-400 text-xl"></i>
                        <div>
                            <p class="text-sm font-bold text-white">Cloudflare API</p>
                            <p class="text-xs text-slate-400">DNS Management</p>
                        </div>
                    </div>
                    <span class="w-2 h-2 rounded-full bg-emerald-500 shadow-[0_0_8px_#10b981]"></span>
                </div>

                <div class="p-4 bg-slate-800 rounded-xl border border-slate-700 flex justify-between items-center">
                    <div class="flex items-center gap-3">
                        <i class="fab fa-telegram text-blue-400 text-xl"></i>
                        <div>
                            <p class="text-sm font-bold text-white">Telegram Bot</p>
                            <p class="text-xs text-slate-400">Cron Notifications</p>
                        </div>
                    </div>
                    <span class="w-2 h-2 rounded-full bg-emerald-500 shadow-[0_0_8px_#10b981]"></span>
                </div>

                <div class="p-4 bg-slate-800 rounded-xl border border-slate-700 flex justify-between items-center">
                    <div class="flex items-center gap-3">
                        <i class="fas fa-credit-card text-emerald-400 text-xl"></i>
                        <div>
                            <p class="text-sm font-bold text-white">PayFastBD</p>
                            <p class="text-xs text-slate-400">Payment Gateway</p>
                        </div>
                    </div>
                    <span class="w-2 h-2 rounded-full bg-emerald-500 shadow-[0_0_8px_#10b981]"></span>
                </div>
            </div>

            <div class="mt-6">
                <a href="<?php echo e(route('admin.settings.index')); ?>" class="w-full block text-center bg-indigo-500 hover:bg-indigo-600 text-white font-medium py-2.5 rounded-lg transition-colors">
                    System Settings
                </a>
            </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 /home/anstserv/shop.bd1b.com/resources/views/admin/dashboard.blade.php ENDPATH**/ ?>