/* Autotests page styles — extends style.css */

/* Toolbar */
.at-toolbar {
  display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center;
}
.at-toolbar-spacer { flex: 1; }
.at-search {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 12px; color: var(--text); font-size: 13px; min-width: 260px;
}
.at-search:focus { outline: none; border-color: var(--accent); }

.at-btn {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 14px; color: var(--text); font-size: 13px; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.at-btn:hover { border-color: var(--accent); }
.at-btn:disabled { opacity: .5; cursor: not-allowed; }
.at-btn-primary { background: var(--accent); border-color: var(--accent); color: #0d1117; font-weight: 600; }
.at-btn-primary:hover { background: #79b8ff; border-color: #79b8ff; }
.at-btn-sm { padding: 4px 10px; font-size: 12px; }
.at-btn-danger { color: var(--red); }
.at-btn-danger:hover { border-color: var(--red); }

/* Usage summary */
.at-usage {
  display: flex; gap: 16px; padding: 10px 14px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 16px; font-size: 13px; color: var(--text2);
  flex-wrap: wrap;
}
.at-usage b { color: var(--text); font-weight: 600; }
.at-usage .u-item { display: flex; gap: 6px; align-items: baseline; }

/* Cases grid */
.at-grid { display: grid; gap: 10px; }
.at-loading { color: var(--text2); padding: 20px; text-align: center; }

.at-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 18px; transition: border-color .15s;
}
.at-card:hover { border-color: var(--accent); }
.at-card-header {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.at-card-id {
  font-family: monospace; font-weight: 600; padding: 2px 8px;
  border-radius: 4px; font-size: 12px;
}
.at-card-id.critical { background: rgba(248,81,73,0.15); color: var(--red); }
.at-card-id.high     { background: rgba(219,109,40,0.15); color: var(--orange); }
.at-card-id.medium   { background: rgba(210,153,34,0.15); color: var(--yellow); }
.at-card-id.low      { background: rgba(63,185,80,0.15); color: var(--green); }

.at-card-title { flex: 1; font-size: 14px; font-weight: 500; min-width: 200px; }
.at-card-source {
  font-size: 11px; color: var(--text2);
  background: var(--bg3); padding: 2px 8px; border-radius: 10px;
}
.at-card-status {
  font-family: monospace; font-size: 12px; min-width: 80px; text-align: right;
}
.at-card-actions {
  display: flex; gap: 6px; margin-left: auto;
}
.at-card-body {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
  display: none;
}
.at-card.open .at-card-body { display: block; }
.at-card-body h5 { font-size: 11px; color: var(--text2); text-transform: uppercase; margin: 8px 0 4px; }
.at-card-body ol { margin-left: 18px; font-size: 13px; line-height: 1.6; color: var(--text); }
.at-card-body .at-expected {
  background: var(--bg3); padding: 8px 12px; border-radius: 6px;
  border-left: 3px solid var(--green); font-size: 13px; color: var(--text);
}
.at-card-body .at-pre { font-size: 12px; color: var(--text2); font-style: italic; }

/* Modal */
.at-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.at-modal-backdrop[hidden] { display: none; }
.at-modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
  width: 100%; max-width: 600px; max-height: 90vh;
  display: flex; flex-direction: column;
}
.at-modal-wide { max-width: 800px; }
.at-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.at-modal-header h2 { font-size: 16px; font-weight: 600; }
.at-modal-close {
  background: none; border: none; color: var(--text2); font-size: 24px;
  cursor: pointer; line-height: 1; padding: 0 4px;
}
.at-modal-close:hover { color: var(--text); }
.at-modal-body {
  padding: 18px 20px; overflow-y: auto; flex: 1;
}
.at-modal-footer {
  padding: 12px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end; align-items: center;
}

/* Form */
.at-row { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.at-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; margin-bottom: 14px; }
.at-row .at-field { margin-bottom: 0; }
.at-field-narrow { flex: 0 0 140px; }
.at-field label { font-size: 12px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; }
.at-field input, .at-field textarea, .at-field select {
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 12px; color: var(--text); font-family: inherit; font-size: 13px;
  width: 100%;
}
.at-field input:focus, .at-field textarea:focus, .at-field select:focus {
  outline: none; border-color: var(--accent);
}
.at-field textarea { resize: vertical; min-height: 60px; }
.at-hint { font-size: 11px; color: var(--text2); margin-top: 2px; }

/* Steps editor */
.at-steps { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.at-step-row { display: flex; gap: 6px; align-items: center; }
.at-step-row .at-step-num {
  font-family: monospace; color: var(--text2); width: 22px; text-align: right; font-size: 12px;
}
.at-step-row input { flex: 1; }
.at-step-row .at-step-del {
  background: none; border: 1px solid var(--border); color: var(--text2);
  width: 28px; height: 32px; border-radius: 6px; cursor: pointer;
}
.at-step-row .at-step-del:hover { border-color: var(--red); color: var(--red); }

/* AI status */
.at-ai-status { font-size: 13px; padding: 8px 0; min-height: 24px; }
.at-ai-status.loading { color: var(--accent); }
.at-ai-status.error { color: var(--red); }

/* Run log */
.at-run-log {
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 12px; font-family: monospace; font-size: 12px;
  max-height: 60vh; overflow-y: auto; min-height: 200px;
}
.at-run-log .ll { padding: 2px 0; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.at-run-log .ll-info   { color: var(--text2); }
.at-run-log .ll-action { color: var(--accent); }
.at-run-log .ll-pass   { color: var(--green); font-weight: bold; }
.at-run-log .ll-fail   { color: var(--red); font-weight: bold; }
.at-run-log .ll-error  { color: var(--orange); }
.at-run-summary { color: var(--text2); font-size: 12px; flex: 1; }
