@php
    $contentType = $type ?? ($x->content_type ?? 'movie');
    $slug = $x->slug;
    $url = $contentType === 'movie' ? route('movie', $slug) : route('show', $slug);
    $contentDate = $x->content_date ?? ($contentType === 'movie' ? ($x->release_date ?? null) : ($x->first_air_date ?? null));
    $year = $contentDate ? \Illuminate\Support\Carbon::parse($contentDate)->format('Y') : null;
@endphp
<a class="card cinema-card" href="{{ $url }}">
    <div class="poster">
        <img loading="lazy" src="{{ app(\App\Services\MediaStorageService::class)->url($x->poster_path) ?: 'https://placehold.co/500x750?text=No+Poster' }}" alt="{{ $x->title }}">
        <span class="trend-ribbon">{{ $x->is_featured ? 'TRENDING' : 'NEW' }}</span>
        @if($x->quality_badge ?? false)<span class="quality-badge">{{ $x->quality_badge }}</span>@endif
    </div>
    <div class="card-body">
        <h3>{{ $x->title }} @if($year)({{ $year }})@endif</h3>
        <small>⭐ {{ $x->vote_average ?: 'N/A' }} · {{ $contentType === 'movie' ? 'MOVIE' : 'TV SHOW' }}</small>
    </div>
</a>
