<div class="section-container">
    <div class="section-header">
        <h2>📋 Ma Watchlist</h2>
        <div class="header-actions">
            <button class="btn btn-sm btn-primary" hx-post="/api/watchlist/check" hx-swap="none">
                <i class="fas fa-sync"></i> Vérifier épisodes
            </button>
            <button class="btn btn-sm btn-secondary" 
                    hx-get="/api/watchlist" 
                    hx-target="#watchlist-items-container">
                <i class="fas fa-redo"></i> Actualiser
            </button>
        </div>
    </div>

    <!-- Watchlist items container loaded via HTMX on page load or manual refresh -->
    <div id="watchlist-items-container" 
         hx-get="/api/watchlist" 
         hx-trigger="load" 
         class="watchlist-content">
        <div class="loading-placeholder">
            <div class="spinner"></div> Chargement de votre watchlist...
        </div>
    </div>
</div>

<style>
.watchlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.watchlist-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s;
}
.watchlist-item:hover { transform: translateY(-3px); border-color: #00d9ff; }
.item-poster img { width: 80px; height: 120px; border-radius: 8px; object-fit: cover; }
.item-info { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.item-info h3 { font-size: 1rem; margin-bottom: 5px; color: #fff; }
.item-meta { display: flex; gap: 8px; margin-bottom: 8px; }
.item-actions { display: flex; gap: 10px; margin-top: 10px; }
</style>
