<!DOCTYPE html>
<html lang="<?php echo e(str_replace('_', '-', app()->getLocale())); ?>">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
    <title><?php echo $__env->yieldContent('title', config('app.name')); ?></title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap" rel="stylesheet">
    <?php echo app('Illuminate\Foundation\Vite')(['resources/css/app.css', 'resources/js/app.js']); ?>
    <?php echo $__env->make('partials.design-tokens', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
    <?php echo $__env->yieldPushContent('head'); ?>
</head>
<body class="pc-shell font-sans antialiased text-slate-900">
    <header class="pc-header-glass sticky top-0 z-50 backdrop-blur-md">
        <div class="mx-auto flex max-w-6xl flex-wrap items-center gap-3 px-4 py-3.5">
            <a href="<?php echo e(auth()->check() ? route('my-learning') : route('home')); ?>" class="shrink-0 text-lg font-bold tracking-tight text-[var(--pc-brand)]">
                <?php echo e(config('app.name')); ?>

            </a>
            <?php if(auth()->guard()->check()): ?>
                <form method="GET" action="<?php echo e(route('search.courses')); ?>" class="order-3 flex min-w-0 flex-1 basis-full items-center gap-2 sm:order-none sm:basis-[14rem] md:basis-72">
                    <input type="search" name="q" value="<?php echo e(request()->routeIs('search.*') ? request('q') : ''); ?>" placeholder="Search your courses…" autocomplete="off"
                        class="pc-ring-focus min-w-0 flex-1 rounded-full border border-slate-200/90 bg-white/90 px-4 py-2 text-sm text-slate-900 shadow-inner placeholder:text-slate-400 focus:border-[color-mix(in_srgb,var(--pc-accent)_45%,#cbd5e1)]">
                    <button type="submit" class="pc-btn-primary shrink-0 rounded-full px-4 py-2 text-xs font-semibold shadow-sm sm:text-sm">Search</button>
                </form>
            <?php endif; ?>
            <nav class="ml-auto flex flex-wrap items-center gap-1.5 text-sm font-medium text-slate-600 md:gap-2">
                <?php if(auth()->guard()->check()): ?>
                    <a href="<?php echo e(route('my-learning')); ?>"
                        class="inline-flex items-center rounded-full bg-[var(--pc-brand)] px-4 py-2 text-sm font-semibold text-white shadow-md transition hover:brightness-110">
                        My learning
                    </a>
                    <?php if(auth()->user()->is_super_admin): ?>
                        <a href="<?php echo e(route('platform.tenants.index')); ?>" class="rounded-full px-3 py-2 hover:bg-white/80 hover:text-[var(--pc-brand)]">Platform</a>
                    <?php endif; ?>
                    <a href="<?php echo e(route('profile')); ?>" class="max-w-[10rem] truncate rounded-full px-3 py-2 hover:bg-white/80 hover:text-[var(--pc-brand)] md:max-w-[12rem]" title="<?php echo e(auth()->user()->email); ?>">
                        <?php echo e(auth()->user()->name ?: auth()->user()->email); ?>

                    </a>
                    <a href="<?php echo e(route('profile')); ?>" class="hidden rounded-full px-3 py-2 hover:bg-white/80 hover:text-[var(--pc-brand)] sm:inline">Profile</a>
                    <form method="POST" action="<?php echo e(route('logout')); ?>" class="inline">
                        <?php echo csrf_field(); ?>
                        <button type="submit" class="rounded-full px-3 py-2 text-slate-500 hover:bg-white/80 hover:text-slate-800">Log out</button>
                    </form>
                <?php else: ?>
                    <a href="<?php echo e(route('login')); ?>" class="rounded-full px-3 py-2 hover:bg-white/80 hover:text-[var(--pc-brand)]">Log in</a>
                    <a href="<?php echo e(route('register')); ?>" class="rounded-full px-3 py-2 hover:bg-white/80 hover:text-[var(--pc-brand)]">Sign up</a>
                    <a href="<?php echo e(route('create-space')); ?>" class="rounded-full border border-slate-200/80 bg-white/90 px-4 py-2 shadow-sm hover:border-[var(--pc-accent)] hover:text-[var(--pc-brand)]">Create a space</a>
                <?php endif; ?>
            </nav>
        </div>
    </header>

    <main class="mx-auto max-w-6xl px-4 py-8">
        <?php if(auth()->guard()->check()): ?>
            <?php if(isset($tenant)): ?>
                <?php ($tenantMembership = auth()->user()->memberships()->where('tenant_id', $tenant->id)->first()); ?>
                <div class="mb-8 rounded-2xl border border-white/60 bg-white/85 px-5 py-4 shadow-[var(--pc-shadow)] backdrop-blur-sm sm:px-6">
                    <div class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
                        <div class="min-w-0 flex-1 space-y-3">
                            <?php if(filled(auth()->user()->name) && auth()->user()->name !== auth()->user()->email): ?>
                                <p class="text-lg font-semibold leading-tight text-[var(--pc-brand)]"><?php echo e(auth()->user()->name); ?></p>
                                <p class="text-sm text-slate-600 break-all"><?php echo e(auth()->user()->email); ?></p>
                            <?php else: ?>
                                <p class="text-lg font-semibold leading-tight text-[var(--pc-brand)] break-all"><?php echo e(auth()->user()->email); ?></p>
                            <?php endif; ?>
                            <div class="flex flex-wrap gap-2">
                                <?php if($tenantMembership): ?>
                                    <span class="inline-flex items-center rounded-full bg-[color-mix(in_srgb,var(--pc-accent)_16%,white)] px-3 py-1 text-xs font-semibold text-[var(--pc-brand)] ring-1 ring-[color-mix(in_srgb,var(--pc-accent)_35%,transparent)]">
                                        <?php echo e(ucfirst($tenantMembership->role)); ?> · <?php echo e($tenant->name); ?>

                                    </span>
                                <?php else: ?>
                                    <span class="inline-flex max-w-prose rounded-full bg-amber-50 px-3 py-1 text-xs font-medium text-amber-950 ring-1 ring-amber-200/80">
                                        Not a member of this space yet — use <strong class="font-semibold">Join this space</strong> on the catalog when you are learning here.
                                    </span>
                                <?php endif; ?>
                                <?php if(auth()->user()->is_super_admin): ?>
                                    <span class="inline-flex rounded-full bg-violet-100 px-3 py-1 text-xs font-semibold text-violet-900 ring-1 ring-violet-200">Platform admin</span>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="flex shrink-0 flex-wrap gap-2">
                            <a href="<?php echo e(route('profile')); ?>" class="inline-flex items-center justify-center rounded-full border border-slate-200 bg-white px-4 py-2 text-sm font-semibold text-[var(--pc-brand)] shadow-sm transition hover:border-[var(--pc-accent)] hover:bg-slate-50">
                                Profile
                            </a>
                            <a href="<?php echo e(route('dashboard')); ?>" class="inline-flex items-center justify-center rounded-full border border-slate-200 bg-white px-4 py-2 text-sm font-semibold text-[var(--pc-brand)] shadow-sm transition hover:border-[var(--pc-accent)] hover:bg-slate-50">
                                Your spaces
                            </a>
                        </div>
                    </div>
                </div>
            <?php endif; ?>
        <?php endif; ?>

        <?php if(session('status')): ?>
            <p class="mb-6 rounded-2xl border border-[color-mix(in_srgb,var(--pc-accent)_28%,#99f6e4)] bg-[color-mix(in_srgb,var(--pc-accent)_12%,white)] px-4 py-3 text-sm text-slate-800 shadow-sm"><?php echo e(session('status')); ?></p>
        <?php endif; ?>

        <?php if(session('warning')): ?>
            <p class="mb-6 rounded-2xl border border-amber-200/90 bg-amber-50 px-4 py-3 text-sm text-amber-950 shadow-sm"><?php echo e(session('warning')); ?></p>
        <?php endif; ?>

        <?php if($errors->any()): ?>
            <div class="mb-6 rounded-2xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-900 shadow-sm">
                <ul class="list-inside list-disc space-y-1">
                    <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <li><?php echo e($error); ?></li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </ul>
            </div>
        <?php endif; ?>

        <?php echo $__env->yieldContent('content'); ?>
    </main>
</body>
</html>
<?php /**PATH /Users/nurudinwahablartey/Projects/lms/resources/views/layouts/app.blade.php ENDPATH**/ ?>