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

<?php $__env->startPush('styles'); ?>
<style>
    .plans-hero { padding: 3rem 0 1.5rem; }
    .plan-grid {
        display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1rem; margin: 2rem 0 3rem;
    }
    .plan-card {
        background: #fff; border: 1px solid var(--border); border-radius: 18px;
        padding: 1.4rem; box-shadow: var(--shadow); display: flex; flex-direction: column;
        position: relative;
    }
    .plan-card.featured {
        border-color: #DDD6FE; box-shadow: 0 16px 40px rgba(124,58,237,.12);
    }
    .plan-card .price {
        font-size: 1.75rem; font-weight: 800; margin: .75rem 0 .35rem; letter-spacing: -.02em;
    }
    .plan-card .price span { font-size: .85rem; font-weight: 600; color: var(--muted); }
    .plan-card .desc { color: var(--muted); font-size: .88rem; flex: 1; margin-bottom: 1rem; }
    .plan-limits { font-size: .78rem; color: var(--muted); margin-bottom: 1rem; line-height: 1.5; }
    .compare-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; background: #fff; }
    .compare-tbl { width: 100%; border-collapse: collapse; min-width: 560px; }
    .compare-tbl th, .compare-tbl td {
        padding: .85rem 1rem; border-bottom: 1px solid #F1F5F9; text-align: center; font-size: .85rem;
    }
    .compare-tbl th:first-child, .compare-tbl td:first-child { text-align: left; font-weight: 600; }
    .compare-tbl thead th {
        background: #FAFBFC; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
    }
    .check { color: var(--mexco-success); font-weight: 800; }
    .dash { color: #CBD5E1; }
    .special-section {
        margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--border);
    }
    .special-grid {
        display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1rem; margin-top: 1.5rem;
    }
    .special-card {
        background: #fff; border: 1px solid var(--border); border-radius: 18px;
        padding: 1.4rem; box-shadow: var(--shadow); display: flex; flex-direction: column;
    }
    .special-card.campus {
        background: linear-gradient(180deg, #F0FDF4 0%, #fff 45%);
        border-color: #BBF7D0;
    }
    .special-card.enterprise {
        background: linear-gradient(180deg, #FFFBEB 0%, #fff 45%);
        border-color: #FDE68A;
    }
    .special-card .price {
        font-size: 1.5rem; font-weight: 800; margin: .75rem 0 .35rem;
    }
    .special-card .desc { color: var(--muted); font-size: .88rem; flex: 1; margin-bottom: 1.15rem; }
</style>
<?php $__env->stopPush(); ?>

<?php $__env->startSection('content'); ?>
<section class="plans-hero">
    <div class="container">
        <div class="section-kicker">Pricing</div>
        <h1 class="section-title">Plans for every event</h1>
        <p class="section-lead">All prices are per event license. Choose the capacity and features your event needs. Upgrade later without affecting other events.</p>
    </div>
</section>

<section class="section" style="padding-top:0">
    <div class="container">
        <?php if($demoEnabled ?? false): ?>
            <div class="special-section" id="demo" style="margin-top:0;padding-top:0;border-top:0;margin-bottom:2.5rem">
                <div class="section-kicker">Try before you buy</div>
                <h2 class="section-title" style="font-size:1.35rem">Free demo: full features, limited capacity</h2>
                <div class="special-grid">
                    <article class="special-card" style="background:linear-gradient(180deg,#F5F3FF 0%,#fff 45%);border-color:#DDD6FE">
                        <span class="plan-pill" style="background:var(--primary-soft);color:var(--mexco-primary-dark)">Demo</span>
                        <div class="price">Free</div>
                        <p class="desc">
                            Unlock the complete MeXCo toolkit on a time-limited event with capped participants, sessions, and booths.
                        </p>
                        <?php if($demoLimits): ?>
                            <div class="plan-limits" style="margin-bottom:1rem">
                                <?php echo e($demoLimits['duration_days']); ?> days ·
                                up to <?php echo e(number_format($demoLimits['participants'] ?? 0)); ?> participants ·
                                <?php echo e($demoLimits['sessions'] ?? '-'); ?> sessions ·
                                <?php echo e($demoLimits['booths'] ?? '-'); ?> booths
                            </div>
                        <?php endif; ?>
                        <a href="<?php echo e(route('mexco.demo')); ?>" class="btn-purple">Try Demo</a>
                    </article>
                </div>
            </div>
        <?php endif; ?>

        <div class="section-kicker">Commercial plans</div>
        <h2 class="section-title" style="font-size:1.35rem">Compare and choose</h2>

        <div class="plan-grid">
            <?php $__currentLoopData = $commercialPlans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $plan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php $featured = $plan->code === 'pro'; ?>
                <article class="plan-card <?php echo e($featured ? 'featured' : ''); ?>">
                    <span class="plan-pill <?php echo e($plan->code); ?>"><?php echo e($plan->name); ?></span>
                    <div class="price">
                        <?php echo e($plan->formattedPrice()); ?> <span>/ event</span>
                    </div>
                    <p class="desc"><?php echo e($plan->description); ?></p>
                    <div class="plan-limits">
                        <?php if($plan->participant_limit): ?>
                            Up to <?php echo e(number_format($plan->participant_limit)); ?> participants<br>
                        <?php else: ?>
                            Custom participant capacity<br>
                        <?php endif; ?>
                        <?php if($plan->session_limit): ?> <?php echo e($plan->session_limit); ?> sessions · <?php endif; ?>
                        <?php if($plan->booth_limit): ?> <?php echo e($plan->booth_limit); ?> booths <?php endif; ?>
                    </div>
                    <a href="<?php echo e(route('mexco.plans.choose', $plan->code)); ?>" class="<?php echo e($featured ? 'btn-purple' : 'btn-outline'); ?>">
                        Choose <?php echo e($plan->name); ?>

                    </a>
                </article>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>

        <div class="section-kicker">Compare</div>
        <h2 class="section-title" style="font-size:1.35rem">Feature comparison</h2>
        <p style="color:var(--muted);font-size:.9rem;margin:.35rem 0 0">Starter, Plus, and Pro, side by side.</p>
        <div class="compare-wrap" style="margin-top:1.25rem">
            <table class="compare-tbl">
                <thead>
                <tr>
                    <th>Feature</th>
                    <?php $__currentLoopData = $commercialPlans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $plan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <th><?php echo e($plan->name); ?></th>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tr>
                </thead>
                <tbody>
                <?php $__currentLoopData = $features; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $feature): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($feature->name); ?></td>
                        <?php $__currentLoopData = $commercialPlans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $plan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <td>
                                <?php if($matrix[$plan->id][$feature->id] ?? false): ?>
                                    <span class="check">✓</span>
                                <?php else: ?>
                                    <span class="dash">-</span>
                                <?php endif; ?>
                            </td>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div>

        <?php if($specialPlans->isNotEmpty()): ?>
            <div class="special-section" id="special">
                <div class="section-kicker">Special programmes</div>
                <h2 class="section-title" style="font-size:1.35rem">Campus Plan &amp; Custom Plan</h2>
                <p style="color:var(--muted);font-size:.9rem;margin:.35rem 0 0;max-width:560px">
                    Campus sponsorship and Enterprise quotes are handled separately from standard commercial plans.
                </p>

                <div class="special-grid">
                    <?php $__currentLoopData = $specialPlans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $plan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php
                            $isCampus = $plan->code === 'campus' || ($plan->price_cents <= 0 && ! $plan->is_custom_pricing);
                            $isEnterprise = $plan->is_custom_pricing || $plan->code === 'enterprise';
                            $cta = $isCampus
                                ? ['Apply for Sponsorship', route('mexco.campus')]
                                : ['Request a Quote', route('mexco.enterprise')];
                            $label = $isCampus ? 'Campus Plan' : 'Custom Plan';
                        ?>
                        <article class="special-card <?php echo e($isCampus ? 'campus' : ''); ?> <?php echo e($isEnterprise ? 'enterprise' : ''); ?>">
                            <span class="plan-pill <?php echo e($plan->code); ?>"><?php echo e($label); ?></span>
                            <div class="price">
                                <?php if($isEnterprise): ?>
                                    Custom
                                <?php else: ?>
                                    Sponsored
                                <?php endif; ?>
                            </div>
                            <p class="desc"><?php echo e($plan->description); ?></p>
                            <?php if($isCampus): ?>
                                <div class="plan-limits" style="margin-bottom:1rem">
                                    Full standard features · RM0 license · 30-day retention after event
                                </div>
                            <?php elseif($isEnterprise): ?>
                                <div class="plan-limits" style="margin-bottom:1rem">
                                    Custom capacity, features, and commercial terms for large programmes
                                </div>
                            <?php endif; ?>
                            <a href="<?php echo e($cta[1]); ?>" class="<?php echo e($isCampus ? 'btn-purple' : 'btn-outline'); ?>"><?php echo e($cta[0]); ?></a>
                        </article>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            </div>
        <?php endif; ?>
    </div>
</section>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('public.layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\myapp\resources\views/public/plans.blade.php ENDPATH**/ ?>