<?php $__env->startSection('title', session('locale') == 'bn' ? 'ড্যাশবোর্ড' : 'Dashboard'); ?>

<?php $lang = session('locale', 'en'); ?>

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

    <div class="flex flex-col md:flex-row md:items-end justify-between gap-4 mb-8">
        <div>
            <h1 class="text-3xl font-extrabold text-slate-800 dark:text-white tracking-tight flex items-center gap-3">
                <?php echo e($lang == 'bn' ? 'স্বাগতম' : 'Welcome back'); ?>, <?php echo e(Auth::user()->username); ?>! 
                <i class="fa-solid fa-crown text-yellow-500 text-2xl drop-shadow-md pb-1"></i>
            </h1>
            <p class="text-sm text-slate-500 dark:text-slate-400 mt-1">
                <?php echo e($lang == 'bn' ? 'আপনার হোস্টিং এবং ডোমেইনগুলোর বর্তমান অবস্থা নিচে দেওয়া হলো।' : 'Here is the current overview of your hosting and domains.'); ?>

            </p>
        </div>
        <div class="flex items-center gap-2 bg-white dark:bg-[#0f172a] border border-slate-200 dark:border-[#1e293b] px-4 py-2 rounded-xl shadow-sm">
            <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-bold text-slate-600 dark:text-slate-300">
                <?php echo e($lang == 'bn' ? 'সিস্টেম অ্যাক্টিভ' : 'System Active'); ?>

            </span>
        </div>
    </div>

    <?php if($notice): ?>
    <div class="bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800/50 rounded-2xl p-5 mb-8 flex items-start gap-4 shadow-sm">
        <div class="bg-blue-100 dark:bg-blue-800/50 w-12 h-12 rounded-xl flex items-center justify-center shrink-0">
            <i class="fa-solid fa-bullhorn text-xl text-blue-600 dark:text-blue-400"></i>
        </div>
        <div class="mt-1">
            <h3 class="text-blue-800 dark:text-blue-300 font-bold text-lg mb-1"><?php echo e($lang == 'bn' ? 'অ্যাডমিন নোটিশ' : 'System Notice'); ?></h3>
            <p class="text-blue-600 dark:text-blue-200/80 text-sm leading-relaxed"><?php echo e($notice); ?></p>
        </div>
    </div>
    <?php endif; ?>

    <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
        
        <div class="bg-white dark:bg-[#0f172a] rounded-2xl p-6 border border-slate-200 dark:border-[#1e293b] shadow-sm hover:shadow-lg transition-all group relative overflow-hidden">
            <div class="absolute -right-6 -top-6 w-24 h-24 bg-emerald-50 dark:bg-emerald-900/10 rounded-full group-hover:scale-150 transition-transform duration-500"></div>
            <div class="relative z-10 flex justify-between items-start">
                <div>
                    <p class="text-xs font-bold text-slate-500 dark:text-slate-400 uppercase tracking-widest mb-1"><?php echo e($lang == 'bn' ? 'একাউন্ট ব্যালেন্স' : 'Account Balance'); ?></p>
                    <h3 class="text-3xl font-extrabold text-slate-800 dark:text-white">৳<?php echo e(number_format(Auth::user()->balance, 2)); ?></h3>
                </div>
                <div class="w-14 h-14 rounded-xl bg-emerald-100 dark:bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 flex items-center justify-center text-2xl shadow-inner">
                    <i class="fa-solid fa-wallet"></i>
                </div>
            </div>
            <div class="relative z-10 mt-5 pt-4 border-t border-slate-100 dark:border-[#1e293b]">
                <a href="<?php echo e(route('user.fund.index')); ?>" class="text-emerald-600 dark:text-emerald-400 text-sm font-bold hover:text-emerald-700 dark:hover:text-emerald-300 flex items-center gap-1.5 transition-colors">
                    <i class="fa-solid fa-circle-plus"></i> <?php echo e($lang == 'bn' ? 'ফান্ড যুক্ত করুন' : 'Add Funds'); ?>

                </a>
            </div>
        </div>

        <div class="bg-white dark:bg-[#0f172a] rounded-2xl p-6 border border-slate-200 dark:border-[#1e293b] shadow-sm hover:shadow-lg transition-all group relative overflow-hidden">
            <div class="absolute -right-6 -top-6 w-24 h-24 bg-blue-50 dark:bg-blue-900/10 rounded-full group-hover:scale-150 transition-transform duration-500"></div>
            <div class="relative z-10 flex justify-between items-start">
                <div>
                    <p class="text-xs font-bold text-slate-500 dark:text-slate-400 uppercase tracking-widest mb-1"><?php echo e($lang == 'bn' ? 'অ্যাক্টিভ ডোমেইন' : 'Active Domains'); ?></p>
                    <h3 class="text-3xl font-extrabold text-slate-800 dark:text-white"><?php echo e($active_domains); ?></h3>
                </div>
                <div class="w-14 h-14 rounded-xl bg-blue-100 dark:bg-blue-500/10 text-blue-600 dark:text-blue-400 flex items-center justify-center text-2xl shadow-inner">
                    <i class="fa-solid fa-globe"></i>
                </div>
            </div>
            <div class="relative z-10 mt-5 pt-4 border-t border-slate-100 dark:border-[#1e293b]">
                <a href="<?php echo e(route('user.domain.index')); ?>" class="text-blue-600 dark:text-blue-400 text-sm font-bold hover:text-blue-700 dark:hover:text-blue-300 flex items-center gap-1.5 transition-colors">
                    <i class="fa-solid fa-list-check"></i> <?php echo e($lang == 'bn' ? 'ম্যানেজ করুন' : 'Manage Domains'); ?>

                </a>
            </div>
        </div>

        <div class="bg-white dark:bg-[#0f172a] rounded-2xl p-6 border border-slate-200 dark:border-[#1e293b] shadow-sm hover:shadow-lg transition-all group relative overflow-hidden">
            <div class="absolute -right-6 -top-6 w-24 h-24 bg-purple-50 dark:bg-purple-900/10 rounded-full group-hover:scale-150 transition-transform duration-500"></div>
            <div class="relative z-10 flex justify-between items-start">
                <div>
                    <p class="text-xs font-bold text-slate-500 dark:text-slate-400 uppercase tracking-widest mb-1"><?php echo e($lang == 'bn' ? 'মোট খরচ' : 'Total Spent'); ?></p>
                    <h3 class="text-3xl font-extrabold text-slate-800 dark:text-white">৳<?php echo e(number_format($total_spent, 2)); ?></h3>
                </div>
                <div class="w-14 h-14 rounded-xl bg-purple-100 dark:bg-purple-500/10 text-purple-600 dark:text-purple-400 flex items-center justify-center text-2xl shadow-inner">
                    <i class="fa-solid fa-chart-pie"></i>
                </div>
            </div>
            <div class="relative z-10 mt-5 pt-4 border-t border-slate-100 dark:border-[#1e293b]">
                <span class="text-slate-500 dark:text-slate-400 text-sm font-bold flex items-center gap-1.5">
                    <i class="fa-solid fa-circle-info"></i> <?php echo e($lang == 'bn' ? 'আজীবন হিসাব' : 'Lifetime spending'); ?>

                </span>
            </div>
        </div>
    </div>

    <div class="bg-white dark:bg-[#0f172a] rounded-2xl border border-slate-200 dark:border-[#1e293b] overflow-hidden shadow-lg">
        <div class="p-6 border-b border-slate-200 dark:border-[#1e293b] flex flex-col sm:flex-row justify-between items-center gap-4 bg-slate-50/50 dark:bg-[#0f172a]/50">
            <h2 class="text-lg font-bold text-slate-800 dark:text-white flex items-center gap-2">
                <i class="fa-solid fa-server text-blue-500 dark:text-blue-400"></i>
                <?php echo e($lang == 'bn' ? 'সাম্প্রতিক ডোমেইনসমূহ' : 'Recent Services'); ?>

            </h2>
            <a href="<?php echo e(route('user.domain.buy')); ?>" class="bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 text-white text-sm font-bold px-5 py-2.5 rounded-xl transition-all shadow-lg shadow-blue-500/30 flex items-center gap-2 hover:scale-[1.02] group">
                <i class="fa-solid fa-cart-shopping"></i> <?php echo e($lang == 'bn' ? 'নতুন কিনুন' : 'New Order'); ?>

            </a>
        </div>
        
        <div class="overflow-x-auto">
            <table class="w-full text-left text-sm text-slate-600 dark:text-slate-300">
                <thead class="bg-slate-50 dark:bg-[#1e293b]/80 text-xs uppercase font-bold text-slate-500 dark:text-slate-400">
                    <tr>
                        <th class="px-6 py-4"><?php echo e($lang == 'bn' ? 'ডোমেইন নাম' : 'Domain Name'); ?></th>
                        <th class="px-6 py-4"><?php echo e($lang == 'bn' ? 'স্ট্যাটাস' : 'Status'); ?></th>
                        <th class="px-6 py-4"><?php echo e($lang == 'bn' ? 'তারিখ' : 'Registered On'); ?></th>
                        <th class="px-6 py-4 text-right"><?php echo e($lang == 'bn' ? 'অ্যাকশন' : 'Action'); ?></th>
                    </tr>
                </thead>
                <tbody class="divide-y divide-slate-200 dark:divide-[#1e293b]">
                    <?php $__empty_1 = true; $__currentLoopData = $recent_domains; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $domain): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr class="hover:bg-slate-50 dark:hover:bg-[#1e293b]/40 transition-colors group">
                        <td class="px-6 py-4 font-bold text-slate-800 dark:text-white">
                            <a href="<?php echo e($domain->website_url); ?>" target="_blank" class="hover:text-blue-500 dark:hover:text-blue-400 transition-colors flex items-center gap-2">
                                <?php echo e($domain->domain_name); ?> 
                                <i class="fa-solid fa-arrow-up-right-from-square text-[10px] text-slate-400 group-hover:text-blue-500"></i>
                            </a>
                        </td>
                        <td class="px-6 py-4">
                            <?php if($domain->status == 'active'): ?>
                                <span class="bg-emerald-100 dark:bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-200 dark:border-emerald-500/20 px-3 py-1 rounded-lg text-xs font-bold inline-flex items-center gap-1.5"><i class="fa-solid fa-circle-check"></i> Active</span>
                            <?php else: ?>
                                <span class="bg-red-100 dark:bg-red-500/10 text-red-600 dark:text-red-400 border border-red-200 dark:border-red-500/20 px-3 py-1 rounded-lg text-xs font-bold inline-flex items-center gap-1"><i class="fa-solid fa-circle-xmark"></i> <?php echo e(ucfirst($domain->status)); ?></span>
                            <?php endif; ?>
                        </td>
                        <td class="px-6 py-4 text-slate-500 dark:text-slate-400 font-medium"><?php echo e(date('d M, Y', strtotime($domain->created_at))); ?></td>
                        <td class="px-6 py-4 text-right">
                            <a href="<?php echo e(route('user.domain.manage', $domain->id)); ?>" class="text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-500/10 hover:bg-blue-100 dark:hover:bg-blue-500/20 px-4 py-2 rounded-lg transition-colors text-xs font-bold inline-flex items-center gap-2 group">
                                <i class="fa-solid fa-gear group-hover:rotate-90 transition-transform"></i> <?php echo e($lang == 'bn' ? 'ম্যানেজ' : 'Manage'); ?>

                            </a>
                        </td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr>
                        <td colspan="4" class="px-6 py-14 text-center text-slate-500 dark:text-slate-400">
                            <div class="w-16 h-16 bg-slate-100 dark:bg-[#1e293b] rounded-full flex items-center justify-center mx-auto mb-4 shadow-inner">
                                <i class="fa-solid fa-folder-open text-3xl text-slate-400 dark:text-slate-500"></i>
                            </div>
                            <p class="font-bold text-base text-slate-600 dark:text-slate-300"><?php echo e($lang == 'bn' ? 'আপনার কোনো সার্ভিস নেই।' : "You don't have any active services yet."); ?></p>
                        </td>
                    </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
    </div>

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

<?php echo $__env->make('user.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/anstserv/shop.bd1b.com/resources/views/user/dashboard.blade.php ENDPATH**/ ?>