
<?php $__env->startSection('title', 'My Licenses'); ?>
<?php $__env->startSection('contents'); ?>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">

<style>
    @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
    
    body { font-family: 'Inter', sans-serif; background-color: #f3f4f6; }

    /* Sidebar Styling */
    .sidebar-card { background: #fff; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); overflow: hidden; border: 1px solid #edf2f7; }
    .user-profile-box { text-align: center; padding: 35px 20px; background: #fff; border-bottom: 1px solid #f1f5f9; }
    .user-avatar-wrapper { position: relative; width: 100px; height: 100px; margin: 0 auto 15px; }
    .user-avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid #4e73df; background-color: #eee; }
    
    .menu-link { display: flex; align-items: center; padding: 14px 20px; color: #64748b; text-decoration: none; border-radius: 12px; margin: 5px 15px; transition: 0.3s; font-weight: 500; font-size: 15px; }
    .menu-link i { width: 30px; font-size: 18px; }
    .menu-link:hover, .menu-link.active { background: #f1f5f9; color: #4e73df; }
    .menu-link.active i { color: #4e73df; }
    .menu-link.text-danger:hover { background: #fff1f2; color: #e11d48; }

    /* Table Styling */
    .main-content-card { background: #fff; border-radius: 20px; padding: 30px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); border: 1px solid #edf2f7; }
    .custom-table { width: 100%; border-collapse: separate; border-spacing: 0 10px; }
    .custom-table thead th { background: #f8fafc; color: #475569; font-weight: 600; padding: 15px; border: none; text-transform: uppercase; font-size: 12px; letter-spacing: 0.5px; }
    .custom-table tbody tr { transition: 0.3s; box-shadow: 0 2px 10px rgba(0,0,0,0.02); }
    .custom-table tbody td { padding: 15px; background: #fff; border-top: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
    .custom-table tbody td:first-child { border-left: 1px solid #f1f5f9; border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
    .custom-table tbody td:last-child { border-right: 1px solid #f1f5f9; border-top-right-radius: 12px; border-bottom-right-radius: 12px; }
    
    .badge-active { background: #dcfce7; color: #15803d; padding: 5px 12px; border-radius: 50px; font-size: 12px; font-weight: 600; }
    .badge-expired { background: #fee2e2; color: #b91c1c; padding: 5px 12px; border-radius: 50px; font-size: 12px; font-weight: 600; }
</style>

<div class="section-padding py-5">
    <div class="container">
        <div class="row g-4">
            
            <div class="col-lg-3">
                <div class="sidebar-card">
                    <div class="user-profile-box">
                        <div class="user-avatar-wrapper">
                            <img src="<?php echo e(Auth::user()->photo ? asset('assets/images/users/'.Auth::user()->photo) : 'https://cdn-icons-png.flaticon.com/512/149/149071.png'); ?>" class="user-avatar">
                        </div>
                        <h6 class="fw-bold text-dark mb-0"><?php echo e(Auth::user()->name); ?></h6>
                        <span class="badge bg-light text-primary border mt-2">ক্লায়েন্ট</span>
                    </div>
                    <div class="py-3">
                        <a href="<?php echo e(route('user.dashboard')); ?>" class="menu-link"><i class="fa-solid fa-table-columns"></i> ড্যাশবোর্ড</a>
                       			
								
														<a href="<?php echo e(route('user.domains.index')); ?>" class="menu-link <?php echo e(request()->routeIs('user.domains.index') ? 'active' : ''); ?>">
    <i class="fa-solid fa-globe"></i> আমার ডোমেইন
</a>

<a href="<?php echo e(route('user.hostings.index')); ?>" class="menu-link <?php echo e(request()->routeIs('user.hostings.index') ? 'active' : ''); ?>">
    <i class="fa-solid fa-server"></i> আমার হোস্টিং
</a>
								<div class="menu-item-group">
    <a href="javascript:void(0);" class="menu-link d-flex justify-content-between align-items-center" onclick="toggleSubMenu(event, 'fraudSubMenu')">
        <span><i class="fa-solid fa-shield-halved"></i> ফ্রড সার্ভিস</span>
        <i class="fa-solid fa-chevron-down mt-1" style="font-size: 12px;"></i>
    </a>
    
    <div id="fraudSubMenu" class="submenu-container" style="<?php echo e(request()->is('user/fraud*') || request()->is('user/api*') ? 'display: block;' : 'display: none;'); ?>">
        <a href="<?php echo e(route('user.fraud.check')); ?>" class="menu-link ps-5 <?php echo e(request()->routeIs('user.fraud.check') ? 'active' : ''); ?>">
            <i class="fa-solid fa-user-shield"></i> ফ্রড চেকার
        </a>
        
        <a href="<?php echo e(route('user.fraud.pricing')); ?>" class="menu-link ps-5 <?php echo e(request()->routeIs('user.fraud.pricing') ? 'active' : ''); ?>">
            <i class="fa-solid fa-tags"></i> প্যাকেজ কিনুন
        </a>
        
        <a href="<?php echo e(route('user.api.docs')); ?>" class="menu-link ps-5 <?php echo e(request()->routeIs('user.api.docs') ? 'active' : ''); ?>">
            <i class="fa-solid fa-code"></i> API ডকুমেন্টেশন
        </a>
    </div>
</div>
<style>
    .submenu-container {
    background: #fdfdfd; /* সাব-মেনুর জন্য হালকা আলাদা ব্যাকগ্রাউন্ড */
    border-radius: 12px;
    margin: 2px 15px;
}

.ps-5 {
    padding-left: 45px !important; /* সাব-মেনু আইটেমগুলোকে একটু ভেতরে সরানোর জন্য */
    font-size: 14px !important;    /* সাব-মেনু ফন্ট একটু ছোট */
}

.menu-link i.fa-chevron-down {
    transition: transform 0.3s ease;
}

.menu-link.open i.fa-chevron-down {
    transform: rotate(180deg);
}
</style>
<script>
    function toggleSubMenu(event, menuId) {
        event.preventDefault();
        const menu = document.getElementById(menuId);
        const link = event.currentTarget;
        
        if (menu.style.display === "none") {
            menu.style.display = "block";
            link.classList.add('open');
        } else {
            menu.style.display = "none";
            link.classList.remove('open');
        }
    }
</script>

<div class="menu-item-group">
    
    <a href="javascript:void(0);" class="menu-link d-flex justify-content-between align-items-center <?php echo e(request()->is('user/sms*') || request()->is('user/recharge*') ? 'open' : ''); ?>" onclick="toggleSubMenu(event, 'smsSubMenu')">
        <span><i class="fa-solid fa-comment-sms"></i> এসএমএস সার্ভিস</span>
        <i class="fa-solid fa-chevron-down mt-1" style="font-size: 12px;"></i>
    </a>
    
    
    <div id="smsSubMenu" class="submenu-container" style="<?php echo e(request()->is('user/sms*') || request()->is('user/recharge*') ? 'display: block;' : 'display: none;'); ?>">
        
        <a href="<?php echo e(route('user.sms.panel')); ?>" class="menu-link ps-5 <?php echo e(request()->routeIs('user.sms.panel') ? 'active' : ''); ?>">
            <i class="fa-solid fa-paper-plane"></i> এসএমএস পাঠান
        </a>
        
<a href="<?php echo e(route('user.sms.history')); ?>" class="menu-link ps-5 <?php echo e(request()->routeIs('user.sms.history') ? 'active' : ''); ?>">
    <i class="fa-solid fa-history"></i> এসএমএস হিস্ট্রি
</a>
        <a href="<?php echo e(route('user.recharge.index')); ?>" class="menu-link ps-5 <?php echo e(request()->routeIs('user.recharge.index') ? 'active' : ''); ?>">
            <i class="fa-solid fa-wallet"></i> রিচার্জ করুন
        </a>
<a href="<?php echo e(route('user.sms.api_docs')); ?>" class="menu-link ps-5 <?php echo e(request()->routeIs('user.sms.api_docs') ? 'active' : ''); ?>">
    <i class="fa-solid fa-code"></i> এপিআই ডকুমেন্টেশন
</a>
    </div>
</div>
                        <a href="<?php echo e(route('user.licenses')); ?>" class="menu-link active"><i class="fa-solid fa-key"></i> আমার লাইসেন্স</a>
                        <a href="<?php echo e(route('user.support')); ?>" class="menu-link"><i class="fa-solid fa-headset"></i> সাপোর্ট টিকেট</a>
                        <a href="<?php echo e(route('user.profile')); ?>" class="menu-link"><i class="fa-solid fa-user-gear"></i> প্রোফাইল সেটিংস</a>
                        <a href="<?php echo e(route('user.logout')); ?>" class="menu-link text-danger mt-4"><i class="fa-solid fa-right-from-bracket"></i> লগআউট</a>
                    </div>
                </div>
            </div>

            
            <div class="col-lg-9">
                <div class="main-content-card">
                    <div class="d-flex justify-content-between align-items-center mb-4">
                        <h5 class="fw-bold mb-0">আমার লাইসেন্স সমূহ</h5>
                    </div>

                    <div class="table-responsive">
                        <table class="custom-table">
                            <thead>
                                <tr>
                                    <th>লাইসেন্স কি</th>
                                    <th>ডোমেইন/ইউআরএল</th>
                                    <th>শুরু হয়েছে</th>
                                    <th>মেয়াদ শেষ</th>
                                    <th>স্ট্যাটাস</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__empty_1 = true; $__currentLoopData = $licenses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $license): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                <tr>
                                    <td class="fw-bold text-primary"><?php echo e($license->license_key); ?></td>
                                    <td><?php echo e($license->domain_name ?? 'N/A'); ?></td>
                                    <td><?php echo e($license->created_at->format('d M, Y')); ?></td>
                                    <td><?php echo e(\Carbon\Carbon::parse($license->expiry_date)->format('d M, Y')); ?></td>
                                    <td>
                                        <?php if($license->status == 1): ?>
                                            <span class="badge-active">সচল</span>
                                        <?php else: ?>
                                            <span class="badge-expired">অকেজো</span>
                                        <?php endif; ?>
                                    </td>
                                </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                <tr>
                                    <td colspan="5" class="text-center py-5 text-muted">আপনার কোনো লাইসেন্স খুঁজে পাওয়া যায়নি।</td>
                                </tr>
                                <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                    
<?php
    $paginator = $licenses;
?>

<?php if($paginator->hasPages()): ?>
    <div class="d-flex justify-content-center mt-4">
        <nav aria-label="Page navigation">
            <ul class="pagination mb-0">
                
                
                <?php if($paginator->onFirstPage()): ?>
                    <li class="page-item disabled">
                        <span class="page-link border-0 rounded-circle me-1 shadow-none text-muted" 
                              style="width: 35px; height: 35px; display: flex; align-items: center; justify-content: center; background: #f1f5f9;">
                            <i class="fa-solid fa-chevron-left" style="font-size: 12px;"></i>
                        </span>
                    </li>
                <?php else: ?>
                    <li class="page-item">
                        <a class="page-link border-0 rounded-circle me-1 shadow-sm text-dark bg-white" 
                           href="<?php echo e($paginator->previousPageUrl()); ?>" rel="prev" 
                           style="width: 35px; height: 35px; display: flex; align-items: center; justify-content: center;">
                            <i class="fa-solid fa-chevron-left" style="font-size: 12px;"></i>
                        </a>
                    </li>
                <?php endif; ?>

                
                <?php $__currentLoopData = range(1, $paginator->lastPage()); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    
                    <?php if($i >= $paginator->currentPage() - 2 && $i <= $paginator->currentPage() + 2): ?>
                        <?php if($i == $paginator->currentPage()): ?>
                            <li class="page-item active" aria-current="page">
                                <span class="page-link border-0 rounded-circle mx-1 shadow bg-primary text-white fw-bold" 
                                      style="width: 35px; height: 35px; display: flex; align-items: center; justify-content: center;"><?php echo e($i); ?></span>
                            </li>
                        <?php else: ?>
                            <li class="page-item">
                                <a class="page-link border-0 rounded-circle mx-1 shadow-sm text-dark bg-white hover-bg-light" 
                                   href="<?php echo e($paginator->url($i)); ?>" 
                                   style="width: 35px; height: 35px; display: flex; align-items: center; justify-content: center;"><?php echo e($i); ?></a>
                            </li>
                        <?php endif; ?>
                    <?php endif; ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                
                <?php if($paginator->hasMorePages()): ?>
                    <li class="page-item">
                        <a class="page-link border-0 rounded-circle ms-1 shadow-sm text-dark bg-white" 
                           href="<?php echo e($paginator->nextPageUrl()); ?>" rel="next" 
                           style="width: 35px; height: 35px; display: flex; align-items: center; justify-content: center;">
                            <i class="fa-solid fa-chevron-right" style="font-size: 12px;"></i>
                        </a>
                    </li>
                <?php else: ?>
                    <li class="page-item disabled">
                        <span class="page-link border-0 rounded-circle ms-1 shadow-none text-muted" 
                              style="width: 35px; height: 35px; display: flex; align-items: center; justify-content: center; background: #f1f5f9;">
                            <i class="fa-solid fa-chevron-right" style="font-size: 12px;"></i>
                        </span>
                    </li>
                <?php endif; ?>

            </ul>
        </nav>
    </div>
<?php endif; ?>
                </div>
            </div>
        </div>
    </div>
</div>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.front', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\project\resources\views/user/client/licenses.blade.php ENDPATH**/ ?>