@model IReadOnlyList<WriterDashboardScene>

@if (!Model.Any())
{
    <p class="muted">Scenes appear here based on Revision Status. Use Outlined for Write Next, Drafted for Continue Writing, Needs Work for Revision, and Revised for Polishing.</p>
}
else
{
    <div class="writer-queue-list">
        @foreach (var scene in Model)
        {
            <article class="writer-queue-card">
                <div class="writer-queue-title">
                    <div>
                        <span class="eyebrow">@scene.BookDisplayTitle / Chapter @scene.ChapterNumber</span>
                        <h3>
                            <a asp-controller="Scenes" asp-action="Edit" asp-route-id="@scene.SceneID">
                                Scene @scene.SceneNumber: @scene.SceneTitle
                            </a>
                        </h3>
                    </div>
                    <span class="status-pill">@scene.RevisionStatusName</span>
                </div>
                @if (!string.IsNullOrWhiteSpace(scene.Summary))
                {
                    <p>@scene.Summary</p>
                }
                <div class="story-bible-meta">
                    @if (scene.Priority.HasValue) { <span>Priority @scene.Priority</span> }
                    <span>@scene.WarningCount warnings</span>
                    <span>@scene.RemainingChecklistCount checklist remaining</span>
                    <span>@scene.UnresolvedNoteCount open notes</span>
                    @if (scene.IsBlocked) { <span>Blocked</span> }
                </div>
                @if (!string.IsNullOrWhiteSpace(scene.ImportantThreads))
                {
                    <p class="muted"><strong>Important:</strong> @scene.ImportantThreads</p>
                }
                @if (!string.IsNullOrWhiteSpace(scene.PinnedNotes))
                {
                    <p class="muted"><strong>Notes:</strong> @scene.PinnedNotes</p>
                }
                @if (!string.IsNullOrWhiteSpace(scene.BlockedReason))
                {
                    <p class="muted"><strong>Blocked:</strong> @scene.BlockedReason</p>
                }
                <div class="story-bible-actions">
                    <a asp-controller="Scenes" asp-action="Edit" asp-route-id="@scene.SceneID">Open scene</a>
                    <a asp-controller="Exports" asp-action="WritingSession" asp-route-sceneId="@scene.SceneID">Session brief</a>
                    <a asp-controller="Timeline" asp-action="Index" asp-route-projectId="@scene.ProjectID" asp-route-bookId="@scene.BookID" asp-route-selectedSceneId="@scene.SceneID">Timeline</a>
                    <a asp-controller="Warnings" asp-action="Index" asp-route-projectId="@scene.ProjectID" asp-route-bookId="@scene.BookID" asp-route-sceneId="@scene.SceneID">Warnings</a>
                </div>
            </article>
        }
    </div>
}
