<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
    
    <title>Admin Dashboard - <?php echo e($branding['company_name']); ?></title>
    <?php if($branding['favicon_url']): ?>
        <link rel="icon" href="<?php echo e($branding['favicon_url']); ?>" type="image/png">
    <?php endif; ?>
    
    <!-- Bootstrap 5 CSS via CDN -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Bootstrap Icons via CDN -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
    
    <!-- Custom CSS via Vite -->
    <?php echo $__env->make('partials.vite-assets', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

    <!-- Chart.js CDN -->
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <!-- SweetAlert2 -->
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

    <?php echo $__env->yieldContent('styles'); ?>
</head>
<body class="bg-light admin-layout">

    <!-- ADMIN SIDEBAR (fixed) -->
    <aside id="admin-sidebar" class="admin-sidebar d-lg-flex flex-column p-0 collapse">
        <div class="p-4 border-bottom border-secondary border-opacity-25 d-flex align-items-center justify-content-between">
            <a class="text-white text-decoration-none d-flex align-items-center gap-2" href="<?php echo e(route('home')); ?>" data-turbo="false">
                <?php echo $__env->make('partials.brand-logo', ['height' => 36], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                <span class="text-danger small fw-bold text-uppercase ms-1">Admin</span>
            </a>
            <button type="button" class="btn-close btn-close-white d-lg-none" data-bs-toggle="collapse" data-bs-target="#admin-sidebar" aria-label="Close sidebar"></button>
        </div>
                
        <ul class="nav nav-pills flex-column mb-auto mt-4">
                    <li class="nav-item">
                        <a href="<?php echo e(route('admin.dashboard')); ?>" data-turbo-frame="admin-content" class="nav-link <?php echo e(Route::is('admin.dashboard') ? 'active' : ''); ?>">
                            <i class="bi bi-speedometer2 me-2"></i> Dashboard
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="<?php echo e(route('admin.products.index')); ?>" data-turbo-frame="admin-content" class="nav-link <?php echo e(Route::is('admin.products.*') ? 'active' : ''); ?>">
                            <i class="bi bi-bicycle me-2"></i> Manage Products
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="<?php echo e(route('admin.orders.index')); ?>" data-turbo-frame="admin-content" class="nav-link <?php echo e(Route::is('admin.orders.*') ? 'active' : ''); ?>">
                            <i class="bi bi-cart3 me-2"></i> Manage Orders
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="<?php echo e(route('admin.bookings.index')); ?>" data-turbo-frame="admin-content" class="nav-link <?php echo e(Route::is('admin.bookings.*') ? 'active' : ''); ?>">
                            <i class="bi bi-tools me-2"></i> Repair Bookings
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="<?php echo e(route('admin.payments.index')); ?>" data-turbo-frame="admin-content" class="nav-link <?php echo e(Route::is('admin.payments.*') ? 'active' : ''); ?>">
                            <i class="bi bi-wallet2 me-2"></i> Payment Logs
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="<?php echo e(route('admin.gallery.index')); ?>" data-turbo-frame="admin-content" class="nav-link <?php echo e(Route::is('admin.gallery.*') ? 'active' : ''); ?>">
                            <i class="bi bi-images me-2"></i> Manage Gallery
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="<?php echo e(route('admin.blog.index')); ?>" data-turbo-frame="admin-content" class="nav-link <?php echo e(Route::is('admin.blog.*') ? 'active' : ''); ?>">
                            <i class="bi bi-journal-text me-2"></i> Manage Blog
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="<?php echo e(route('admin.settings.index')); ?>" data-turbo-frame="admin-content" class="nav-link <?php echo e(Route::is('admin.settings.*') ? 'active' : ''); ?>">
                            <i class="bi bi-sliders me-2"></i> Website Settings
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="<?php echo e(route('admin.slides.index')); ?>" data-turbo-frame="admin-content" class="nav-link <?php echo e(Route::is('admin.slides.*') ? 'active' : ''); ?>">
                            <i class="bi bi-images me-2"></i> Hero Slides
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="<?php echo e(route('admin.quotations.index')); ?>" data-turbo-frame="admin-content" class="nav-link <?php echo e(Route::is('admin.quotations.*') ? 'active' : ''); ?>">
                            <i class="bi bi-chat-quote me-2"></i> Quotations
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="<?php echo e(route('admin.profile.edit')); ?>" data-turbo-frame="admin-content" class="nav-link <?php echo e(Route::is('admin.profile.*') ? 'active' : ''); ?>">
                            <i class="bi bi-person-gear me-2"></i> My Profile
                        </a>
                    </li>
        </ul>
                
        <div class="p-3 border-top border-secondary border-opacity-25 mt-auto">
                    <a href="<?php echo e(route('home')); ?>" data-turbo="false" class="btn btn-outline-light btn-sm w-100 rounded-pill mb-2"><i class="bi bi-globe me-1"></i> Visit Site</a>
                    <form action="<?php echo e(route('logout')); ?>" method="POST" class="w-100" data-turbo="false">
                        <?php echo csrf_field(); ?>
                        <button type="submit" class="btn btn-danger btn-sm w-100 rounded-pill"><i class="bi bi-box-arrow-right me-1"></i> Logout</button>
                    </form>
        </div>
    </aside>

    <!-- MAIN VIEWPORT CONTENT -->
    <div class="admin-main">
        <header class="admin-header navbar navbar-mj py-3 px-4 justify-content-between">
            <button class="btn btn-dark d-lg-none rounded-circle" type="button" data-bs-toggle="collapse" data-bs-target="#admin-sidebar" aria-controls="admin-sidebar" aria-expanded="false" aria-label="Toggle sidebar">
                <i class="bi bi-list"></i>
            </button>
            <h5 class="fw-bold mb-0 text-secondary d-none d-lg-block"><?php echo e($branding['company_name']); ?> Operations</h5>
            <div class="dropdown">
                <button class="btn btn-outline-secondary btn-sm dropdown-toggle rounded-pill px-3" type="button" id="adminUserMenu" data-bs-toggle="dropdown" aria-expanded="false">
                    <i class="bi bi-person-circle me-1"></i> <?php echo e(Auth::user()->name); ?>

                </button>
                <ul class="dropdown-menu dropdown-menu-end shadow-sm border-0 rounded-4" aria-labelledby="adminUserMenu">
                    <li><a class="dropdown-item" href="<?php echo e(route('admin.profile.edit')); ?>" data-turbo-frame="admin-content"><i class="bi bi-person-gear me-2"></i> My Profile</a></li>
                    <li><a class="dropdown-item" href="<?php echo e(route('admin.settings.index')); ?>" data-turbo-frame="admin-content"><i class="bi bi-sliders me-2"></i> Website Settings</a></li>
                    <li><hr class="dropdown-divider"></li>
                    <li>
                        <form action="<?php echo e(route('logout')); ?>" method="POST" data-turbo="false">
                            <?php echo csrf_field(); ?>
                            <button type="submit" class="dropdown-item text-danger"><i class="bi bi-box-arrow-right me-2"></i> Logout</button>
                        </form>
                    </li>
                </ul>
            </div>
        </header>

        <!-- Turbo Frame: scrollable admin panel content -->
        <turbo-frame id="admin-content" data-turbo-action="advance" class="turbo-frame-shell admin-content-scroll">
            <?php echo $__env->make('partials.turbo-flash', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
            <span class="d-none" data-page-title="<?php echo $__env->yieldContent('page_title', 'Admin - ' . $branding['company_name']); ?>"></span>

            <div class="p-2 p-md-4">
                <?php echo $__env->yieldContent('content'); ?>
            </div>

            <?php echo $__env->yieldContent('scripts'); ?>
        </turbo-frame>

        <footer class="admin-footer bg-white border-top py-3 px-4 text-center text-muted small">
            <?php echo e($branding['copyright_text']); ?> — Secure Administrator Area.
        </footer>
    </div>

    <!-- Bootstrap 5 JS via CDN -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>

    <script>
        // Close admin sidebar on mobile when a link is clicked
        document.addEventListener('DOMContentLoaded', function() {
            var sidebarLinks = document.querySelectorAll('#admin-sidebar .nav-link');
            var sidebarElement = document.getElementById('admin-sidebar');
            
            sidebarLinks.forEach(function(link) {
                link.addEventListener('click', function() {
                    // Only collapse if we're on mobile (window innerWidth < 992px)
                    if (window.innerWidth < 992) {
                        var bsCollapse = bootstrap.Collapse.getInstance(sidebarElement);
                        if (bsCollapse) {
                            bsCollapse.hide();
                        }
                    }
                });
            });
        });
    </script>

    <?php echo $__env->make('partials.sweetalert', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
</body>
</html>
<?php /**PATH C:\xampp\htdocs\mjs-bikes-marketplace\resources\views/layouts/admin.blade.php ENDPATH**/ ?>