@model WriterDashboardViewModel
@{
    ViewData["Title"] = "Writer Workspace";
}

<div class="page-heading writer-dashboard-heading">
    <div>
        <p class="eyebrow">Today view</p>
        <h1>Writer Workspace <help-icon key="workspace.overview" /></h1>
        <p class="lead-text">A practical control room for drafting, revision, polish, and story readiness.</p>
    </div>
    <form asp-action="Index" method="get" class="story-bible-search">
        <select class="form-select" name="projectId" asp-items="Model.ProjectOptions">
            <option value="">All projects</option>
        </select>
        <button class="btn btn-primary" type="submit">Focus</button>
    </form>
</div>

<div class="writer-dashboard-grid">
    <section class="writer-dashboard-panel">
        <div class="story-bible-section-heading">
            <div>
                <p class="eyebrow">Write Next</p>
                <h2>Continue Writing <help-icon key="workspace.writeNext" /></h2>
            </div>
            <span class="soft-count">@Model.ContinueWriting.Count scenes</span>
        </div>
        <partial name="_WriterSceneQueue" model="Model.ContinueWriting" />
    </section>

    <section class="writer-dashboard-panel">
        <div class="story-bible-section-heading">
            <div>
                <p class="eyebrow">Practical blockers</p>
                <h2>Needs Attention <help-icon key="workspace.practicalBlockers" /></h2>
            </div>
            <span class="soft-count">@Model.NeedsAttention.Count scenes</span>
        </div>
        <partial name="_WriterSceneQueue" model="Model.NeedsAttention" />
    </section>

    <section class="writer-dashboard-panel">
        <div class="story-bible-section-heading">
            <div>
                <p class="eyebrow">Revision</p>
                <h2>Revision Queue <help-icon key="workspace.revisionQueue" /></h2>
            </div>
            <span class="soft-count">@Model.RevisionQueue.Count scenes</span>
        </div>
        <partial name="_WriterSceneQueue" model="Model.RevisionQueue" />
    </section>

    <section class="writer-dashboard-panel">
        <div class="story-bible-section-heading">
            <div>
                <p class="eyebrow">Final pass</p>
                <h2>Polishing Queue <help-icon key="workspace.polishingQueue" /></h2>
            </div>
            <span class="soft-count">@Model.PolishingQueue.Count scenes</span>
        </div>
        <partial name="_WriterSceneQueue" model="Model.PolishingQueue" />
    </section>
</div>

<section class="story-bible-section">
    <div class="story-bible-section-heading">
        <div>
            <p class="eyebrow">Story health</p>
            <h2>Reminders <help-icon key="workspace.reminders" /></h2>
        </div>
        <span class="soft-count">@Model.StoryHealthReminders.Count items</span>
    </div>
    <div class="attention-list">
        @foreach (var reminder in Model.StoryHealthReminders)
        {
            <article>
                <span class="badge text-bg-light">@reminder.Category</span>
                <strong>@reminder.Title</strong>
                @if (!string.IsNullOrWhiteSpace(reminder.Detail))
                {
                    <p>@reminder.Detail</p>
                }
                @if (reminder.SceneID.HasValue)
                {
                    <a asp-controller="Scenes" asp-action="Edit" asp-route-id="@reminder.SceneID">Open scene</a>
                }
            </article>
        }
    </div>
</section>
