/* Custom polish on top of Bootstrap. */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

.card {
  border: none;
  border-radius: 10px;
}

.navbar-brand {
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge {
  font-weight: 500;
  letter-spacing: 0.3px;
}

pre {
  font-family: "Menlo", "Consolas", monospace;
  font-size: 12.5px;
}

.table > :not(caption) > * > * {
  vertical-align: middle;
}

main {
  min-height: calc(100vh - 140px);
}

.form-check.border:hover {
  background-color: #f8f9fa;
  cursor: pointer;
}

.qa-chat-messages {
  overflow-y: auto;
  max-height: min(52vh, 520px);
  min-height: 200px;
  background: #f8f9fa;
}

.qa-chat-bubble {
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.6rem;
  max-width: 100%;
}

.qa-chat-user {
  background: #fff3cd;
  border: 1px solid #ffe69c;
  margin-left: 1rem;
}

.qa-chat-assistant {
  background: #fff;
  border: 1px solid #dee2e6;
  margin-right: 0.5rem;
}

.qa-chat-scenarios-pre {
  white-space: pre-wrap;
  max-height: 10rem;
  overflow: auto;
  font-size: 0.8rem;
}

.qa-chat-card .card-footer {
  flex-shrink: 0;
}

.qa-chat-knowledge-reply {
  font-size: 0.875rem;
  line-height: 1.55;
  max-height: 28rem;
  overflow: auto;
}

.qa-chat-formatted .qa-chat-section-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #212529;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 0.25rem;
}

.qa-chat-formatted .qa-chat-h {
  font-size: 0.95rem;
  font-weight: 600;
}

.qa-chat-formatted .qa-chat-list {
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
}

.qa-chat-formatted .qa-chat-list li {
  margin-bottom: 0.2rem;
}

.qa-chat-formatted .qa-chat-p {
  margin-bottom: 0.35rem;
}

.qa-chat-formatted .qa-chat-code-block {
  background: #f1f3f5;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  overflow-x: auto;
}

.qa-chat-formatted code {
  background: #f1f3f5;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.85em;
}

.qa-chat-scorecard {
  background: #f8f9fa !important;
}

.qa-chat-overall-score {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}

.qa-chat-spacer {
  height: 0.35rem;
}

/* Markdown tables in QA / More Info replies */
.qa-chat-table-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #dee2e6;
}

.qa-chat-md-table {
  margin-bottom: 0;
  font-size: 0.84rem;
}

.qa-chat-md-table thead th {
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.55rem 0.75rem;
  border-bottom-width: 1px;
  white-space: nowrap;
}

.qa-chat-md-table td {
  padding: 0.6rem 0.75rem;
  vertical-align: middle;
}

.qa-chat-md-table-strong thead th {
  background: linear-gradient(180deg, #d1e7dd 0%, #badbcc 100%);
  color: #0f5132;
  border-color: #a3cfbb;
}

.qa-chat-md-table-weak thead th {
  background: linear-gradient(180deg, #fff3cd 0%, #ffe69c 100%);
  color: #664d03;
  border-color: #ffda6a;
}

.qa-chat-md-table tbody tr {
  border-color: #e9ecef;
}

.qa-chat-table-row-good {
  background: rgba(25, 135, 84, 0.08);
}

.qa-chat-table-row-warn {
  background: rgba(255, 193, 7, 0.1);
}

.qa-chat-table-row-bad {
  background: rgba(220, 53, 69, 0.08);
}

.qa-chat-score-badge {
  display: inline-block;
  min-width: 3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
}

.qa-chat-score-good {
  background: #198754;
  color: #fff;
}

.qa-chat-score-warn {
  background: #ffc107;
  color: #212529;
}

.qa-chat-score-bad {
  background: #dc3545;
  color: #fff;
}

.qa-chat-score-cell {
  width: 5.5rem;
}

/* ChatGPT-style More Info modal (accessibility explanations) */
.modal-more-info {
  max-width: 720px;
}

#moreInfoModal .modal-backdrop.show {
  opacity: 0.72;
}

.more-info-modal {
  background: #1a1a1a;
  color: #ececec;
  border: 1px solid #404040;
  border-radius: 16px;
  overflow: hidden;
}

.more-info-header {
  background: linear-gradient(180deg, #252525 0%, #1f1f1f 100%);
  border-bottom: 1px solid #333;
  padding: 1rem 1.25rem;
  align-items: center;
}

.more-info-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10a37f 0%, #0d8c6d 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(16, 163, 127, 0.35);
}

.more-info-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8e8e8e;
  margin-bottom: 0.15rem;
}

.more-info-modal .modal-title {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
}

.more-info-close-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #444;
  background: #2d2d2d;
  color: #e0e0e0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.more-info-close-btn:hover {
  background: #3d3d3d;
  border-color: #666;
  color: #fff;
}

.more-info-body {
  background: #1a1a1a;
  padding: 1.25rem 1.5rem;
  min-height: 200px;
}

.more-info-muted {
  color: #8e8e8e;
}

.more-info-loading-title {
  color: #f0f0f0;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.more-info-loading-dots {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.more-info-loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10a37f;
  animation: more-info-bounce 1.2s infinite ease-in-out;
}

.more-info-loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.more-info-loading-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes more-info-bounce {
  0%, 80%, 100% { transform: scale(0.65); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

.more-info-error {
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.35);
  color: #ffd666;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
}

.more-info-chat {
  font-size: 0.92rem;
  line-height: 1.65;
  max-height: min(62vh, 560px);
  overflow-y: auto;
  padding-right: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: #444 transparent;
}

.more-info-chat::-webkit-scrollbar {
  width: 6px;
}

.more-info-chat::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}

.more-info-chat .qa-chat-formatted .qa-chat-section-title,
.more-info-chat .qa-chat-formatted .qa-chat-h {
  color: #fff;
  border-bottom: 1px solid #333;
  padding-bottom: 0.35rem;
  margin-top: 1.25rem;
}

.more-info-chat .qa-chat-formatted .qa-chat-section-title:first-child,
.more-info-chat .qa-chat-formatted .qa-chat-h:first-child {
  margin-top: 0;
}

.more-info-chat .qa-chat-formatted .qa-chat-p,
.more-info-chat .qa-chat-formatted .qa-chat-list li {
  color: #d0d0d0;
}

.more-info-chat .qa-chat-formatted .qa-chat-list {
  margin-bottom: 0.75rem;
}

.more-info-chat .qa-chat-formatted .qa-chat-code-block {
  background: #2a2a2a;
  border: 1px solid #3f3f3f;
  color: #e8e8e8;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  margin: 0.5rem 0 0.75rem;
}

.more-info-chat .qa-chat-formatted code {
  background: #2a2a2a;
  color: #7ee787;
  border: 1px solid #3f3f3f;
  padding: 0.15rem 0.4rem;
}

.more-info-chat .qa-chat-formatted strong {
  color: #fff;
  font-weight: 600;
}

.more-info-chat .qa-chat-table-wrap {
  border-color: #3a3a3a;
}

.more-info-chat .qa-chat-md-table {
  color: #e0e0e0;
  --bs-table-bg: transparent;
  --bs-table-color: #e0e0e0;
  --bs-table-border-color: #3a3a3a;
}

.more-info-chat .qa-chat-md-table-strong thead th {
  background: linear-gradient(180deg, #1a4d3a 0%, #145c42 100%);
  color: #b8f0d8;
  border-color: #2d6b52;
}

.more-info-chat .qa-chat-md-table-weak thead th {
  background: linear-gradient(180deg, #5c4a12 0%, #7a6118 100%);
  color: #ffe8a3;
  border-color: #9a7b1f;
}

.more-info-chat .qa-chat-table-row-good {
  background: rgba(25, 135, 84, 0.18);
}

.more-info-chat .qa-chat-table-row-warn {
  background: rgba(255, 193, 7, 0.14);
}

.more-info-chat .qa-chat-table-row-bad {
  background: rgba(220, 53, 69, 0.16);
}

.more-info-chat .qa-chat-md-table td {
  border-color: #333;
}

.more-info-footer {
  background: #1f1f1f;
  border-top: 1px solid #333;
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.more-info-footer-note {
  font-size: 0.75rem;
  color: #777;
  flex: 1;
  min-width: 12rem;
}

.more-info-footer-close {
  background: #2d2d2d;
  border: 1px solid #555;
  color: #f0f0f0;
  border-radius: 10px;
  padding: 0.45rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.more-info-footer-close:hover {
  background: #3a3a3a;
  border-color: #777;
  color: #fff;
}

.more-info-btn {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid #3d5a80;
  color: #e8f1ff !important;
  border-radius: 8px;
  padding: 0.35rem 0.85rem;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}

.more-info-btn:hover {
  background: linear-gradient(135deg, #1f2540 0%, #1a3050 100%);
  border-color: #5c8fd6;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(61, 90, 128, 0.35);
}

.more-info-btn .bi {
  color: #7eb8ff;
}

/* Testing hub — Website vs App */
.testing-hub-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.testing-hub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08) !important;
}
.testing-hub-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  font-size: 1.5rem;
}
.testing-hub-card--soon {
  opacity: 0.72;
  pointer-events: none;
  user-select: none;
}
.testing-hub-card--soon:hover {
  transform: none;
  box-shadow: inherit !important;
}

.result-detail-friendly details > summary {
  list-style: none;
}
.result-detail-friendly details > summary::-webkit-details-marker {
  display: none;
}

.live-log-panel {
  font-family: "Menlo", "Consolas", ui-monospace, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  max-height: 18rem;
  overflow: auto;
  background: #0f172a;
  color: #cbd5e1;
  padding: 0.75rem 1rem;
  border-radius: 0 0 10px 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.live-log-line.live-log-info {
  color: #93c5fd;
}

.live-log-line.live-log-warn {
  color: #fcd34d;
}

.live-log-line.live-log-error {
  color: #fca5a5;
  font-weight: 600;
}

.live-preview-body {
  min-height: 12rem;
  background: #0f172a;
  border-radius: 0 0 10px 10px;
}

.live-preview-img {
  max-width: 100%;
  max-height: 320px;
  width: auto;
  height: auto;
  border: 1px solid #334155;
  border-radius: 6px;
  object-fit: contain;
  background: #1e293b;
}

.live-vnc-frame {
  width: 100%;
  min-height: 280px;
  height: 320px;
  border: 1px solid #334155;
  border-radius: 6px;
  background: #0b1220;
}
