<?php $__env->startSection('title', 'Booking Details: ' . $booking->booking_no); ?>

<?php $__env->startSection('content'); ?>
<div class="max-w-4xl mx-auto space-y-lg">
    <!-- Page Header Actions -->
    <div class="flex flex-col md:flex-row md:items-center justify-between gap-md mb-xl no-print">
        <div>
            <nav class="flex items-center gap-xs text-secondary font-label-md text-label-md mb-xs">
                <a class="hover:text-primary transition-colors" href="<?php echo e(route('bookings.index')); ?>">Quotation Bookings</a>
                <span class="material-symbols-outlined text-[16px]">chevron_right</span>
                <span class="text-on-surface"><?php echo e($booking->booking_no); ?></span>
            </nav>
            <h2 class="font-headline-md text-headline-md text-on-surface">Booking Details</h2>
            <p class="font-body-md text-body-md text-secondary">Review the configured specifications for this job.</p>
        </div>
        <div class="flex items-center gap-sm">
            <a href="<?php echo e(route('bookings.index')); ?>" class="px-md py-sm bg-surface-container-highest border border-outline-variant text-on-surface-variant rounded-lg font-label-md text-label-md flex items-center gap-xs hover:bg-surface-container transition-all">
                <span class="material-symbols-outlined text-[18px]">arrow_back</span>
                Back to List
            </a>
            <button onclick="window.print()" class="px-md py-sm bg-primary text-on-primary rounded-lg font-label-md text-label-md flex items-center gap-xs shadow-md hover:bg-opacity-90 transition-all">
                <span class="material-symbols-outlined text-[18px]">print</span>
                Print Ticket
            </button>
        </div>
    </div>

    <!-- Booking Summary Card -->
    <div class="bg-surface-container-lowest ambient-shadow rounded-2xl overflow-hidden border border-surface-container printable-area">
        
        <!-- Header -->
        <div class="bg-surface-container-low p-xl border-b border-surface-container flex flex-col md:flex-row justify-between items-start md:items-center gap-lg">
            <div>
                <h3 class="font-display-lg-mobile text-display-lg-mobile text-primary font-bold mb-1">
                    <?php echo e($booking->job_name ?: 'Untitled Job'); ?>

                </h3>
                <div class="flex items-center gap-sm font-label-md text-label-md text-secondary">
                    <span class="flex items-center gap-1"><span class="material-symbols-outlined text-[16px]">tag</span> <?php echo e($booking->booking_no); ?></span>
                    <span>&bull;</span>
                    <span class="flex items-center gap-1"><span class="material-symbols-outlined text-[16px]">calendar_today</span> <?php echo e(date('d M Y', strtotime($booking->booking_date))); ?></span>
                </div>
            </div>
            
            <?php
                $statusColor = 'bg-blue-50 text-blue-700 border-blue-100';
                if($booking->status == 'Pending') $statusColor = 'bg-amber-50 text-amber-700 border-amber-100';
                if($booking->status == 'Completed' || $booking->status == 'Delivered') $statusColor = 'bg-emerald-50 text-emerald-700 border-emerald-100';
                if($booking->status == 'Cancelled') $statusColor = 'bg-red-50 text-red-700 border-red-100';
            ?>
            <div class="px-lg py-sm rounded-full border <?php echo e($statusColor); ?> font-label-md text-label-md font-bold uppercase tracking-wider">
                <?php echo e($booking->status); ?>

            </div>
        </div>

        <?php
            $item = $booking->items->first();
        ?>

        <!-- Details Grid -->
        <div class="p-xl">
            <h4 class="font-headline-sm text-headline-sm text-on-surface border-b border-surface-container pb-sm mb-lg">Selected Specifications</h4>
            
            <?php if($item): ?>
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-y-xl gap-x-md">
                
                <!-- Category -->
                <div>
                    <div class="font-label-sm text-label-sm text-secondary uppercase tracking-widest mb-xs">Category</div>
                    <div class="font-body-lg text-body-lg text-on-surface font-semibold">
                        <?php echo e(\App\Models\BookingCategory::find($item->category_id)?->name ?? 'Not Specified'); ?>

                    </div>
                </div>

                <!-- Paper Size -->
                <div>
                    <div class="font-label-sm text-label-sm text-secondary uppercase tracking-widest mb-xs">Print Paper Size</div>
                    <div class="font-body-lg text-body-lg text-on-surface font-semibold">
                        <?php echo e(\App\Models\PaperSize::find($item->paper_size_id)?->name ?? 'Not Specified'); ?>

                    </div>
                </div>

                <!-- GSM -->
                <div>
                    <div class="font-label-sm text-label-sm text-secondary uppercase tracking-widest mb-xs">Paper GSM</div>
                    <div class="font-body-lg text-body-lg text-on-surface font-semibold">
                        <?php echo e(\App\Models\PaperGsm::find($item->paper_gsm_id)?->name ?? 'Not Specified'); ?>

                    </div>
                </div>

                <!-- Print Type -->
                <div>
                    <div class="font-label-sm text-label-sm text-secondary uppercase tracking-widest mb-xs">Print Type</div>
                    <div class="font-body-lg text-body-lg text-on-surface font-semibold">
                        <?php echo e(\App\Models\PrintType::find($item->print_type_id)?->name ?? 'Not Specified'); ?>

                    </div>
                </div>

                <!-- Lamination -->
                <div>
                    <div class="font-label-sm text-label-sm text-secondary uppercase tracking-widest mb-xs">Lamination</div>
                    <div class="font-body-lg text-body-lg text-on-surface font-semibold">
                        <?php echo e(\App\Models\Lamination::find($item->lamination_id)?->name ?? 'NONE'); ?>

                    </div>
                </div>

                <!-- Lamination Side -->
                <div>
                    <div class="font-label-sm text-label-sm text-secondary uppercase tracking-widest mb-xs">Lamination Side</div>
                    <div class="font-body-lg text-body-lg text-on-surface font-semibold">
                        <?php echo e(\App\Models\LaminationSide::find($item->lamination_side_id)?->name ?? 'NONE'); ?>

                    </div>
                </div>

                <!-- Quantity -->
                <div class="lg:col-span-3 mt-md pt-lg border-t border-surface-container">
                    <div class="bg-primary-container/30 rounded-xl p-md flex items-center justify-between">
                        <div class="font-label-md text-label-md text-on-surface-variant uppercase tracking-widest">Total Print Quantity</div>
                        <div class="font-display-lg text-display-lg text-primary font-bold"><?php echo e($item->quantity ?? $item->total_quantity ?? 0); ?></div>
                    </div>
                </div>

            </div>
            <?php else: ?>
            <div class="text-center py-xl text-secondary font-body-md text-body-md">
                No specifications found for this job.
            </div>
            <?php endif; ?>
        </div>

    </div>
</div>

<style>
    @media print {
        body { background-color: white !important; }
        .no-print { display: none !important; }
        #sidebar, header, nav, main { margin: 0 !important; padding: 0 !important; }
        .printable-area { box-shadow: none !important; border: none !important; width: 100% !important; margin: 0 !important; padding: 0 !important; }
    }
</style>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH E:\xampp\htdocs\saai-cards\resources\views/bookings/show.blade.php ENDPATH**/ ?>