<?php $__env->startSection('content'); ?>

    <?php
        $bannerElements = getContent('banner.element');
    ?>

    <main class="all-sections">
        <div class="container-fluid">
            <div class="row g-4">
                <?php echo $__env->make($activeTemplate.'partials.leftbar', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

                <article class="col main-section">
                    <?php if(Request::routeIs('home')): ?>
                        <div class="banner-wrapper owl-theme owl-carousel mb-5">
                            <?php $__currentLoopData = $bannerElements; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="banner-item">
                                    <a href="<?php echo e(@$item->data_values->url); ?>" class="d-block">
                                        <img src="https://4kwallpapers.com/images/wallpapers/cricket-batsman-3840x2160-17540.jpeg" alt="banner">
                                    </a>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    <?php endif; ?>
                    <div class="predict__wrapper">
                        <div class="predict__header">
                            <h5 class="predict__header-title">
                                <?php if(Request::routeIs('home')): ?>
                                    <?php echo app('translator')->get('Live Matches'); ?>
                                <?php else: ?>
                                    <?php echo e(__($pageTitle)); ?>

                                <?php endif; ?>
                            </h5>
                        </div>
                        <style>
                            .predict__area {
                                padding: 10px;
                                background: #0f172a;
                            }
                            .match-row {
                                display: flex;
                                align-items: center;
                                background: #1e293b;
                                margin-bottom: 5px;
                                padding: 12px 15px;
                                border-radius: 4px;
                                transition: all 0.3s;
                                border-left: 4px solid transparent;
                            }
                            .match-row:hover {
                                background: #334155;
                                border-left: 4px solid #38bdf8;
                            }
                            .match-info {
                                flex: 1;
                                display: flex;
                                flex-direction: column;
                            }
                            .match-teams {
                                font-size: 1rem;
                                font-weight: 600;
                                color: #f8fafc;
                                margin-bottom: 2px;
                            }
                            .match-teams a {
                                color: inherit;
                                text-decoration: none;
                            }
                            .match-meta {
                                font-size: 0.75rem;
                                color: #94a3b8;
                                display: flex;
                                align-items: center;
                                gap: 10px;
                            }
                            .match-odds {
                                display: flex;
                                gap: 5px;
                                align-items: center;
                            }
                            .odds-btn {
                                width: 55px;
                                height: 40px;
                                display: flex;
                                flex-direction: column;
                                align-items: center;
                                justify-content: center;
                                border-radius: 4px;
                                text-decoration: none !important;
                                transition: opacity 0.2s;
                                font-weight: bold;
                            }
                            .odds-btn:hover {
                                opacity: 0.8;
                            }
                            .odds-val {
                                font-size: 0.9rem;
                                color: #000;
                            }
                            .odds-btn.blue {
                                background: #7dd3fc; /* Sky blue */
                            }
                            .odds-btn.pink {
                                background: #f9a8d4; /* Pink */
                            }
                            .live-tag {
                                background: #ef4444;
                                color: white;
                                padding: 2px 6px;
                                border-radius: 3px;
                                font-size: 0.65rem;
                                text-transform: uppercase;
                                font-weight: bold;
                                margin-right: 5px;
                            }
                            @media (max-width: 768px) {
                                .match-row {
                                    flex-direction: column;
                                    align-items: flex-start;
                                    gap: 10px;
                                }
                                .match-odds {
                                    width: 100%;
                                    justify-content: flex-end;
                                }
                            }
                        </style>

                        <div class="predict__area">
                            <?php $__empty_1 = true; $__currentLoopData = $matches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                <div class="match-row">
                                    <div class="match-info">
                                        <div class="match-teams">
                                            <a href="<?php echo e(route('match.details',[slug($item->name),$item->id])); ?>">
                                                <?php echo e(__($item->name)); ?>

                                            </a>
                                        </div>
                                        <div class="match-meta">
                                            <?php if($item->start_time <= now()): ?>
                                                <span class="live-tag">Live</span>
                                            <?php endif; ?>
                                            <span><i class="las la-calendar"></i> <?php echo e(showDateTime($item->start_time, 'd M, h:i A')); ?></span>
                                            <span class="text--base"><i class="las la-question-circle"></i> <?php echo e($item->questions->count()); ?> <?php echo app('translator')->get('Markets'); ?></span>
                                        </div>
                                    </div>

                                    <div class="match-odds">
                                        <?php if($item->questions->count() && $item->questions->first()->options->count()): ?>
                                            <?php $__currentLoopData = $item->questions->first()->options->take(2); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php if(auth()->guard()->check()): ?>
                                                    <a href="#predictModal" class="odds-btn <?php echo e($index % 2 == 0 ? 'blue' : 'pink'); ?> bet-info" 
                                                       data-bs-toggle="modal" data-resource="<?php echo e($data); ?>" 
                                                       data-question="<?php echo e(__($item->questions->first()->name)); ?>" 
                                                       data-match="<?php echo e(__($item->name)); ?>">
                                                        <span class="odds-val"><?php echo e(getAmount($data->dividend / $data->divisor, 2)); ?></span>
                                                    </a>
                                                <?php else: ?>
                                                    <a href="#loginModal" class="odds-btn <?php echo e($index % 2 == 0 ? 'blue' : 'pink'); ?>" data-bs-toggle="modal">
                                                        <span class="odds-val"><?php echo e(getAmount($data->dividend / $data->divisor, 2)); ?></span>
                                                    </a>
                                                <?php endif; ?>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            <!-- Filler for empty boxes to keep layout consistent like Victory -->
                                            <?php for($i = $item->questions->first()->options->count(); $i < 2; $i++): ?>
                                                <div class="odds-btn" style="background: rgba(255,255,255,0.05); border: 1px dashed rgba(255,255,255,0.1);">
                                                    <span class="odds-val" style="color: #475569;">-</span>
                                                </div>
                                            <?php endfor; ?>
                                        <?php else: ?>
                                            <div class="odds-btn blue" style="opacity: 0.3;"><span class="odds-val">-</span></div>
                                            <div class="odds-btn pink" style="opacity: 0.3;"><span class="odds-val">-</span></div>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                <div class="text-center p-5 text--white">
                                    <i class="las la-frown-open fz--48 mb-3"></i>
                                    <p><?php echo app('translator')->get('No match found at the moment.'); ?></p>
                                </div>
                            <?php endif; ?>
                        </div>
                        <ul class="pagination justify-content-center">
                            <?php echo e($matches->links()); ?>

                        </ul>
                    </div>
                </article>

                <?php echo $__env->make($activeTemplate.'partials.rightbar', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

            </div>
        </div>
    </main>

    <?php if($sections->secs != null): ?>
        <?php $__currentLoopData = json_decode($sections->secs); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sec): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php echo $__env->make($activeTemplate.'sections.'.$sec, \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    <?php endif; ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make($activeTemplate.'layouts.frontend', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home2/flightbo/public_html/skycrestaviationacademy.com/core/resources/views/templates/basic/home.blade.php ENDPATH**/ ?>