<?php $__env->startSection('title', 'Domain Management'); ?>

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

    <div class="flex justify-between items-end mb-8">
        <div>
            <h1 class="text-3xl font-extrabold text-white tracking-tight">Domain Inventory</h1>
            <a href="<?php echo e(route('admin.extensions.index')); ?>" class="bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 text-white font-bold px-5 py-2.5 rounded-xl shadow-lg shadow-blue-500/30 transition-all hover:scale-[1.02] flex items-center justify-center gap-2">
    <i class="fas fa-network-wired"></i> Manage Master Extensions
</a>

            
            <p class="text-slate-400 mt-1 text-sm">Monitor and manage all client domains across the network.</p>
        </div>
    </div>

    <div class="bg-slate-800/40 border border-slate-700 rounded-2xl overflow-hidden shadow-lg">
        <div class="p-6 border-b border-slate-700 flex justify-between items-center flex-wrap gap-4">
            <h2 class="text-lg font-bold text-white"><i class="fas fa-globe text-blue-400 mr-2"></i> All Registered Domains</h2>
            
            <form action="<?php echo e(route('admin.domains.index')); ?>" method="GET" class="relative">
                <input type="text" name="search" value="<?php echo e(request('search')); ?>" placeholder="Search domains..." class="bg-slate-900 border border-slate-700 text-white text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full sm:w-64 pl-10 p-2.5 outline-none transition-colors">
                <i class="fas fa-search absolute left-3 top-3 text-slate-500"></i>
            </form>
        </div>

        <div class="overflow-x-auto">
            <table class="w-full text-left text-sm text-slate-300">
                <thead class="bg-slate-800/80 text-xs uppercase font-semibold text-slate-400">
                    <tr>
                        <th class="px-6 py-4">Domain / URL</th>
                        <th class="px-6 py-4">Owner</th>
                        <th class="px-6 py-4">Pricing</th>
                        <th class="px-6 py-4">Expiry Date</th>
                        <th class="px-6 py-4">Status</th>
                        <th class="px-6 py-4 text-right">Actions</th>
                    </tr>
                </thead>
                <tbody class="divide-y divide-slate-700/50">
                    <?php $__empty_1 = true; $__currentLoopData = $domains; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $domain): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr class="hover:bg-slate-800/50 transition-colors">
                        <td class="px-6 py-4">
                            <div class="font-bold text-blue-400 text-base mb-1"><?php echo e($domain->domain_name); ?></div>
                            <a href="<?php echo e($domain->website_url); ?>" target="_blank" class="text-xs text-slate-500 hover:text-slate-300 transition-colors"><i class="fas fa-external-link-alt mr-1"></i> Visit Site</a>
                        </td>
                        <td class="px-6 py-4">
                            <div class="flex items-center gap-2">
                                <div class="w-6 h-6 rounded-md bg-indigo-500/20 text-indigo-400 flex items-center justify-center text-xs font-bold border border-indigo-500/30">
                                    <?php echo e(strtoupper(substr($domain->user->username ?? '?', 0, 1))); ?>

                                </div>
                                <a href="<?php echo e(route('admin.users.show', $domain->user_id)); ?>" class="text-slate-300 hover:text-white font-medium transition-colors"><?php echo e($domain->user->username ?? 'Unknown'); ?></a>
                            </div>
                        </td>
                        <td class="px-6 py-4 font-medium text-emerald-400">
                            ৳<?php echo e(number_format($domain->monthly_price, 2)); ?> <span class="text-slate-500 text-xs font-normal">/mo</span>
                        </td>
                        <td class="px-6 py-4">
                            <div class="text-slate-300"><?php echo e(date('d M, Y', strtotime($domain->expiry_date))); ?></div>
                            <?php if($domain->expiry_date < now() && $domain->status == 'active'): ?>
                                <div class="text-xs text-red-400 font-medium mt-1">Expired (Action Needed)</div>
                            <?php endif; ?>
                        </td>
                        <td class="px-6 py-4">
                            <?php if($domain->status == 'active'): ?>
                                <span class="bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 px-2.5 py-1 rounded text-xs font-medium"><i class="fas fa-circle text-[8px] mr-1"></i> Active</span>
                            <?php elseif($domain->status == 'suspended'): ?>
                                <span class="bg-orange-500/10 text-orange-400 border border-orange-500/20 px-2.5 py-1 rounded text-xs font-medium"><i class="fas fa-pause-circle mr-1"></i> Suspended</span>
                            <?php else: ?>
                                <span class="bg-red-500/10 text-red-400 border border-red-500/20 px-2.5 py-1 rounded text-xs font-medium"><i class="fas fa-times-circle mr-1"></i> Expired</span>
                            <?php endif; ?>
                        </td>
                        <td class="px-6 py-4 text-right">
                            <a href="<?php echo e(route('admin.domains.show', $domain->id)); ?>" class="text-blue-400 hover:text-blue-300 bg-blue-500/10 hover:bg-blue-500/20 px-3 py-2 rounded-lg transition-colors inline-flex items-center gap-2 font-medium">
                                <i class="fas fa-cog"></i> Manage
                            </a>
                        </td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr>
                        <td colspan="6" class="px-6 py-8 text-center text-slate-500">
                            <i class="fas fa-search text-3xl mb-3 opacity-50 block"></i>
                            No domains found matching your criteria.
                        </td>
                    </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
        
        <div class="p-4 border-t border-slate-700">
            <?php echo e($domains->links()); ?>

        </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/domains/index.blade.php ENDPATH**/ ?>