@props(['item'])
@php
    $exists = Route::has($item['route']);
    $active = $exists && request()->routeIs($item['route'].'*');
@endphp

@if ($exists)
    <a
        href="{{ route($item['route']) }}"
        class="group relative flex items-center gap-3 rounded-xl px-3 py-2.5 text-sm transition-all duration-200
            {{ $active ? 'bg-gradient-to-r from-champagne/20 to-champagne/5 text-champagne-light font-semibold' : 'text-cream/65 hover:translate-x-0.5 hover:bg-white/5 hover:text-cream' }}"
    >
        @if ($active)
            <span class="absolute left-0 top-1/2 h-5 w-1 -translate-y-1/2 rounded-r-full bg-champagne-light"></span>
        @endif
        <i class="{{ $item['icon'] }} w-4 text-center transition-transform duration-200 group-hover:scale-110 {{ $active ? 'text-champagne-light' : 'text-cream/40' }}"></i>
        {{ $item['label'] }}
        @if (! empty($item['badge']))
            <span class="ml-auto rounded-full bg-danger/20 px-1.5 py-0.5 text-[0.65rem] font-semibold text-danger">{{ $item['badge'] }}</span>
        @endif
    </a>
@else
    <span
        title="Coming soon"
        class="flex cursor-not-allowed items-center gap-3 rounded-lg px-3 py-2 text-sm text-cream/25"
    >
        <i class="{{ $item['icon'] }} w-4 text-center text-cream/20"></i>
        {{ $item['label'] }}
        <span class="ml-auto rounded bg-white/5 px-1.5 py-0.5 text-[0.6rem] uppercase tracking-wide text-cream/30">Soon</span>
    </span>
@endif
