<?php $__env->startSection('title', session('locale') == 'bn' ? 'আমার ডোমেইনসমূহ' : 'My Domains'); ?>
<?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"><?php echo e($lang == 'bn' ? 'আমার ডোমেইনসমূহ' : 'My Domains'); ?></h1>
            <p class="text-sm text-slate-500 dark:text-slate-400 mt-1"><?php echo e($lang == 'bn' ? 'আপনার সকল অ্যাক্টিভ এবং এক্সপায়ার্ড ডোমেইন ম্যানেজ করুন।' : 'Manage all your active and expired domains.'); ?></p>
        </div>
        <a href="<?php echo e(route('user.domain.buy')); ?>" class="bg-blue-600 hover:bg-blue-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 whitespace-nowrap">
            <i class="fas fa-plus"></i> <?php echo e($lang == 'bn' ? 'নতুন কিনুন' : 'Buy New'); ?>

        </a>
    </div>

    <?php if(session('success')): ?>
        <div class="bg-emerald-50 dark:bg-emerald-500/10 border border-emerald-200 dark:border-emerald-500/20 text-emerald-600 dark:text-emerald-400 px-4 py-3 rounded-xl mb-6 flex items-center gap-3 shadow-sm">
            <i class="fas fa-check-circle text-lg"></i> <?php echo e(session('success')); ?>

        </div>
    <?php endif; ?>

    <div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6">
        <?php $__empty_1 = true; $__currentLoopData = $domains; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $domain): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <?php 
                $is_expired = ($domain->expiry_date < now());
                $is_suspended = ($domain->status == 'suspended');
                $statusClass = 'bg-emerald-100 dark:bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-200 dark:border-emerald-500/20';
                $statusText = 'Active';
                $statusIcon = 'fa-check-circle';
                
                if($is_suspended) {
                    $statusClass = 'bg-orange-100 dark:bg-orange-500/10 text-orange-600 dark:text-orange-400 border-orange-200 dark:border-orange-500/20';
                    $statusText = 'Suspended';
                    $statusIcon = 'fa-pause-circle';
                } elseif($is_expired) {
                    $statusClass = 'bg-red-100 dark:bg-red-500/10 text-red-600 dark:text-red-400 border-red-200 dark:border-red-500/20';
                    $statusText = 'Expired';
                    $statusIcon = 'fa-times-circle';
                }
            ?>
            
            <div class="bg-white dark:bg-[#0f172a] border border-slate-200 dark:border-[#1e293b] rounded-2xl p-6 shadow-sm hover:shadow-lg transition-all flex flex-col h-full group">
                <div class="flex justify-between items-start mb-4">
                    <div class="w-12 h-12 bg-slate-50 dark:bg-[#1e293b] rounded-xl flex items-center justify-center text-blue-500 dark:text-blue-400 text-xl shadow-inner">
                        <i class="fas fa-globe"></i>
                    </div>
                    <span class="border px-2.5 py-1 rounded-lg text-xs font-bold flex items-center gap-1 <?php echo e($statusClass); ?>">
                        <i class="fas <?php echo e($statusIcon); ?>"></i> <?php echo e($statusText); ?>

                    </span>
                </div>
                
                <h3 class="text-xl font-bold text-slate-800 dark:text-white mb-1 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors truncate" title="<?php echo e($domain->domain_name); ?>">
                    <?php echo e($domain->domain_name); ?>

                </h3>
                
                <a href="<?php echo e($domain->website_url); ?>" target="_blank" class="text-sm text-slate-500 dark:text-slate-400 hover:text-blue-500 mb-6 flex items-center gap-1 w-fit transition-colors">
                    <?php echo e($domain->website_url); ?> <i class="fas fa-external-link-alt text-[10px]"></i>
                </a>

                <div class="mt-auto pt-4 border-t border-slate-100 dark:border-[#1e293b] space-y-3">
                    <div class="flex justify-between items-center text-sm">
                        <span class="text-slate-500 dark:text-slate-400"><i class="far fa-calendar-alt w-4"></i> Expiry Date</span>
                        <span class="font-bold <?php echo e($is_expired ? 'text-red-500' : 'text-slate-700 dark:text-slate-300'); ?>"><?php echo e(date('d M Y', strtotime($domain->expiry_date))); ?></span>
                    </div>
                    
                    <?php if(!$is_suspended): ?>
                        <a href="<?php echo e(route('user.domain.manage', $domain->id)); ?>" class="w-full mt-2 bg-slate-50 hover:bg-slate-100 dark:bg-[#1e293b] dark:hover:bg-[#334155] border border-slate-200 dark:border-[#334155] text-slate-700 dark:text-white font-bold py-2.5 rounded-xl transition-colors flex items-center justify-center gap-2">
                            <i class="fas fa-cog"></i> <?php echo e($lang == 'bn' ? 'ম্যানেজ করুন' : 'Manage DNS'); ?>

                        </a>
                    <?php else: ?>
                        <button disabled class="w-full mt-2 bg-slate-100 dark:bg-slate-800 text-slate-400 dark:text-slate-500 font-bold py-2.5 rounded-xl cursor-not-allowed flex items-center justify-center gap-2">
                            <i class="fas fa-lock"></i> <?php echo e($lang == 'bn' ? 'লক করা আছে' : 'Locked'); ?>

                        </button>
                    <?php endif; ?>
                </div>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <div class="col-span-full bg-white dark:bg-[#0f172a] border border-slate-200 dark:border-[#1e293b] rounded-2xl p-12 text-center shadow-sm">
                <div class="w-20 h-20 bg-slate-50 dark:bg-[#1e293b] rounded-full flex items-center justify-center mx-auto mb-4 shadow-inner">
                    <i class="fas fa-search text-3xl text-slate-400"></i>
                </div>
                <h3 class="text-xl font-bold text-slate-800 dark:text-white mb-2"><?php echo e($lang == 'bn' ? 'কোনো ডোমেইন পাওয়া যায়নি' : 'No Domains Found'); ?></h3>
                <p class="text-slate-500 dark:text-slate-400 mb-6"><?php echo e($lang == 'bn' ? 'আপনি এখনো কোনো ডোমেইন ক্রয় করেননি।' : "You haven't registered any domains yet."); ?></p>
                <a href="<?php echo e(route('user.domain.buy')); ?>" class="bg-blue-600 hover:bg-blue-700 text-white font-bold px-6 py-3 rounded-xl shadow-lg shadow-blue-500/30 transition-all inline-block">
                    <?php echo e($lang == 'bn' ? 'প্রথম ডোমেইনটি কিনুন' : 'Purchase Your First Domain'); ?>

                </a>
            </div>
        <?php endif; ?>
    </div>
    
    <div class="mt-8">
        <?php echo e($domains->links()); ?>

    </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/hhhnbari/public_html/resources/views/user/domains/index.blade.php ENDPATH**/ ?>