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

<?php $__env->startSection('content'); ?>
<section class="mx-auto max-w-5xl px-4 py-10 sm:px-6">
    <?php echo $__env->make('account.partials.nav', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

    <?php if($membership): ?>
        <div class="overflow-hidden rounded-3xl p-8 text-white shadow-xl" style="background: linear-gradient(135deg, <?php echo e($membership->plan->color); ?>, #0f172a 120%)">
            <div class="flex items-start justify-between">
                <div>
                    <p class="text-xs font-bold uppercase tracking-[0.3em] opacity-80">Epelcon Circle</p>
                    <h2 class="mt-1 font-serif text-3xl font-bold"><?php echo e($membership->plan->name); ?> Member</h2>
                </div>
                <span class="rounded-full bg-white/20 px-3 py-1 text-xs font-bold uppercase"><?php echo e($membership->status); ?></span>
            </div>
            <p class="mt-6 font-mono text-lg font-extrabold tracking-widest"><?php echo e($membership->code); ?></p>
            <div class="mt-4 flex flex-wrap gap-8 text-sm">
                <div><p class="opacity-70">Member</p><p class="font-bold"><?php echo e($customer->name); ?></p></div>
                <div><p class="opacity-70">Valid until</p><p class="font-bold"><?php echo e($membership->expires_at->format('j M Y')); ?></p></div>
                <div><p class="opacity-70">Discount</p><p class="font-bold"><?php echo e($membership->plan->discount_percent + 0); ?>% off</p></div>
                <div><p class="opacity-70">Points rate</p><p class="font-bold"><?php echo e($membership->plan->points_multiplier + 0); ?>×</p></div>
            </div>
        </div>
        <div class="mt-6 rounded-3xl bg-white p-6 shadow-sm ring-1 ring-slate-200">
            <h3 class="font-bold text-slate-900">Your perks</h3>
            <ul class="mt-3 grid gap-2 sm:grid-cols-2">
                <?php $__currentLoopData = $membership->plan->perks ?? []; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $perk): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <li class="rounded-xl bg-stone-50 px-4 py-3 text-sm font-semibold text-slate-700">✓ <?php echo e($perk); ?></li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </ul>
        </div>
    <?php else: ?>
        <div class="rounded-3xl bg-white p-10 text-center shadow-sm ring-1 ring-slate-200">
            <p class="text-4xl">💳</p>
            <h2 class="mt-3 font-serif text-2xl font-bold text-slate-900">You're not a member yet</h2>
            <p class="mx-auto mt-2 max-w-md text-sm text-slate-500">Join the Epelcon Circle for discounts, faster rewards and exclusive perks.</p>
        </div>
        <div class="mt-6 grid gap-5 md:grid-cols-3">
            <?php $__currentLoopData = $plans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $plan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="relative overflow-hidden rounded-3xl bg-white p-6 shadow-sm ring-1 ring-slate-200">
                    <div class="absolute inset-x-0 top-0 h-1.5" style="background: <?php echo e($plan->color); ?>"></div>
                    <h3 class="font-serif text-xl font-bold" style="color: <?php echo e($plan->color); ?>"><?php echo e($plan->name); ?></h3>
                    <p class="mt-1 text-2xl font-extrabold text-slate-900"><?php echo e($CUR ?? '₦') . number_format((float) ($plan->price), 2); ?><span class="text-xs font-medium text-slate-400">/yr</span></p>
                    <ul class="mt-3 space-y-1.5 text-xs text-slate-600">
                        <?php $__currentLoopData = array_slice($plan->perks ?? [], 0, 4); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $perk): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><li>✓ <?php echo e($perk); ?></li><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </ul>
                    <form method="POST" action="<?php echo e(route('account.membership.subscribe', $plan)); ?>"><?php echo csrf_field(); ?>
                        <button class="mt-4 w-full rounded-xl bg-slate-950 py-3 text-sm font-bold text-white hover:bg-slate-800">Choose <?php echo e($plan->name); ?></button>
                    </form>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    <?php endif; ?>
</section>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.site', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\wamp64\www\hms\resources\views/account/membership.blade.php ENDPATH**/ ?>