/* Forovanta Community Software — Bug reports add-on
 * Copyright (c) 2026 Forovanta Software Co. <sales@zovanta.dev>
 * Licensed under the Forovanta Commercial License Agreement.
 */

.issue-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    padding: 1rem;
}

/*
 * The list's own header: the title, and the button that files a report.
 *
 * The button was missing from this page entirely while the form it opens existed, so the one
 * action a member comes here for had no way in. It sits beside the heading, on the same line on
 * a wide screen and above it on a narrow one.
 */
.issue-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.issue-head h2 {
    margin: 0;
}

.issue-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.issue-list li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 0.85rem 0;
    border-top: 1px solid var(--border);
}

.issue-list li:first-child {
    border-top: none;
    padding-top: 0;
}

.issue-list li:last-child {
    padding-bottom: 0;
}

.issue-number {
    flex: 0 0 70px;
    font-weight: 600;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.issue-body {
    flex: 1 1 auto;
    min-width: 0;
}

/*
 * A row that opens in place.
 *
 * The title is the bold, clickable heading the list is read by, and the arrow on the right
 * opens the whole report — the same fields the thread draws — so a reader can see what a bug
 * says without leaving the list. A native `<details>` element, so nothing here needs a script.
 */
.issue-details {
    min-width: 0;
}

.issue-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    list-style: none;
}

.issue-summary::-webkit-details-marker {
    display: none;
}

.issue-summary-right {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    flex: none;
}

.issue-caret {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1;
    transition: transform 0.15s ease;
}

.issue-details[open] .issue-caret {
    transform: rotate(180deg);
}

.issue-expand {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
}

.issue-title {
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
    color: var(--text);
    text-decoration: none;
}

.issue-title:hover {
    color: var(--accent);
    text-decoration: underline;
}


.issue-excerpt {
    color: var(--muted);
    margin: 0 0 0.4rem;
    font-size: 0.9rem;
}

/*
 * The report's own facts, as a two-column definition list.
 *
 * It used to be a **flex row**, which drew a `dt` and its `dd` as two independent items on one
 * wrapping line: the label and its answer sat the same distance apart as two unrelated pairs, so
 * `Affected: Software · Forovanta` read as four facts in a row (and on the thread head the same
 * shape pulled `BUG-` away from its number). A grid — label column, value column — is what makes
 * a definition list read as one, and it holds for a long value as well as a short one.
 */
.issue-meta,
.issue-thread-meta {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.15rem 0.75rem;
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: var(--muted);
    text-align: left;
}

.issue-meta dt,
.issue-thread-meta dt {
    font-weight: 600;
    color: var(--muted);
}

.issue-meta dd,
.issue-thread-meta dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.issue-thread-meta dd.issue-number-value {
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.issue-status {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent-soft-fg);
}

.issue-status--open { background: color-mix(in srgb, var(--muted) 22%, transparent); color: var(--muted); }
.issue-status--confirmed { background: color-mix(in srgb, #f59e0b 18%, transparent); color: #fcd34d; }
.issue-status--in-progress { background: color-mix(in srgb, #2563eb 18%, transparent); color: #93c5fd; }
.issue-status--fixed { background: color-mix(in srgb, #16a34a 18%, transparent); color: #86efac; }
.issue-status--cannot-reproduce { background: color-mix(in srgb, #7c3aed 18%, transparent); color: #c4b5fd; }

.issue-thread-link {
    margin-top: 0.4rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.issue-thread-link a {
    color: var(--accent);
}

.issue-form dl {
    margin: 0 0 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem 1.5rem;
}

.issue-form dt {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.issue-form dd {
    margin: 0;
}

.issue-form textarea,
.issue-form input[type=text],
.issue-form input[type=file] {
    width: 100%;
    font-family: inherit;
    font-size: 0.9rem;
}

.issue-form textarea {
    min-height: 5rem;
    resize: vertical;
}

.issue-form textarea[data-issue=logs] {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
}

.issue-form .issue-field {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-1);
}

.issue-form .issue-required::after {
    content: " *";
    color: #ef4444;
}

.issue-screenshots-list {
    list-style: none;
    margin: 0 0 0.5rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
}

.issue-screenshot {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-1);
    border: 1px solid var(--border);
}

.issue-screenshot img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.issue-screenshot-caption {
    font-size: 0.75rem;
    color: var(--muted);
    padding: 0.3rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.issue-screenshot-caption a {
    color: var(--accent);
    text-decoration: none;
}

.issue-empty {
    padding: 2rem 0;
    text-align: center;
    color: var(--muted);
}

.issue-thread {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    overflow: hidden;
}

.issue-thread-head {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.issue-thread-title {
    font-weight: 600;
    margin: 0;
}

.issue-thread-body {
    padding: 1rem;
}

.issue-mark {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent-soft-fg);
}

.issue-admin-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

/* The title and the report's facts take the room; the status mark keeps its own corner. */
.issue-admin-ident {
    min-width: 0;
    flex: 1 1 auto;
}

.issue-admin-head-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    flex: none;
}

.issue-admin-status-select {
    max-width: 220px;
}

/*
 * What the screen says about itself, under the head rather than inside it.
 *
 * It used to be a 280px-wide italic column beside the status mark, which on a narrow window
 * squeezed it to a couple of words a line and pushed the mark out of the panel. It is a sentence
 * about the whole report, so it is drawn as one, full width, where there is room to read it.
 */
.issue-admin-note {
    margin: 0;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--muted);
}

/*
 * The delete control keeps its own corner of the head, away from the status mark.
 *
 * Its colour is the board's own — the button carries the core `danger` class the rest of the
 * admin uses for the same kind of action, rather than a second red defined down here.
 */
.issue-admin-head-actions form {
    margin: 0;
}

.issue-admin-body {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1rem;
    padding: 1rem;
}

.issue-admin-thread {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-1);
    overflow: hidden;
}

.issue-admin-thread h3 {
    margin: 0;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--muted);
}

.issue-admin-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.issue-admin-attachments {
    list-style: none;
    margin: 0;
    padding: 0;
}

.issue-admin-attachment {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--text);
}

.issue-admin-attachment:hover {
    border-color: var(--accent);
}

.issue-admin-attachment-filename {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.issue-license-notice {
    border-left: 3px solid var(--accent);
    padding: 0.75rem 1rem;
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
