

<?php $__env->startSection('title', 'Tiket Berhasil Dibuat'); ?>

<?php $__env->startSection('content'); ?>
<div class="flex flex-col items-center text-center py-6">
    
    <div class="w-20 h-20 rounded-full <?php echo e($ticket->status === 'Pickup Requested' ? 'bg-purple-100' : 'bg-green-100'); ?> flex items-center justify-center mb-4">
        <?php if($ticket->status === 'Pickup Requested'): ?>
        <svg class="w-10 h-10 text-purple-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                  d="M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"/>
        </svg>
        <?php else: ?>
        <svg class="w-10 h-10 text-green-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                  d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
        </svg>
        <?php endif; ?>
    </div>
    <?php if($ticket->status === 'Pickup Requested'): ?>
    <h1 class="text-xl font-bold text-gray-800 mb-1">Permintaan Pickup Dicatat!</h1>
    <p class="text-sm text-gray-500">Kurir akan segera menghubungi dan menjemput perangkat Anda.</p>
    <?php else: ?>
    <h1 class="text-xl font-bold text-gray-800 mb-1">Tiket Berhasil Dibuat!</h1>
    <p class="text-sm text-gray-500">Simpan nomor tiket berikut sebagai bukti penerimaan servis.</p>
    <?php endif; ?>
</div>


<div class="bg-brand-600 rounded-2xl text-white p-5 text-center mb-5 shadow-lg shadow-brand-100">
    <p class="text-xs font-medium uppercase tracking-widest opacity-70 mb-1">Nomor Tiket</p>
    <p class="text-3xl font-bold font-mono tracking-widest"><?php echo e($ticket->ticket_code); ?></p>
    <p class="text-xs opacity-60 mt-2"><?php echo e($ticket->created_at->format('d M Y, H:i')); ?> WIB</p>
</div>


<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-5 mb-5">
    <h2 class="text-sm font-semibold text-gray-500 uppercase tracking-wide mb-3">Informasi Pelanggan</h2>
    <dl class="space-y-2 text-sm">
        <div class="flex justify-between">
            <dt class="text-gray-500">Nama</dt>
            <dd class="font-medium text-gray-800"><?php echo e($ticket->customer->name); ?></dd>
        </div>
        <?php if($ticket->customer->whatsapp): ?>
        <div class="flex justify-between">
            <dt class="text-gray-500">WhatsApp</dt>
            <dd class="font-medium text-gray-800"><?php echo e($ticket->customer->whatsapp); ?></dd>
        </div>
        <?php endif; ?>
        <?php if($ticket->customer->address): ?>
        <div class="flex justify-between gap-4">
            <dt class="text-gray-500 shrink-0">Alamat</dt>
            <dd class="font-medium text-gray-800 text-right"><?php echo e($ticket->customer->address); ?></dd>
        </div>
        <?php endif; ?>
        <?php if($ticket->pickup_note): ?>
        <div class="flex justify-between gap-4">
            <dt class="text-gray-500 shrink-0">Catatan</dt>
            <dd class="font-medium text-gray-800 text-right"><?php echo e($ticket->pickup_note); ?></dd>
        </div>
        <?php endif; ?>
    </dl>
</div>

<?php if($ticket->status !== 'Pickup Requested'): ?>
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-5 mb-5">
    <h2 class="text-sm font-semibold text-gray-500 uppercase tracking-wide mb-3">Detail Perangkat</h2>
    <dl class="space-y-2 text-sm">
        <div class="flex justify-between">
            <dt class="text-gray-500">Jenis</dt>
            <dd class="font-medium text-gray-800"><?php echo e($ticket->device_type); ?></dd>
        </div>
        <div class="flex justify-between">
            <dt class="text-gray-500">Merek / Model</dt>
            <dd class="font-medium text-gray-800"><?php echo e($ticket->brand); ?> <?php echo e($ticket->model); ?></dd>
        </div>
        <?php if($ticket->serial_number): ?>
        <div class="flex justify-between">
            <dt class="text-gray-500">Serial Number</dt>
            <dd class="font-medium text-gray-800 font-mono"><?php echo e($ticket->serial_number); ?></dd>
        </div>
        <?php endif; ?>
        <div class="flex justify-between gap-4">
            <dt class="text-gray-500 shrink-0">Keluhan</dt>
            <dd class="font-medium text-gray-800 text-right"><?php echo e($ticket->problem_desc); ?></dd>
        </div>
        <div class="flex justify-between">
            <dt class="text-gray-500">Status</dt>
            <dd>
                <span class="inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold
                             bg-yellow-100 text-yellow-800">
                    <?php echo e($ticket->status); ?>

                </span>
            </dd>
        </div>
    </dl>
</div>
<?php else: ?>
<div class="bg-purple-50 rounded-2xl border border-purple-200 p-5 mb-5">
    <div class="flex gap-3">
        <svg class="w-5 h-5 text-purple-500 flex-shrink-0 mt-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                  d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
        </svg>
        <div class="text-sm text-purple-800">
            <p class="font-semibold mb-1">Langkah Selanjutnya</p>
            <p class="text-purple-700">Kurir akan menghubungi Anda untuk konfirmasi waktu penjemputan. Simpan nomor tiket ini untuk melacak status servis.</p>
        </div>
    </div>
</div>
<?php endif; ?>


<?php if($ticket->asset): ?>
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-5 mb-5">
    <h2 class="text-sm font-semibold text-gray-500 uppercase tracking-wide mb-3">Dokumentasi Masuk</h2>
    <div class="grid grid-cols-2 gap-3">
        <?php if($ticket->asset->photo_entry): ?>
        <div>
            <p class="text-xs text-gray-400 mb-1">Foto Barang</p>
            <img src="<?php echo e(Storage::url($ticket->asset->photo_entry)); ?>"
                 alt="Foto Barang"
                 class="w-full rounded-xl object-cover aspect-square border border-gray-100">
        </div>
        <?php endif; ?>
        <?php if($ticket->asset->sig_entry): ?>
        <div>
            <p class="text-xs text-gray-400 mb-1">Tanda Tangan</p>
            <img src="<?php echo e(Storage::url($ticket->asset->sig_entry)); ?>"
                 alt="Tanda Tangan"
                 class="w-full rounded-xl object-contain aspect-square bg-white border border-gray-100 p-2">
        </div>
        <?php endif; ?>
    </div>
</div>
<?php endif; ?>


<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-5 mb-5 flex flex-col items-center gap-3">
    <p class="text-sm font-semibold text-gray-500 uppercase tracking-wide self-start">QR Code Tiket</p>
    <div class="p-2 border border-gray-100 rounded-xl">
        <?php echo QrCode::format('svg')
              ->size(140)
              ->margin(1)
              ->color(30, 58, 95)
              ->backgroundColor(255, 255, 255)
              ->generate(route('tickets.show', $ticket->id)); ?>

    </div>
    <p class="text-xs text-gray-400 text-center">Scan untuk melihat status servis secara real-time</p>
</div>


<div class="flex flex-col gap-3">
    <a href="<?php echo e(route('tickets.label', $ticket->id)); ?>"
       target="_blank"
       class="w-full text-center bg-brand-600 hover:bg-brand-700 text-white font-semibold
              text-sm rounded-2xl py-4 flex items-center justify-center gap-2 transition">
        <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                  d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"/>
        </svg>
        Cetak Label (50mm × 30mm)
    </a>
    <a href="<?php echo e(route('tickets.show', $ticket->id)); ?>"
       class="w-full text-center border border-brand-500 text-brand-600 font-medium
              text-sm rounded-2xl py-3 hover:bg-brand-50 transition">
        Lihat Detail Tiket
    </a>
    <a href="<?php echo e(route('tickets.create')); ?>"
       class="w-full text-center border border-gray-300 text-gray-700 font-medium
              text-sm rounded-2xl py-3 hover:bg-gray-50 transition">
        + Buat Tiket Baru
    </a>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\Service-sistem\resources\views/tickets/success.blade.php ENDPATH**/ ?>