/* Instructor review workspace (/instructor/*) — InstructorLayout, WritingReviewQueuePage and
   WritingReviewScorePage.
   Added: 2026-10-22 by Niloy (in admin-panel.css). Moved here on 2026-10-22 so instructor-only
   styles no longer live in the shared admin shell file.

   Load order matters: App.razor links this AFTER admin-panel.css, because the instructor pages sit
   inside the same .ap-admin-* shell and a few rules here deliberately refine shell rules
   (.ap-instructor-actions over .ap-admin-actions, the two-column topbar over .ap-admin-topbar).
   Every selector is .ap-instructor-* / .instructor-* prefixed, so the file has no effect on other pages. */

/* ── Layout chrome ─────────────────────────────────────────────────────────── */

/* The admin topbar is a 3-column grid (title | centred tabs | actions). The instructor area has no
   top tabs, so it uses two columns rather than an empty placeholder <div> in the middle slot. The
   ≤900px rule in admin-panel.css (.ap-admin-topbar → one column) is matched by the media block at
   the bottom of this file, since this file loads later and would otherwise win at that width. */
.ap-admin-topbar.ap-instructor-topbar {
    grid-template-columns: minmax(170px, 1fr) auto;
}

.ap-instructor-actions {
    gap: 12px;
}

.ap-instructor-role {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid #cfe9f9;
    border-radius: 999px;
    background: #ffffff;
    color: #0369a1;
    font-size: 12px;
    font-weight: 700;
}

/* ── Review queue (WritingReviewQueuePage) ─────────────────────────────────── */

.instructor-queue-rule {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 285px;
    padding: 10px 12px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #f8fbff;
    color: #52627a;
    font-size: 13px;
    line-height: 1.4;
}

.instructor-queue-rule i {
    color: #0284c7;
}

.instructor-queue-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0 0 22px;
}

.instructor-queue-stat {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 12px;
    min-height: 138px;
    padding: 19px 20px;
    overflow: hidden;
    border: 1px solid var(--ap-border);
    border-radius: var(--ap-radius);
    background: #ffffff;
    box-shadow: var(--ap-shadow);
}

.instructor-queue-stat::after {
    position: absolute;
    top: -34px;
    right: -26px;
    width: 104px;
    height: 104px;
    border-radius: 999px;
    background: #f0f9ff;
    content: "";
}

.instructor-queue-stat-icon {
    z-index: 1;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: #e0f2fe;
    color: #0284c7;
}

.instructor-queue-stat-icon.is-waiting { background: #eef2ff; color: #4f46e5; }

.instructor-queue-stat-label {
    align-self: center;
    color: var(--ap-muted);
    font-size: 12px;
    font-weight: 600;
}

.instructor-queue-stat strong {
    z-index: 1;
    grid-column: 1 / -1;
    margin-top: 13px;
    color: var(--ap-text);
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
}

/* Previously split across two rules (one shared with the label); merged into one. */
.instructor-queue-stat small {
    z-index: 1;
    grid-column: 1 / -1;
    margin-top: 7px;
    color: var(--ap-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.instructor-section-kicker {
    margin: 0 0 6px;
    color: #0284c7;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ── Scoring workspace (WritingReviewScorePage) ────────────────────────────── */

/* Top-aligns the scoring page header (title can wrap onto several lines next to the Queue button).
   Needs to beat `.ap-admin-content .shad-page-header` (align-items: center, and stretch ≤640px) in
   admin-panel.css; the extra class gives it higher specificity, replacing the old !important. */
.ap-admin-content .shad-page-header.instructor-review-hero {
    align-items: flex-start;
}

.instructor-review-hero__student,
.instructor-review-hero__module {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-right: 10px;
    font-weight: 600;
}

.instructor-review-hero__student {
    color: #475467;
}

.instructor-review-hero__student i {
    color: #0284c7;
}

.instructor-review-hero__module {
    color: #0369a1;
}

.instructor-review-hero__module::before {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: #98a2b3;
    content: "";
}

.instructor-review-hero__back {
    flex: 0 0 auto;
}

.instructor-review-hero__back i {
    margin-right: 8px;
}

.instructor-score-task {
    margin-bottom: 18px;
    overflow: hidden;
}

.instructor-score-task__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--ap-border);
    background: #fbfdff;
}

.instructor-score-task__eyebrow,
.instructor-score-section-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #0284c7;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.instructor-score-task__header h2 {
    margin: 6px 0 0;
    color: var(--ap-text);
    font-size: 22px;
    font-weight: 700;
}

.instructor-score-task__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.instructor-score-task__meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #f0f9ff;
    color: #0369a1;
    font-size: 12px;
    font-weight: 700;
}

.instructor-score-task__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.46fr);
    gap: 0;
}

.instructor-score-task__submission {
    min-width: 0;
    padding: 24px;
    border-right: 1px solid var(--ap-border);
}

.instructor-score-prompt {
    padding: 15px 16px;
    border-left: 3px solid #38bdf8;
    border-radius: 0 12px 12px 0;
    background: #f8fbff;
}

.instructor-score-prompt .review-content {
    margin: 11px 0 0;
    color: #1e3a5f;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.65;
}

.instructor-score-essay {
    margin-top: 20px;
}

.instructor-score-essay__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.instructor-score-word-count {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 0 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475467;
    font-size: 12px;
    font-weight: 700;
}

.instructor-score-word-count.is-low {
    background: #fff1f2;
    color: #be123c;
}

.instructor-score-essay__content {
    min-height: 200px;
    max-height: 550px;
    overflow: auto;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fbfcfe;
    color: #243b5a;
    font-size: 15px;
    line-height: 1.75;
    white-space: pre-wrap;
}

.instructor-score-essay__content.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    color: #98a2b3;
    font-style: italic;
}

.instructor-score-panel {
    align-self: start;
    min-width: 0;
    padding: 24px;
    background: #ffffff;
}

.instructor-score-panel__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.instructor-score-panel__heading h3 {
    margin: 6px 0 0;
    color: var(--ap-text);
    font-size: 18px;
    font-weight: 700;
}

.instructor-score-panel__band {
    min-width: 74px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #effcf6;
    color: #047857;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.instructor-score-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.instructor-score-field {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 11px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fbfdff;
}

.instructor-score-field > span {
    min-height: 30px;
    color: #475467;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.instructor-score-field .shad-input {
    min-height: 42px;
    padding-inline: 10px;
    border-color: #dbe5ef;
    background: #ffffff;
    color: #0369a1;
    font-size: 18px;
    font-weight: 750;
}

.instructor-score-field.is-readonly strong {
    color: #0369a1;
    font-size: 21px;
}

.instructor-score-feedback {
    margin-top: 18px;
}

.instructor-score-feedback > label {
    display: block;
    margin-bottom: 8px;
    color: #344054;
    font-size: 13px;
    font-weight: 750;
}

.instructor-score-feedback > label span {
    color: #98a2b3;
    font-weight: 600;
}

.instructor-score-feedback .shad-textarea {
    min-height: 128px;
    resize: vertical;
}

.instructor-score-feedback p {
    margin: 0;
    color: #475467;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-line;
}

.instructor-overall-feedback {
    overflow: hidden;
    margin-top: 18px;
}

.instructor-overall-feedback__header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--ap-border);
    background: #fbfdff;
}

.instructor-overall-feedback__icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #e0f2fe;
    color: #0284c7;
}

.instructor-overall-feedback__header h2 {
    margin: 0;
    color: var(--ap-text);
    font-size: 18px;
    font-weight: 700;
}

.instructor-overall-feedback__header p {
    margin: 5px 0 0;
    color: var(--ap-muted);
    font-size: 14px;
    line-height: 1.45;
}

.instructor-overall-feedback__body {
    padding: 20px 24px;
}

.instructor-overall-feedback__body .shad-textarea {
    min-height: 124px;
    resize: vertical;
}

/* Sticky submit bar — stays in view at the bottom of the viewport while the instructor scrolls
   through long essays, so "Submit and release" never needs a scroll back down. */
.instructor-review-action-bar {
    position: sticky;
    bottom: 18px;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding: 13px 14px 13px 18px;
    border: 1px solid #dbe5ef;
    border-radius: 16px;
    background: rgb(255 255 255 / 0.94);
    box-shadow: 0 18px 46px rgb(15 23 42 / 0.16);
    backdrop-filter: blur(16px);
}

.instructor-review-action-bar__note {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #475467;
    font-size: 13px;
    font-weight: 600;
}

.instructor-review-action-bar__note i { color: #0284c7; }

.instructor-review-action-bar__actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.instructor-review-action-bar__actions .fa-paper-plane { margin-right: 7px; }

/* ── Responsive (breakpoints mirror admin-panel.css) ───────────────────────── */

@media (max-width: 900px) {
    /* Same single-column stack admin-panel.css gives .ap-admin-topbar at this width. */
    .ap-admin-topbar.ap-instructor-topbar {
        grid-template-columns: 1fr;
    }

    .instructor-queue-summary {
        grid-template-columns: 1fr;
    }

    .instructor-queue-rule {
        max-width: none;
    }

    .instructor-score-task__body {
        grid-template-columns: 1fr;
    }

    .instructor-score-task__submission {
        border-right: 0;
        border-bottom: 1px solid var(--ap-border);
    }
}

@media (max-width: 640px) {
    .ap-instructor-role {
        display: none;
    }

    .instructor-review-hero__module::before {
        display: none;
    }

    .instructor-score-task__header,
    .instructor-score-essay__title,
    .instructor-review-action-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .instructor-score-task__meta {
        justify-content: flex-start;
    }

    .instructor-score-task__submission,
    .instructor-score-panel,
    .instructor-overall-feedback__body {
        padding: 18px;
    }

    .instructor-score-task__header,
    .instructor-overall-feedback__header {
        padding: 18px;
    }

    .instructor-score-fields {
        grid-template-columns: 1fr;
    }

    .instructor-review-action-bar__actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }

    .instructor-review-action-bar__actions .shad-btn {
        width: 100%;
    }
}
