<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
     <?php $__env->slot('header', null, []); ?> 
        <div style="display: flex; justify-content: space-between; align-items: center;">
            <h2 class="serif" style="font-size: 1.3rem; color: var(--cream); font-weight: 400; letter-spacing: 0.05em;">
                <?php echo e(__('Admin / Promotional Campaigns')); ?>

            </h2>
            <a href="<?php echo e(route('admin.campaigns.create')); ?>" class="serif" style="background: var(--amber); color: var(--charcoal); padding: 0.5rem 1.25rem; border-radius: 2px; font-size: 0.85rem; font-weight: 600; text-decoration: none; transition: background 0.2s;">
                + New Campaign
            </a>
        </div>
     <?php $__env->endSlot(); ?>

    <style>
        .admin-table-container {
            background: #fff;
            border-radius: 4px;
            border: 1px solid rgba(26,24,20,0.08);
            overflow: hidden;
        }
        .admin-table { width: 100%; border-collapse: collapse; text-align: left; }
        .admin-table th {
            background: var(--ivory);
            padding: 1rem 1.5rem;
            font-size: 0.65rem;
            letter-spacing: 0.15em;
            text-transform: uppercase;
            color: var(--warm-gray);
            font-weight: 600;
            border-bottom: 1px solid rgba(26,24,20,0.06);
        }
        .admin-table td {
            padding: 1.25rem 1.5rem;
            font-size: 0.9rem;
            color: var(--ink);
            border-bottom: 1px solid rgba(26,24,20,0.04);
            vertical-align: middle;
        }
        .status-badge {
            font-size: 0.65rem;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            font-weight: 600;
            padding: 0.25rem 0.6rem;
            border-radius: 2px;
        }
        .badge-active { background: rgba(74, 124, 89, 0.1); color: var(--success); }
        .badge-inactive { background: rgba(26, 24, 20, 0.05); color: var(--warm-gray); }
        .badge-expired { background: rgba(165, 82, 63, 0.1); color: var(--terracotta); }

        .action-link {
            font-size: 0.75rem;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            font-weight: 600;
            text-decoration: none;
            margin-right: 1rem;
            transition: color 0.2s;
        }
        .edit-link { color: var(--sage); }
        .activate-link { color: var(--amber); }
        .delete-btn {
            color: var(--terracotta);
            background: none;
            border: none;
            font-size: 0.75rem;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            font-weight: 600;
            cursor: pointer;
            padding: 0;
        }
    </style>

    <div style="padding: 4rem 0 8rem;">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            
            <?php if(session('success')): ?>
                <div style="background: var(--success); color: #fff; padding: 1rem 1.5rem; border-radius: 2px; margin-bottom: 3rem; font-size: 0.9rem;">
                    <?php echo e(session('success')); ?>

                </div>
            <?php endif; ?>

            <div class="admin-table-container">
                <table class="admin-table">
                    <thead>
                        <tr>
                            <th>Campaign Title</th>
                            <th>Expiry Date</th>
                            <th>Status</th>
                            <th style="text-align: right;">Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__currentLoopData = $campaigns; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $campaign): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td>
                                    <div style="font-weight: 600; color: var(--charcoal);"><?php echo e($campaign->title); ?></div>
                                    <div style="font-size: 0.75rem; color: var(--mist);"><?php echo e(Str::limit($campaign->description, 50)); ?></div>
                                </td>
                                <td>
                                    <?php echo e($campaign->expiry_date ? $campaign->expiry_date->format('M d, Y') : 'No Expiry'); ?>

                                </td>
                                <td>
                                    <?php if($campaign->is_active): ?>
                                        <?php if($campaign->expiry_date && $campaign->expiry_date->isPast()): ?>
                                            <span class="status-badge badge-expired">Expired</span>
                                        <?php else: ?>
                                            <span class="status-badge badge-active">Active</span>
                                        <?php endif; ?>
                                    <?php else: ?>
                                        <span class="status-badge badge-inactive">Inactive</span>
                                    <?php endif; ?>
                                </td>
                                <td style="text-align: right;">
                                    <div style="display: flex; justify-content: flex-end; align-items: center; gap: 1rem;">
                                        <?php if(!$campaign->is_active || ($campaign->expiry_date && $campaign->expiry_date->isPast())): ?>
                                            <form action="<?php echo e(route('admin.campaigns.activate', $campaign)); ?>" method="POST">
                                                <?php echo csrf_field(); ?>
                                                <button type="submit" class="action-link activate-link">Activate</button>
                                            </form>
                                        <?php endif; ?>
                                        <a href="<?php echo e(route('admin.campaigns.edit', $campaign)); ?>" class="action-link edit-link">Edit</a>
                                        <form action="<?php echo e(route('admin.campaigns.destroy', $campaign)); ?>" method="POST" onsubmit="return confirm('Delete this campaign?')">
                                            <?php echo csrf_field(); ?>
                                            <?php echo method_field('DELETE'); ?>
                                            <button type="submit" class="delete-btn">Delete</button>
                                        </form>
                                    </div>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
            </div>

        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php /**PATH D:\Laravel\ecom\resources\views\admin\campaigns\index.blade.php ENDPATH**/ ?>