

<?php $__env->startSection('styles'); ?>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">

<style>
    body {
        font-family: 'Inter', sans-serif; /* ক্লিন ফন্ট */
    }
    
    .card-custom {
        border: none;
        border-radius: 15px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
        background: #fff;
    }
    
    .card-header-custom {
        background: white;
        padding: 20px 30px;
        border-bottom: 1px solid #edf2f9;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .table-custom {
        margin-bottom: 0;
    }
    
    .table-custom th {
        background-color: #f8f9fa;
        color: #64748b; /* সফট গ্রে কালার */
        font-weight: 600;
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding: 15px 25px;
        border-top: none;
        border-bottom: 1px solid #edf2f9;
    }
    
    .table-custom td {
        padding: 18px 25px;
        vertical-align: middle;
        border-bottom: 1px solid #f1f5f9;
        font-size: 14px;
        color: #334155; /* ডার্ক টেক্সট পড়ার সুবিধার জন্য */
    }

    .table-custom tr:hover {
        background-color: #f8fafc;
    }

    /* User Info Style */
    .user-avatar-circle {
        width: 42px;
        height: 42px;
        background: #eff6ff;
        color: #3b82f6;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 16px;
        margin-right: 15px;
    }
    
    .user-name {
        font-weight: 600;
        color: #1e293b;
        font-size: 14px;
        display: block;
        text-decoration: none;
    }
    
    .user-phone {
        font-size: 12px;
        color: #64748b;
        margin-top: 2px;
    }

    /* Message Box Style */
    .message-content {
        background: #fff;
        color: #475569;
        font-size: 13px;
        line-height: 1.6;
        padding: 10px 15px;
        border-radius: 8px;
        border: 1px solid #e2e8f0;
        max-width: 350px;
    }

    /* Status Badges */
    .status-badge {
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.3px;
        text-transform: uppercase;
    }
    .status-success {
        background: #dcfce7;
        color: #166534;
    }
    .status-failed {
        background: #fee2e2;
        color: #991b1b;
    }

    /* Type Badges */
    .type-badge {
        font-size: 11px;
        font-weight: 700;
        padding: 4px 10px;
        border-radius: 30px;
    }
    .type-masking {
        background: #e0f2fe;
        color: #0369a1;
        border: 1px solid #bae6fd;
    }
    .type-non-masking {
        background: #f3e8ff;
        color: #7e22ce;
        border: 1px solid #d8b4fe;
    }

    /* Cost */
    .cost-value {
        font-family: 'Inter', sans-serif;
        font-weight: 700;
        color: #ef4444;
        font-size: 14px;
    }

    /* Pagination */
    .pagination {
        justify-content: flex-end;
        margin-top: 20px;
    }
</style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="container-fluid">

    <div class="d-sm-flex align-items-center justify-content-between mb-4">
        <div>
            <h1 class="h3 mb-1 text-gray-800" style="font-weight: 700;"><?php echo e(__('SMS Logs')); ?></h1>
            <p class="text-muted mb-0" style="font-size: 14px;">Monitor all sent SMS history and costs.</p>
        </div>
        <div>
            <span class="btn btn-white border shadow-sm px-3" style="font-weight: 600; color: #475569;">
                Total Sent: <span class="text-primary"><?php echo e($logs->total()); ?></span>
            </span>
        </div>
    </div>

    <div class="card card-custom">
        <div class="card-header-custom">
            <h6 class="m-0 font-weight-bold text-dark" style="font-size: 16px;">All History</h6>
        </div>
        
        <div class="table-responsive">
            <table class="table table-custom" width="100%" cellspacing="0">
                <thead>
                    <tr>
                        <th width="15%">Date</th>
                        <th width="20%">Sender Info</th>
                        <th width="10%">Type</th>
                        <th width="15%">Recipient</th>
                        <th width="30%">Message</th>
                        <th width="10%" class="text-right">Cost</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $logs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $log): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr>
                        <td>
                            <div style="font-weight: 600; color: #334155;"><?php echo e($log->created_at->format('d M, Y')); ?></div>
                            <div style="font-size: 12px; color: #94a3b8; margin-top: 3px;"><?php echo e($log->created_at->format('h:i A')); ?></div>
                        </td>

                        <td>
                            <?php if($log->user): ?>
                            <div class="d-flex align-items-center">
                                <div class="user-avatar-circle">
                                    <?php echo e(substr($log->user->name, 0, 1)); ?>

                                </div>
                                <div>
                                    <a href="<?php echo e(route('admin.staff.edit', $log->user->id)); ?>" class="user-name">
                                        <?php echo e($log->user->name); ?>

                                    </a>
                                    <div class="user-phone"><?php echo e($log->user->phone); ?></div>
                                </div>
                            </div>
                            <?php else: ?>
                            <span class="text-danger font-weight-bold" style="font-size: 13px;">User Deleted</span>
                            <?php endif; ?>
                        </td>

                        <td>
                            <?php if($log->sender_type == 'masking'): ?>
                                <span class="type-badge type-masking">MASKING</span>
                            <?php else: ?>
                                <span class="type-badge type-non-masking">NON-MASKING</span>
                            <?php endif; ?>
                        </td>

                        <td>
                            <div style="font-weight: 500; color: #334155;"><?php echo e(Str::limit($log->numbers, 13)); ?></div>
                            <div style="font-size: 11px; color: #64748b; margin-top: 4px;">
                                Count: <strong><?php echo e($log->total_sms_count); ?> SMS</strong>
                            </div>
                        </td>

                        <td>
                            <div class="message-content">
                                <?php echo e(Str::limit($log->message, 50)); ?>

                            </div>
                            <div class="mt-2">
                                <?php if($log->status == 'success'): ?>
                                    <span class="status-badge status-success">Success</span>
                                <?php else: ?>
                                    <span class="status-badge status-failed"><?php echo e($log->status); ?></span>
                                <?php endif; ?>
                            </div>
                        </td>

                        <td class="text-right">
                            <span class="cost-value">- <?php echo e($log->cost); ?> ৳</span>
                        </td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr>
                        <td colspan="6" class="text-center py-5">
                            <img src="https://cdn-icons-png.flaticon.com/512/7486/7486744.png" alt="Empty" style="width: 60px; opacity: 0.5; margin-bottom: 15px;">
                            <h6 style="color: #94a3b8;">No records found</h6>
                        </td>
                    </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
        
        <div class="p-4 border-top">
            <?php echo e($logs->links()); ?>

        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/creativedesignbd/public_html/project/resources/views/admin/sms/history.blade.php ENDPATH**/ ?>