/*
 * Task quick-view / log inspector dialog (static/tasklog.js).
 * Uses the same :root tokens as koji.css/dash.css, with inline
 * fallbacks so this file degrades gracefully on its own.
 */

.tasklog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.tasklog-overlay.open {
  display: flex;
}

html.tasklog-lock,
html.tasklog-lock body {
  overflow: hidden;
}

.tasklog-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.tasklog-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1100px, 92vw);
  max-height: min(80vh, 900px);
  background: var(--bg-card, #ffffff);
  color: var(--text, #0f172a);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 10px);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  font-size: 13px;
}

.tasklog-dialog:focus {
  outline: none;
}

.tasklog-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.tasklog-header-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.tasklog-title {
  margin: 0;
  font-size: 1.05em;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tasklog-id {
  color: var(--text-muted, #64748b);
  font-size: 0.9em;
  flex: 0 0 auto;
}

.tasklog-live-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok, #16a34a);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok, #16a34a) 25%, transparent);
  animation: tasklog-pulse 1.4s ease-in-out infinite;
}

@keyframes tasklog-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.tasklog-close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-sm, 6px);
}

.tasklog-close:hover {
  background: var(--bg, #f5f7fb);
  color: var(--text, #0f172a);
}

.tasklog-breadcrumb {
  flex: 0 0 auto;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--bg, #f5f7fb);
}

.tasklog-back {
  border: none;
  background: transparent;
  color: var(--accent, #2563eb);
  font-size: 0.9em;
  cursor: pointer;
  padding: 0;
}

.tasklog-back:hover {
  text-decoration: underline;
}

.tasklog-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 14px;
  padding: 14px 18px;
  overflow: hidden;
}

.tasklog-section-title {
  font-weight: 600;
  font-size: 0.88em;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.tasklog-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px 16px;
  flex: 0 0 auto;
}

.tasklog-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px dashed var(--border, #e5e7eb);
  font-size: 0.92em;
}

.tasklog-meta-label {
  color: var(--text-muted, #64748b);
}

.tasklog-meta-value {
  font-weight: 500;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

.tasklog-note {
  font-size: 0.85em;
  color: var(--warn, #d97706);
  margin-bottom: 6px;
}

.tasklog-children-list {
  flex: 0 1 auto;
  max-height: 130px;
  overflow-y: auto;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm, 6px);
}

.tasklog-child-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  cursor: pointer;
  font-size: 0.9em;
}

.tasklog-child-row:last-child {
  border-bottom: none;
}

.tasklog-child-row:hover,
.tasklog-child-row:focus {
  background: var(--bg, #f5f7fb);
  outline: none;
}

.tasklog-child-id {
  color: var(--text-muted, #64748b);
  flex: 0 0 auto;
}

.tasklog-child-label {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tasklog-empty {
  padding: 8px 10px;
  color: var(--text-muted, #64748b);
  font-size: 0.85em;
}

.tasklog-logsection {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tasklog-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-bottom: 8px;
}

.tasklog-control {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85em;
}

.tasklog-control-label {
  color: var(--text-muted, #64748b);
}

.tasklog-control select {
  padding: 4px 6px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-card, #ffffff);
  color: var(--text, #0f172a);
  font-size: 1em;
}

.tasklog-live-btn,
.tasklog-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-card, #ffffff);
  color: var(--text, #0f172a);
  font-size: 0.85em;
  cursor: pointer;
}

.tasklog-live-btn[aria-pressed="true"] {
  border-color: var(--accent, #2563eb);
  color: var(--accent, #2563eb);
}

.tasklog-live-btn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted, #64748b);
}

.tasklog-live-btn[aria-pressed="true"] .tasklog-live-btn-dot {
  background: var(--ok, #16a34a);
}

.tasklog-live-btn:hover,
.tasklog-refresh-btn:hover {
  border-color: var(--accent, #2563eb);
}

.tasklog-trim-notice {
  font-size: 0.82em;
  color: var(--warn, #d97706);
  margin-bottom: 6px;
}

.tasklog-window-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 140px;
  display: flex;
}

.tasklog-window {
  flex: 1 1 auto;
  overflow-y: auto;
  background: var(--bg, #f5f7fb);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm, 6px);
  padding: 8px 10px;
}

.tasklog-output {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text, #0f172a);
}

.tasklog-jump-btn {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 5px 12px;
  border: none;
  border-radius: 999px;
  background: var(--accent, #2563eb);
  color: #ffffff;
  font-size: 0.82em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.tasklog-status-line {
  margin-top: 8px;
  color: var(--text-muted, #64748b);
  font-size: 0.8em;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tasklog-error {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm, 6px);
  background: color-mix(in srgb, var(--err, #dc2626) 12%, transparent);
  color: var(--err, #dc2626);
  font-size: 0.85em;
}

.tasklog-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  padding: 10px 18px;
  border-top: 1px solid var(--border, #e5e7eb);
}

.tasklog-fulllink {
  color: var(--accent, #2563eb);
  text-decoration: none;
  font-size: 0.9em;
}

.tasklog-fulllink:hover {
  text-decoration: underline;
}
