/* In-browser exercise runner (static/submit.js) and account pages. */

.nav-account {
    float: right;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}
.nav-user { color: #57606a; }
.nav-logout { display: inline; margin: 0; }
.nav-logout button {
    background: none;
    border: none;
    padding: 0;
    color: #0366d6;
    font: inherit;
    font-weight: bold;
    cursor: pointer;
}

.flash {
    background: #fff8c5;
    border: 1px solid #d4a72c;
    border-radius: 6px;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
}

.auth-card { max-width: 24rem; margin: 0 auto; }
.auth-card form { display: grid; gap: 0.9rem; margin: 1.25rem 0; }
.auth-card label { display: grid; gap: 0.25rem; font-weight: 600; }
.auth-card input {
    font: inherit;
    padding: 0.45rem 0.6rem;
    border: 1px solid #d1d5da;
    border-radius: 6px;
}
.auth-card button,
.runner-open,
.runner-mode {
    font: inherit;
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #1b7f37;
    background: #1f883d;
    color: #fff;
    cursor: pointer;
}
.auth-card button:hover,
.runner-open:hover,
.runner-mode:hover:not(:disabled) { background: #1a7f37; }
.auth-note { color: #57606a; font-size: 0.9em; }

.exercise-runner { margin-top: 20px; }
.runner-loading, .runner-error { color: #57606a; }
.runner-error { color: #cf222e; }

.runner {
    border: 1px solid #c8e1ff;
    border-radius: 6px;
    background: #fff;
    padding: 12px;
}
.runner-filename {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: #57606a;
    margin-bottom: 6px;
}
.runner-editor {
    height: 26rem;
    border: 1px solid #d1d5da;
    border-radius: 4px;
    overflow: hidden;
}
.runner-editor-plain { height: auto; }
.runner-textarea {
    display: block;
    width: 100%;
    min-height: 26rem;
    box-sizing: border-box;
    border: none;
    padding: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    tab-size: 4;
    resize: vertical;
}

.runner-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}
.runner-gpu-label { font-size: 14px; font-weight: 600; }
.runner-gpu { font: inherit; font-size: 14px; padding: 4px 6px; }
.runner-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.runner-mode:disabled { opacity: 0.5; cursor: not-allowed; }
.runner-mode-test { font-weight: 600; }
.runner-reset,
.runner-cancel {
    font: inherit;
    font-size: 13px;
    padding: 5px 10px;
    margin-left: auto;
    border-radius: 6px;
    border: 1px solid #d1d5da;
    background: #f6f8fa;
    color: #24292e;
    cursor: pointer;
}
.runner-cancel { margin-left: 0; }
.runner-gpu-note { display: block; margin-top: 6px; font-size: 13px; color: #9a6700; }
.runner-gpu-note:empty { display: none; }
.runner-login { margin: 10px 0 0; }

.runner-result:empty { display: none; }
.runner-result { margin-top: 14px; border-top: 1px solid #e1e4e8; padding-top: 12px; }
.runner-result-header { display: flex; align-items: center; gap: 10px; }
.runner-result-meta { color: #57606a; font-size: 14px; }
.runner-progress { color: #57606a; margin: 8px 0; }
.runner-summary { margin: 8px 0; font-weight: 600; }
.runner-detail {
    white-space: pre-wrap;
    color: #cf222e;
    background: #ffebe9;
    border-radius: 6px;
    padding: 8px 10px;
}

.run-status {
    display: inline-block;
    padding: 1px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}
.run-status-submitting, .run-status-queued, .run-status-running {
    background: #ddf4ff; color: #0969da; border-color: #b6e3ff;
}
.run-status-passed { background: #dafbe1; color: #1a7f37; border-color: #aceebb; }
.run-status-failed { background: #ffebe9; color: #cf222e; border-color: #ffcecb; }
.run-status-error { background: #fff8c5; color: #9a6700; border-color: #eac54f; }

.runner-runs { border-collapse: collapse; font-size: 14px; margin: 8px 0; }
.runner-runs th, .runner-runs td { text-align: left; padding: 3px 14px 3px 0; }
.runner-runs th { color: #57606a; font-weight: 600; }
.runner-run-passed td:nth-child(2) { color: #1a7f37; }
.runner-run-failed td:nth-child(2),
.runner-run-error td:nth-child(2),
.runner-run-timeout td:nth-child(2) { color: #cf222e; }

.runner-output summary, .runner-history summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.runner-output pre {
    background: #0d1117;
    color: #e6edf3;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    line-height: 1.45;
    max-height: 32rem;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
.ansi-bold { font-weight: 700; }
.ansi-dim { opacity: 0.7; }
.ansi-red { color: #ff7b72; }
.ansi-green { color: #3fb950; }
.ansi-yellow { color: #d29922; }
.ansi-blue { color: #79c0ff; }
.ansi-magenta { color: #d2a8ff; }
.ansi-cyan { color: #56d4dd; }
.ansi-grey { color: #8b949e; }

.runner-history { margin-top: 12px; }
.runner-history ul { list-style: none; padding: 0; margin: 6px 0 0; }
.runner-history-item {
    background: none;
    border: none;
    padding: 3px 0;
    font: inherit;
    font-size: 14px;
    color: #24292e;
    cursor: pointer;
    text-align: left;
}
.runner-history-item:hover { text-decoration: underline; }

@media (max-width: 40rem) {
    .runner-editor, .runner-textarea { height: 18rem; min-height: 18rem; }
    .runner-reset { margin-left: 0; }
    .nav-account { float: none; display: flex; margin-top: 0.5rem; }
}
