/* ══════════════════════════════════════════════════════════════════════
   Testing Overlay — issue form, issue list within support chat
   Follows the support-chat.css design language (--panel, --bg2, --bg3,
   --border2, --cream, --rose, --muted, --ff-body, --ff-display).
   ══════════════════════════════════════════════════════════════════════ */

/* ── Report Issue button in support chat header ──────────────────────── */

.sc-report-btn {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--rose-bg);
  color: var(--rose);
  border: 1px solid var(--rose-20);
  border-radius: 6px;
  font-family: var(--ff-body);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.sc-report-btn:hover {
  background: var(--rose-15);
  border-color: var(--rose-30);
}

.sc-report-btn svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* Show only in testing mode */
body.testing-mode .sc-report-btn {
  display: inline-flex;
}

/* ── View Issues button ──────────────────────────────────────────────── */

.sc-issues-btn {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--cream-04);
  color: var(--muted);
  border: 1px solid var(--border2);
  border-radius: 6px;
  font-family: var(--ff-body);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.sc-issues-btn:hover {
  color: var(--cream);
  border-color: var(--cream-15);
}

body.testing-mode .sc-issues-btn {
  display: inline-flex;
}

/* ── Issue form panel ────────────────────────────────────────────────── */

.sc-issue-form {
  position: absolute;
  inset: 0;
  background: var(--panel);
  z-index: 10;
  display: flex;
  flex-direction: column;
  animation: scSlideIn 0.2s ease;
}

@keyframes scSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.sc-issue-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border2);
}

.sc-issue-form-title {
  font-family: var(--ff-display);
  font-size: 16px;
  font-weight: 400;
  color: var(--cream);
}

.sc-issue-form-close {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--border2);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted2);
  cursor: pointer;
  transition: all 0.15s;
}

.sc-issue-form-close:hover {
  color: var(--cream);
  border-color: var(--cream-15);
}

.sc-issue-form-close svg {
  width: 13px;
  height: 13px;
}

.sc-issue-form-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.sc-issue-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.sc-issue-input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--cream);
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 300;
  margin-bottom: 14px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}

.sc-issue-input:focus {
  border-color: var(--rose-40);
}

.sc-issue-input::placeholder {
  color: var(--muted2);
}

.sc-issue-textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--cream);
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 300;
  margin-bottom: 14px;
  resize: vertical;
  min-height: 80px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}

.sc-issue-textarea:focus {
  border-color: var(--rose-40);
}

.sc-issue-textarea::placeholder {
  color: var(--muted2);
}

.sc-issue-select {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--cream);
  font-family: var(--ff-body);
  font-size: 13px;
  margin-bottom: 14px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a6d72' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.sc-issue-select:focus {
  border-color: var(--rose-40);
}

.sc-issue-select option {
  background: var(--bg2);
  color: var(--cream);
}

.sc-issue-submit {
  width: 100%;
  padding: 10px;
  background: var(--rose);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 4px;
}

.sc-issue-submit:hover {
  background: var(--rose-hover);
}

.sc-issue-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Issue list panel ────────────────────────────────────────────────── */

.sc-issue-list {
  position: absolute;
  inset: 0;
  background: var(--panel);
  z-index: 10;
  display: flex;
  flex-direction: column;
  animation: scSlideIn 0.2s ease;
}

.sc-issue-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border2);
}

.sc-issue-list-title {
  font-family: var(--ff-display);
  font-size: 16px;
  font-weight: 400;
  color: var(--cream);
}

.sc-issue-list-close {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--border2);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted2);
  cursor: pointer;
  transition: all 0.15s;
}

.sc-issue-list-close:hover {
  color: var(--cream);
  border-color: var(--cream-15);
}

.sc-issue-list-close svg {
  width: 13px;
  height: 13px;
}

.sc-issue-list-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
}

.sc-issue-card {
  padding: 12px 14px;
  border: 1px solid var(--border2);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.sc-issue-card:hover {
  border-color: var(--cream-15);
  background: var(--cream-04);
}

.sc-issue-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.sc-issue-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--cream);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-issue-card-meta {
  font-size: 11px;
  color: var(--muted2);
  display: flex;
  gap: 8px;
}

/* ── Severity badges ─────────────────────────────────────────────────── */

.sc-severity {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--ff-body);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.sc-severity-bug {
  background: var(--red-bg);
  color: var(--red-light);
}

.sc-severity-ux {
  background: var(--amber-bg);
  color: var(--amber);
}

.sc-severity-suggestion {
  background: var(--blue-bg);
  color: var(--blue);
}

/* ── Status pills ────────────────────────────────────────────────────── */

.sc-status {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--ff-body);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.sc-status-open {
  background: var(--green-bg);
  color: var(--green);
}

.sc-status-acknowledged {
  background: var(--amber-bg);
  color: var(--amber);
}

.sc-status-fixed {
  background: var(--cream-04);
  color: var(--muted);
}

.sc-status-wontfix,
.sc-status-duplicate {
  background: var(--cream-04);
  color: var(--muted2);
}

/* ── Issue detail panel ──────────────────────────────────────────────── */

.sc-issue-detail {
  position: absolute;
  inset: 0;
  background: var(--panel);
  z-index: 11;
  display: flex;
  flex-direction: column;
  animation: scSlideIn 0.2s ease;
}

.sc-issue-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border2);
}

.sc-issue-detail-back {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--border2);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted2);
  cursor: pointer;
  transition: all 0.15s;
}

.sc-issue-detail-back:hover {
  color: var(--cream);
  border-color: var(--cream-15);
}

.sc-issue-detail-back svg {
  width: 13px;
  height: 13px;
}

.sc-issue-detail-title {
  font-family: var(--ff-display);
  font-size: 15px;
  font-weight: 400;
  color: var(--cream);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-issue-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.sc-issue-detail-desc {
  font-size: 13px;
  color: var(--cream);
  line-height: 1.6;
  margin-bottom: 16px;
  white-space: pre-wrap;
}

.sc-issue-detail-section {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 16px 0 8px;
}

.sc-issue-comment {
  padding: 10px 14px;
  background: var(--cream-04);
  border-radius: 10px;
  margin-bottom: 8px;
}

.sc-issue-comment-author {
  font-size: 11px;
  font-weight: 500;
  color: var(--rose);
  margin-bottom: 3px;
}

.sc-issue-comment-body {
  font-size: 13px;
  color: var(--cream);
  line-height: 1.5;
}

.sc-issue-comment-time {
  font-size: 10px;
  color: var(--muted2);
  margin-top: 3px;
}

.sc-issue-detail-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border2);
  display: flex;
  gap: 8px;
}

.sc-issue-detail-comment-input {
  flex: 1;
  padding: 9px 12px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--cream);
  font-family: var(--ff-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.sc-issue-detail-comment-input:focus {
  border-color: var(--rose-40);
}

.sc-issue-detail-comment-input::placeholder {
  color: var(--muted2);
}

.sc-issue-detail-send {
  padding: 8px 14px;
  background: var(--rose);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.sc-issue-detail-send:hover {
  background: var(--rose-hover);
}

.sc-issue-detail-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Empty state ─────────────────────────────────────────────────────── */

.sc-issue-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 13px;
}

/* ── Light theme overrides ───────────────────────────────────────────── */

[data-theme="light"] .sc-issue-form,
[data-theme="light"] .sc-issue-list,
[data-theme="light"] .sc-issue-detail {
  background: var(--panel);
}

[data-theme="light"] .sc-issue-card:hover {
  background: var(--cream-04);
}

[data-theme="light"] .sc-issue-comment {
  background: var(--cream-04);
}
