{% macro series_card(series, in_watchlist=False, lang='vf') %}
<div class="ac" id="series-{{ series.url | hash }}">
    <div class="ac-poster">
        <img src="{{ series.cover_image or 'https://placehold.co/400x600/161625/ff6b6b?text=No+Image' }}"
             alt="{{ series.title }}" loading="lazy" referrerpolicy="no-referrer"
             onerror="this.src='https://placehold.co/400x600/161625/ff6b6b?text=Error'; this.onerror=null;">
        <button class="ac-play"
                hx-get="/api/anime/episodes?url={{ series.url | urlencode }}&lang={{ lang }}"
                hx-target="#player-container" hx-swap="innerHTML">
            <i class="fas fa-play"></i>
        </button>
    </div>
    <div class="ac-info">
        <span class="ac-provider" style="--ac-color: var(--secondary)">{{ series.provider_id | upper if series.provider_id else 'FS7' }}</span>
        <h3 class="ac-title" title="{{ series.title }}">{{ series.title }}</h3>
    </div>
</div>
{% endmacro %}
