/* OpenMed AI Reader — đọc gợi ý AI cho ảnh X-quang ngực.
   Namespaced dưới .openmed-ai-* để không xung đột CSS của theme. */

.openmed-ai-reader {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  max-width: 480px;
  border: 1px solid #d7dce2;
  border-radius: 12px;
  padding: 16px;
  background: #ffffff;
  color: #1a1f27;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

.openmed-ai-reader h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
}

.openmed-ai-reader p.openmed-hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: #5b6472;
  line-height: 1.4;
}

.openmed-ai-banner {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 600;
}

.openmed-ai-modality-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 13px;
  color: #1a1f27;
  font-weight: 600;
}
.openmed-ai-modality-label select {
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #cbd3dd;
  font-size: 13px;
}
.openmed-ai-modality-fixed {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: #5b6472;
  font-weight: 600;
}

.openmed-ai-mode-switch {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e3e7ec;
}

.openmed-ai-mode-btn {
  flex: 1;
  padding: 8px 6px;
  border: none;
  background: transparent;
  color: #5b6472;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.openmed-ai-mode-btn:hover { color: #1a1f27; }
.openmed-ai-mode-btn.openmed-ai-mode-active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.openmed-ai-pane {
  margin-bottom: 4px;
}

.openmed-ai-btn-secondary {
  background: #fff;
  color: #b91c1c;
  border: 1px solid #f3c1c1;
}
.openmed-ai-btn-secondary:hover { background: #fef2f2; }

.openmed-ai-capture-video {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  background: #0b0f14;
  border-radius: 8px;
  margin-top: 10px;
}

.openmed-ai-capture-actions {
  display: flex;
  gap: 8px;
}
.openmed-ai-capture-actions .openmed-ai-btn {
  margin-top: 10px;
  width: auto;
  flex: 1 1 auto;
}

.openmed-ai-auto-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: #5b6472;
  cursor: pointer;
}

.openmed-ai-dropzone {
  border: 2px dashed #cbd3dd;
  border-radius: 10px;
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  color: #5b6472;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.openmed-ai-dropzone:hover,
.openmed-ai-dropzone.openmed-ai-drag-over {
  border-color: #2563eb;
  background: #f3f6fb;
}
.openmed-ai-dropzone input[type="file"] {
  display: none;
}
.openmed-ai-filename {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #1d4ed8;
  word-break: break-all;
}

.openmed-ai-preview {
  display: block;
  max-width: 100%;
  max-height: 220px;
  margin: 12px auto 0;
  border-radius: 8px;
  border: 1px solid #e3e7ec;
}

.openmed-ai-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: #2563eb;
  color: #fff;
  transition: background-color 0.15s ease;
}
.openmed-ai-btn:hover { background: #1d4ed8; }
.openmed-ai-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.openmed-ai-status {
  margin-top: 10px;
  font-size: 13px;
  color: #5b6472;
}

.openmed-ai-error {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12px;
}

.openmed-ai-results {
  margin-top: 16px;
}

.openmed-ai-results-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #5b6472;
  margin-bottom: 8px;
}

.openmed-ai-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12.5px;
}

.openmed-ai-row-label {
  flex: 0 0 150px;
  color: #1a1f27;
}

.openmed-ai-row-bar-track {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 4px;
  background: #eef1f5;
  overflow: hidden;
}

.openmed-ai-row-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: #94a3b8;
}
.openmed-ai-row-bar-fill.openmed-ai-level-high { background: #dc2626; }
.openmed-ai-row-bar-fill.openmed-ai-level-mid { background: #f59e0b; }
.openmed-ai-row-bar-fill.openmed-ai-level-low { background: #94a3b8; }

.openmed-ai-row-value {
  flex: 0 0 42px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #5b6472;
}

.openmed-ai-disclaimer {
  margin-top: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f3f6fb;
  font-size: 11px;
  color: #5b6472;
  line-height: 1.5;
}
