<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
    <div class="max-w-4xl relative z-20">
        <div class="mb-12 flex items-center justify-between">
            <a href="<?php echo e(route('notes.index')); ?>" class="group inline-flex items-center gap-2 text-sm font-bold text-slate-400 hover:text-slate-800 transition-colors">
                <svg class="w-4 h-4 transform group-hover:-translate-x-1 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M10 19l-7-7m0 0l7-7m-7 7h18" /></svg>
                Return to Notebook
            </a>
            
            <div class="flex items-center gap-4">
                <span class="text-[10px] font-black uppercase tracking-widest text-indigo-600 bg-indigo-50 px-3 py-1 rounded-lg border border-indigo-100/50">
                    <?php echo e($note->category->name); ?>

                </span>
                <?php if($note->is_paid): ?>
                    <span class="text-[10px] font-black uppercase tracking-widest text-amber-600 bg-amber-50 px-3 py-1 rounded-lg border border-amber-100 flex items-center gap-1.5">
                        <svg class="w-3 h-3" fill="currentColor" viewBox="0 0 20 20"><path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" /></svg>
                        Premium <?php if($note->price): ?> (TK <?php echo e(number_format($note->price, 0)); ?>) <?php endif; ?>
                    </span>
                <?php endif; ?>
                <span class="text-xs font-bold text-slate-300">#<?php echo e(str_pad($note->id, 5, '0', STR_PAD_LEFT)); ?></span>
            </div>
        </div>

        <?php if (isset($component)) { $__componentOriginaled4987d3f6007db3445a6067a328a16c = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginaled4987d3f6007db3445a6067a328a16c = $attributes; } ?>
<?php $component = App\View\Components\AdBanner::resolve(['placement' => 'note_top'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('ad-banner'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AdBanner::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginaled4987d3f6007db3445a6067a328a16c)): ?>
<?php $attributes = $__attributesOriginaled4987d3f6007db3445a6067a328a16c; ?>
<?php unset($__attributesOriginaled4987d3f6007db3445a6067a328a16c); ?>
<?php endif; ?>
<?php if (isset($__componentOriginaled4987d3f6007db3445a6067a328a16c)): ?>
<?php $component = $__componentOriginaled4987d3f6007db3445a6067a328a16c; ?>
<?php unset($__componentOriginaled4987d3f6007db3445a6067a328a16c); ?>
<?php endif; ?>

        <div class="lined-text-group">
            <h1 class="text-4xl md:text-6xl font-black text-slate-900 tracking-tight leading-[1.2] mb-10 font-outfit">
                <?php echo e($note->title); ?>

            </h1>

            <div class="prose max-w-none">
                <?php
                    $hasAccess = ! $note->is_paid || (Auth::check() && Auth::user()->hasAccessToNote($note));
                ?>

                <?php if($hasAccess): ?>
                    <?php if($note->type === 'image'): ?>
                        <div class="relative w-full rounded-2xl overflow-hidden shadow-2xl bg-slate-50 border border-slate-100 mb-[2.5rem] mt-4">
                            <img src="<?php echo e(Storage::url($note->content)); ?>" alt="<?php echo e($note->title); ?>" class="w-full h-auto">
                            <div class="absolute inset-0 bg-gradient-to-t from-black/10 to-transparent pointer-events-none"></div>
                        </div>
                    <?php else: ?>
                        <div class="text-2xl text-slate-600 font-medium italic font-caveat leading-[2.5rem] space-y-0">
                            <?php $__currentLoopData = explode("\n", e($note->content)); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $line): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <p class="mb-0"><?php echo e($line); ?></p>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    <?php endif; ?>
                <?php else: ?>
                    <!-- Teaser Content for Paid Version -->
                    <div class="relative">
                        <div class="text-2xl text-slate-400 font-medium italic font-caveat leading-[2.5rem] select-none blur-sm opacity-30">
                            <?php if($note->type === 'image'): ?>
                                <div class="relative w-full rounded-2xl overflow-hidden shadow-2xl bg-slate-50 border border-slate-100 mb-[2.5rem] mt-4">
                                    <img src="<?php echo e(Storage::url($note->content)); ?>" alt="<?php echo e($note->title); ?>" class="w-full h-auto blur-md">
                                </div>
                            <?php else: ?>
                                <?php $__currentLoopData = explode("\n", e(Str::limit($note->content, 200))); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $line): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <p class="mb-0"><?php echo e($line); ?></p>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <p class="mt-4">Content hidden for security reasons. This is a premium repository entry restricted to authorized members only.</p>
                            <?php endif; ?>
                        </div>
                        
                        <div class="absolute inset-0 flex items-center justify-center z-30">
                            <div class="bg-white/90 backdrop-blur-md p-10 rounded-[3rem] border border-slate-100 shadow-2xl text-center max-w-sm">
                                <div class="w-16 h-16 bg-amber-50 text-amber-600 rounded-2xl flex items-center justify-center mx-auto mb-6">
                                    <svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" /></svg>
                                </div>
                                <h3 class="text-2xl font-black text-slate-900 mb-1 font-outfit uppercase tracking-tighter">Premium Entry</h3>
                                <?php if($note->price): ?>
                                    <div class="text-2xl font-black text-indigo-600 font-outfit mb-4">
                                        TK <?php echo e(number_format($note->price, 2)); ?>

                                    </div>
                                <?php endif; ?>
                                <p class="text-slate-500 font-bold mb-6 text-sm italic">Unlock this specialized academic resource by purchasing it via WhatsApp.</p>
                                
                                <?php
                                    $message = "Hello Admin, I want to buy the premium note:\n"
                                             . "Title: " . $note->title . "\n"
                                             . "ID: #" . str_pad($note->id, 5, '0', STR_PAD_LEFT);
                                    if ($note->price) {
                                        $message .= "\nPrice: TK " . number_format($note->price, 2);
                                    }
                                    if (Auth::check()) {
                                        $message .= "\n\nMy Account Details:\n"
                                                 . "Name: " . Auth::user()->name . "\n"
                                                 . "Username: " . Auth::user()->username . "\n"
                                                 . "Email: " . Auth::user()->email;
                                    } else {
                                        $message .= "\n\n(Requested as Guest)";
                                    }
                                    $whatsappUrl = "https://wa.me/8801728431336?text=" . urlencode($message);
                                ?>
                                
                                <a href="<?php echo e($whatsappUrl); ?>" target="_blank" rel="noopener noreferrer" class="btn btn-success w-full flex items-center justify-center gap-2 py-3 px-4 rounded-xl text-white font-bold tracking-wider hover:bg-emerald-600 transition-colors shadow-lg">
                                    <svg class="w-5 h-5 fill-current" viewBox="0 0 24 24">
                                        <path d="M.057 24l1.687-6.163c-1.041-1.804-1.588-3.849-1.587-5.946C.06 5.348 5.397.01 12.008.01c3.202.001 6.212 1.246 8.477 3.514 2.266 2.268 3.507 5.28 3.505 8.484-.004 6.657-5.34 11.997-11.953 11.997-2.005-.001-3.973-.502-5.717-1.454L0 24zm6.59-4.846c1.6.95 3.197 1.451 4.803 1.456 5.46.003 9.903-4.439 9.907-9.897.002-2.643-1.027-5.127-2.9-7c-1.873-1.873-4.364-2.903-7.01-2.905-5.465 0-9.91 4.444-9.914 9.903-.002 1.83.487 3.62 1.417 5.187l-1.02 3.733 3.826-.978zm11.366-7.854c-.302-.15-1.786-.88-2.062-.98-.277-.1-.478-.15-.68.15-.201.3-.778.98-.953 1.18-.176.2-.352.225-.654.075-.302-.15-1.273-.469-2.427-1.498-.897-.8-1.502-1.789-1.678-2.09-.176-.3-.019-.462.13-.611.135-.134.302-.35.454-.526.15-.175.201-.3.302-.5.101-.2.05-.376-.025-.526-.075-.15-.68-1.64-.931-2.24-.247-.59-.499-.51-.68-.52-.176-.01-.378-.01-.579-.01-.201 0-.528.075-.805.375-.276.3-1.056 1.03-1.056 2.51 0 1.48 1.081 2.91 1.232 3.11.15.2 2.126 3.25 5.152 4.56.719.31 1.28.497 1.718.637.723.23 1.38.197 1.9.12.58-.087 1.787-.73 2.039-1.43.252-.7.252-1.3.176-1.43-.076-.13-.277-.205-.579-.355z"/>
                                    </svg>
                                    Buy via WhatsApp
                                </a>

                                <?php if(auth()->guard()->guest()): ?>
                                    <div class="mt-4 pt-4 border-t border-slate-100">
                                        <a href="<?php echo e(route('login')); ?>" class="text-xs text-indigo-600 hover:text-indigo-800 font-black uppercase tracking-widest transition-colors">Or Login to Request Access</a>
                                    </div>
                                <?php endif; ?>
                            </div>
                        </div>
                    </div>
                <?php endif; ?>
            </div>
        </div>

        <?php if(auth()->guard()->guest()): ?>
            <?php if($hasAccess): ?> 
                <div class="mt-24 p-12 bg-white rounded-[3rem] border border-slate-100 shadow-xl text-center">
                    <div class="w-20 h-20 bg-indigo-50 text-indigo-600 rounded-3xl flex items-center justify-center mx-auto mb-8">
                        <svg class="w-10 h-10" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" /></svg>
                    </div>
                    <h2 class="text-3xl font-bold text-slate-800 mb-4 font-outfit">Unlock Full Access</h2>
                    <p class="text-slate-500 text-lg font-medium mb-10 max-w-md mx-auto">Join StudyXnote to save your favorite resources and track your academic journey.</p>
                    <a href="<?php echo e(route('register')); ?>" class="btn btn-primary px-10 py-4 text-sm tracking-[0.2em]">
                        Create Free Account
                    </a>
                </div>
            <?php endif; ?>
        <?php endif; ?>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php /**PATH /Users/sajnush/Herd/StudyXnote/resources/views/notes/show.blade.php ENDPATH**/ ?>