<?php $__env->startSection('content'); ?>
<div class="py-12">
    <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
        <div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg">
            <div class="p-6 text-gray-900 dark:text-gray-100">
                <div class="d-flex justify-content-between align-items-center mb-4">
                    <h1 class="h3 mb-0">View Page: <?php echo e($page->title); ?></h1>
                    <div>
                        <a href="<?php echo e(route('admin.pages.edit', $page)); ?>" class="btn btn-primary">
                            <i class="fas fa-edit"></i> Edit
                        </a>
                        <?php if($page->status === 'published'): ?>
                            <a href="<?php echo e(route('pages.public', $page->slug)); ?>" target="_blank" class="btn btn-success">
                                <i class="fas fa-eye"></i> View Live
                            </a>
                        <?php endif; ?>
                        <a href="<?php echo e(route('admin.pages.index')); ?>" class="btn btn-secondary">
                            <i class="fas fa-arrow-left"></i> Back to Pages
                        </a>
                    </div>
                </div>

                <?php if(session('success')): ?>
                    <div class="alert alert-success alert-dismissible fade show" role="alert">
                        <?php echo e(session('success')); ?>

                        <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
                    </div>
                <?php endif; ?>

                <div class="row mb-4">
                    <div class="col-md-8">
                        <div class="card mb-4">
                            <div class="card-header d-flex justify-content-between align-items-center">
                                <span>Page Details</span>
                                <span class="badge <?php echo e($page->status == 'published' ? 'bg-success' : ($page->status == 'draft' ? 'bg-warning' : 'bg-secondary')); ?>">
                                    <?php echo e(ucfirst($page->status)); ?>

                                </span>
                            </div>
                            <div class="card-body">
                                <?php if($page->featured_image || $page->banner_image): ?>
                                <div class="row mb-4">
                                    <?php if($page->featured_image): ?>
                                    <div class="col-md-6 mb-3">
                                        <h5>Featured Image</h5>
                                        <img src="<?php echo e(asset('storage/' . $page->featured_image)); ?>" class="img-fluid rounded" 
                                            alt="<?php echo e($page->featured_image_alt); ?>">
                                        <?php if($page->featured_image_caption): ?>
                                        <p class="mt-2 text-muted"><?php echo e($page->featured_image_caption); ?></p>
                                        <?php endif; ?>
                                    </div>
                                    <?php endif; ?>
                                    
                                    <?php if($page->banner_image): ?>
                                    <div class="col-md-6 mb-3">
                                        <h5>Banner Image</h5>
                                        <img src="<?php echo e(asset('storage/' . $page->banner_image)); ?>" class="img-fluid rounded" 
                                            alt="<?php echo e($page->banner_image_alt); ?>">
                                    </div>
                                    <?php endif; ?>
                                </div>
                                <hr>
                                <?php endif; ?>

                                <h2><?php echo e($page->title); ?></h2>
                                
                                <?php if($page->excerpt): ?>
                                <div class="card bg-light mb-4">
                                    <div class="card-body">
                                        <h5>Excerpt</h5>
                                        <p class="mb-0"><?php echo e($page->excerpt); ?></p>
                                    </div>
                                </div>
                                <?php endif; ?>

                                <div class="mt-4">
                                    <h5>Content</h5>
                                    <div class="content-preview">
                                        <?php echo $page->content; ?>

                                    </div>
                                </div>

                                <div class="mt-4">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <p><strong>Slug:</strong> <?php echo e($page->slug); ?></p>
                                            <p><strong>Sort Order:</strong> <?php echo e($page->sort_order); ?></p>
                                            <p>
                                                <strong>Featured:</strong> 
                                                <?php if($page->is_featured): ?>
                                                    <span class="badge bg-primary">Yes</span>
                                                <?php else: ?>
                                                    <span class="badge bg-secondary">No</span>
                                                <?php endif; ?>
                                            </p>
                                        </div>
                                        <div class="col-md-6">
                                            <p>
                                                <strong>Published Date:</strong> 
                                                <?php echo e($page->published_at ? $page->published_at->format('d M Y, H:i') : 'Not set'); ?>

                                            </p>
                                            <p><strong>Created:</strong> <?php echo e($page->created_at->format('d M Y, H:i')); ?></p>
                                            <p><strong>Last Updated:</strong> <?php echo e($page->updated_at->format('d M Y, H:i')); ?></p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="col-md-4">
                        <!-- Author Info -->
                        <div class="card mb-4">
                            <div class="card-header">Author Information</div>
                            <div class="card-body">
                                <p><strong>Created By:</strong> <?php echo e($page->author->name ?? 'Unknown'); ?></p>
                                <p><strong>Last Updated By:</strong> <?php echo e($page->updatedBy->name ?? 'Unknown'); ?></p>
                            </div>
                        </div>

                        <!-- SEO Information -->
                        <div class="card mb-4">
                            <div class="card-header">SEO Information</div>
                            <div class="card-body">
                                <div class="mb-3">
                                    <strong>Meta Title:</strong>
                                    <p class="mb-0"><?php echo e($page->meta_title ?: 'Not set'); ?></p>
                                </div>
                                
                                <div class="mb-3">
                                    <strong>Meta Description:</strong>
                                    <p class="mb-0"><?php echo e($page->meta_description ?: 'Not set'); ?></p>
                                </div>
                                
                                <div class="mb-3">
                                    <strong>Meta Keywords:</strong>
                                    <p class="mb-0"><?php echo e($page->meta_keywords ?: 'Not set'); ?></p>
                                </div>
                                
                                <div class="mb-3">
                                    <strong>Meta Robots:</strong>
                                    <p class="mb-0"><?php echo e($page->meta_robots ?: 'Not set'); ?></p>
                                </div>
                                
                                <div class="mb-3">
                                    <strong>Canonical URL:</strong>
                                    <p class="mb-0"><?php echo e($page->canonical_url ?: 'Not set'); ?></p>
                                </div>
                            </div>
                        </div>

                        <!-- Actions -->
                        <div class="card">
                            <div class="card-header">Actions</div>
                            <div class="card-body">
                                <div class="d-grid gap-2">
                                    <a href="<?php echo e(route('admin.pages.edit', $page)); ?>" class="btn btn-primary">
                                        <i class="fas fa-edit"></i> Edit Page
                                    </a>
                                    <form action="<?php echo e(route('admin.pages.destroy', $page)); ?>" method="POST">
                                        <?php echo csrf_field(); ?>
                                        <?php echo method_field('DELETE'); ?>
                                        <button type="submit" class="btn btn-danger w-100" 
                                            onclick="return confirm('Are you sure you want to delete this page? This action cannot be undone.')">
                                            <i class="fas fa-trash"></i> Delete Page
                                        </button>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('styles'); ?>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<style>
    .content-preview img {
        max-width: 100%;
        height: auto;
    }
</style>
<?php $__env->stopPush(); ?>

<?php $__env->startPush('scripts'); ?>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/tlshs/public_html/thelalitloyalty.com/resources/views/admin/pages/show.blade.php ENDPATH**/ ?>