<?php $__env->startSection('backend_content'); ?>
    <?php
        $associatedStaff = $shop->users;
        if ($shop->creator && !$associatedStaff->contains('id', $shop->creator->id)) {
            $associatedStaff = $associatedStaff->push($shop->creator);
        }
    ?>

    <div class="container-fluid">
        
        <div class="d-flex justify-content-between align-items-center mb-4">
            <div>
                <h4 class="fw-bold mb-1"><?php echo e($shop->name); ?></h4>
                <small class="text-muted">Shop Details</small>
            </div>
            <div class="d-flex gap-2">
                <a href="<?php echo e(route('admin.shops.report', $shop)); ?>" class="btn btn-outline-primary">
                    <i class="bx bx-line-chart"></i> Report
                </a>
                <a href="<?php echo e(route('admin.shops.edit', $shop)); ?>" class="btn btn-primary">
                    <i class="bx bx-edit"></i> Edit
                </a>
                <a href="<?php echo e(route('admin.shops.index')); ?>" class="btn btn-light">
                    <i class="bx bx-arrow-back"></i> Back
                </a>
            </div>
        </div>

        <div class="row">
            
            <div class="col-md-8">
                <div class="card border-0 shadow-sm mb-4">
                    <div class="card-header"
                        style="background: linear-gradient(135deg, <?php echo e($shop->brand_color); ?>, <?php echo e($shop->brand_color); ?>dd); color: white;">
                        <h5 class="mb-0"><i class="bx bx-store"></i> Shop Information</h5>
                    </div>
                    <div class="card-body mt-4">
                        <div class="row">
                            <div class="col-md-6">
                                <h6>Name</h6>
                                <p><?php echo e($shop->name); ?></p>

                                <h6>Brand Color</h6>
                                <div class="d-flex align-items-center gap-2">
                                    <div
                                        style="width: 30px; height: 30px; background-color: <?php echo e($shop->brand_color); ?>; border-radius: 50%;">
                                    </div>
                                    <?php echo e($shop->brand_color); ?>

                                </div>
                            </div>
                            <div class="col-md-6">
                                <?php if($shop->logo): ?>
                                    <h6>Logo</h6>
                                    <img src="<?php echo e(asset('storage/' . $shop->logo)); ?>" alt="<?php echo e($shop->name); ?>"
                                        class="img-fluid rounded" style="max-width: 150px;">
                                <?php endif; ?>
                            </div>
                        </div>
                    </div>
                </div>

                
                <div class="card border-0 shadow-sm">
                    <div class="card-header">
                        <h5 class="mb-0"><i class="bx bx-phone"></i> Contact Information</h5>
                    </div>
                    <div class="card-body">
                        <div class="row">
                            <div class="col-md-4">
                                <h6>Phone</h6>
                                <p><?php echo e($shop->contact['phone'] ?? 'Not provided'); ?></p>
                            </div>
                            <div class="col-md-4">
                                <h6>Email</h6>
                                <p><?php echo e($shop->contact['email'] ?? 'Not provided'); ?></p>
                            </div>
                            <div class="col-md-4">
                                <h6>Address</h6>
                                <p><?php echo e($shop->contact['address'] ?? 'Not provided'); ?></p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            
            <div class="col-md-4">
                <div class="card border-0 shadow-sm">
                    <div class="card-header">
                        <h5 class="mb-0"><i class="bx bx-group"></i> Associated Staff (<?php echo e($associatedStaff->count()); ?>)
                        </h5>
                    </div>
                    <div class="card-body" style="max-height: 400px; overflow-y: auto;">
                        <?php $__empty_1 = true; $__currentLoopData = $associatedStaff; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <div class="d-flex align-items-center gap-3 mb-3">
                                <div class="avatar bg-primary text-white"
                                    style="width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;">
                                    <?php echo e(strtoupper(substr($user->name, 0, 2))); ?>

                                </div>
                                <div>
                                    <div class="fw-semibold">
                                        <?php echo e($user->name); ?>

                                        <?php if($shop->creator && $user->id === $shop->creator->id): ?>
                                            <span class="badge bg-label-success ms-1">Owner</span>
                                        <?php endif; ?>
                                    </div>
                                    <small class="text-muted"><?php echo e($user->email); ?></small>
                                </div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <p class="text-muted">No staff associated with this shop.</p>
                        <?php endif; ?>
                    </div>
                </div>

                
                <div class="card border-0 shadow-sm mt-3">
                    <div class="card-header">
                        <h5 class="mb-0"><i class="bx bx-user"></i> Created By</h5>
                    </div>
                    <div class="card-body">
                        <div class="d-flex align-items-center gap-3">
                            <div class="avatar bg-success text-white"
                                style="width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;">
                                <?php echo e(strtoupper(substr($shop->creator->name, 0, 2))); ?>

                            </div>
                            <div>
                                <div class="fw-semibold"><?php echo e($shop->creator->name); ?></div>
                                <small class="text-muted"><?php echo e($shop->creator->email); ?></small>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('backend.layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\Abdur Rahman\Desktop\faa\resources\views/backend/shops/show.blade.php ENDPATH**/ ?>