<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;

$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames((['note']));

foreach ($attributes->all() as $__key => $__value) {
    if (in_array($__key, $__propNames)) {
        $$__key = $$__key ?? $__value;
    } else {
        $__newAttributes[$__key] = $__value;
    }
}

$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);

unset($__propNames);
unset($__newAttributes);

foreach (array_filter((['note']), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
    $$__key = $$__key ?? $__value;
}

$__defined_vars = get_defined_vars();

foreach ($attributes->all() as $__key => $__value) {
    if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}

unset($__defined_vars, $__key, $__value); ?>

<?php
    $hasAccess = ! $note->is_paid || (Auth::check() && Auth::user()->hasAccessToNote($note));
?>

<div class="note-card-pro group">
    <div class="absolute top-0 right-0 w-32 h-32 bg-indigo-50/50 rounded-full -mr-16 -mt-16 blur-2xl group-hover:bg-indigo-100 transition-colors duration-500"></div>

    <div class="mb-6 flex items-center justify-between relative z-10">
        <div class="flex items-center gap-2">
            <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; ?>
        </div>
        <div class="flex items-center gap-1.5 text-[10px] font-bold text-slate-300">
            <span class="w-2 h-2 bg-indigo-200 rounded-full <?php if($note->created_at->gt(now()->subDays(2))): ?> animate-pulse <?php endif; ?>"></span>
            <?php echo e($note->created_at->format('M Y')); ?>

        </div>
    </div>

    <h3 class="text-2xl font-black text-slate-800 mb-4 group-hover:text-indigo-600 transition-colors duration-300 leading-tight font-outfit relative z-10 line-clamp-2 min-h-[3.5rem]">
        <?php echo e($note->title); ?>

    </h3>

    <div class="flex-grow mb-8 overflow-hidden relative z-10 flex flex-col">
        <?php if($note->type === 'image'): ?>
            <div class="relative w-full rounded-2xl overflow-hidden shadow-inner bg-slate-100 flex-grow min-h-[200px]">
                <img src="<?php echo e(Storage::url($note->content)); ?>" alt="<?php echo e($note->title); ?>" class="w-full h-full object-cover group-hover:scale-110 transition-transform duration-1000 <?php echo e(!$hasAccess ? 'blur-md select-none' : ''); ?>">
                <div class="absolute inset-0 bg-gradient-to-t from-slate-900/40 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"></div>
                <?php if(!$hasAccess): ?>
                    <div class="absolute inset-0 flex items-center justify-center bg-slate-900/20">
                        <svg class="w-8 h-8 text-white drop-shadow-lg" 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>
                <?php endif; ?>
            </div>
        <?php else: ?>
            <div class="bg-slate-50/50 p-6 rounded-2xl border border-slate-100 group-hover:bg-white transition-colors duration-500 flex-grow">
                <p class="text-slate-500 leading-relaxed font-medium line-clamp-4 italic font-caveat text-2xl">
                    "<?php echo e(Str::limit(strip_tags($note->content), 150)); ?>"
                </p>
            </div>
        <?php endif; ?>
    </div>

    <div class="flex items-center justify-between mt-auto pt-6 border-t border-slate-50 relative z-10">
        <div class="flex items-center gap-4">
            <div class="flex items-center gap-1.5 text-[10px] font-bold text-slate-400">
                <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" /></svg>
                <?php echo e(number_format($note->view_count)); ?>

            </div>
        </div>
        <a href="<?php echo e(route('notes.show', $note)); ?>" class="inline-flex items-center gap-2 text-xs font-black uppercase tracking-[0.2em] text-slate-900 hover:text-indigo-600 transition-all group/btn">
            View Entry
            <svg class="w-4 h-4 transform group-hover/btn: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="M17 8l4 4m0 0l-4 4m4-4H3" /></svg>
        </a>
    </div>
</div>
<?php /**PATH /Users/sajnush/Herd/StudyXnote/resources/views/components/note-card.blade.php ENDPATH**/ ?>