/* Copyright (c) Microsoft Corporation.
   Licensed under the MIT License. */

body {
  padding: 12px;
  height: 100%;
  /*  system-ui works great on all platforms and browsers these days */
  font-family: system-ui;
  font-size: 13px;
  background-color: var(--vscode-chat-list-background);
}

html {
  height: 100%;
}

h1 {
  /* match the native vscode chat style */
  font-size: 24px;
  font-weight: 500;
  margin-top: 10px;
}

.welcome-message {
  text-align: center;
}

.app {
  max-width: 800px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Whole chat container including the input box */
.chat {
  flex: 1;
}

.status-indicator {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  margin: 0.6em 0;
  font-style: italic;
  font-size: 0.9em;
}

.input-textarea {
  height: auto;
  min-height: calc(1.33em * 2);
  background: inherit;
  width: 100%;
  border: none;
  outline: none;
  overflow-y: auto;
  padding: 16px 10px;
  margin: 0;
  line-height: 1.33;
  vertical-align: middle;
  cursor: text;
  resize: none;
  color: var(--vscode-input-foreground);
  background: var(--vscode-input-background);
}

.input-textarea:focus {
  outline: none;
}

.send-button {
  padding: 2px;
}

.input-box-divider {
  height: 50px;
}

.right-message-row,
.left-message-row {
  display: flex;
  flex-direction: row;
}

.right-message-row {
  justify-content: flex-end;
}

.left-message-row {
  justify-content: flex-start;
}

.user-message,
.assistant-message {
  padding: 0 16px;
  margin-top: 16px;
  border: 1px solid #ccc;
  border-radius: 0.5em;
}

.user-message {
  background-color: var(--vscode-input-background);
}

.content-reminder {
  font-size: x-small;
  margin: 16px 0;
}

pre code {
  background: inherit;
  border: 0.5px solid gray;
  display: block;
  padding: 8px;
  margin: 8px 0;
  overflow: auto;
  white-space: pre-wrap;
}

.retry-button {
  margin: 10px 0 10px 32px;
  text-align: right;
}

.input-box {
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;

  /* match native vscode chat UI */
  /* https://github.com/microsoft/vscode/blob/7fadaa1ddc1c03dcd9a58fab063dac74284eb63e/src/vs/workbench/contrib/chat/browser/media/chat.css#L522 */
  /* box-sizing: border-box; */
  /* cursor: text; */
  background-color: var(--vscode-input-background);
  border: 1px solid var(--vscode-input-border, transparent);
  border-radius: 4px;
  padding: 0 6px 6px 6px; /* top padding is inside the editor widget */
  max-width: 100%;
}

.input-box:has(textarea:focus) {
  border: 2px solid #0078d4;
}

.service-radio-group {
  position: relative;
  display: inline-flex;
  justify-content: space-evenly;
  width: 100%; /* Optional: Adjust the width as needed */
}

.service-radio-group label {
  width: 100%;
  display: flex;
  align-items: center;
  font-size: smaller;
}

.service-radio-group input {
  margin-right: 5px;
}

/* override the github-markdown css background color */
.markdown-body {
  background-color: var(--vscode-chat-list-background);
}

.histogram-container {
  width: 100%;
  margin-top: 1em;
}

/* If not specified it defaults to the 'pre code' default monospace font  */
.hljs-copy-button {
  font-family: system-ui;
}

/* The below are styles to set the highlight.js colors to match the 'Modern' light and dark themes in vscode */
/* Default colors, or theme set explicitly to light */
:root,
[data-vscode-theme-kind="vscode-light"],
[data-vscode-theme-kind="vscode-high-contrast-light"] {
  --qs-code-background: #ffffff;
  --qs-code-default: #001080;
  --qs-code-keyword: #af00db;
  --qs-code-declare: #0000ff;
  --qs-code-punctuation: #af00db;
  --qs-code-operator: #af00db;
  --qs-code-comments: #008000;
  --qs-code-strings: #a31515;
  --qs-code-numbers: #098658;
  --qs-code-calls: #795e26;
  --qs-welcome-background: linear-gradient(
    90deg,
    hsl(0deg 0% 100%),
    hsl(218 16% 98%)
  );
  --qs-welcome-color: #222;
  --qs-welcome-chatbox: #fff;
}

/* Explicit dark theme set */
[data-vscode-theme-kind="vscode-dark"],
[data-vscode-theme-kind="vscode-high-contrast"] {
  --qs-code-background: #1f1f1f;
  --qs-code-default: #9cdcfe;
  --qs-code-keyword: #c586c0;
  --qs-code-declare: #569cd6;
  --qs-code-punctuation: #c586c0;
  --qs-code-operator: #c586c0;
  --qs-code-comments: #6a9955;
  --qs-code-strings: #ce9178;
  --qs-code-numbers: #b5cea8;
  --qs-code-calls: #dcdcaa;
  --qs-welcome-background: linear-gradient(
    90deg,
    hsl(0deg 0% 13.31%),
    hsl(218deg 2.12% 15.67%)
  );
  --qs-welcome-color: #eee;
  --qs-welcome-chatbox: #313131;
}

/* Code block styles for highlight.js */

pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 1em;
}
code.hljs {
  padding: 3px 5px;
}

.hljs {
  color: var(--qs-code-default);
  background: var(--qs-code-background);
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-section,
.hljs-link {
  color: var(--qs-code-keyword);
}
.hljs-punctuation {
  color: var(--qs-code-punctuation);
}
.hljs-type,
.hljs-declare {
  color: var(--qs-code-declare);
}

.hljs-operator {
  color: var(--qs-code-operator);
}

.hljs-title {
  color: var(--qs-code-calls);
}

.hljs-number {
  color: var(--qs-code-numbers);
}

.hljs-string,
.hljs-name,
.hljs-attribute,
.hljs-symbol,
.hljs-bullet,
.hljs-built_in,
.hljs-addition,
.hljs-variable,
.hljs-template-tag,
.hljs-template-variable {
  color: var(--qs-code-strings);
}
.hljs-comment,
.hljs-quote,
.hljs-deletion,
.hljs-meta {
  color: var(--qs-code-comments);
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-title,
.hljs-section,
.hljs-doctag,
.hljs-built_in,
.hljs-type,
.hljs-name,
.hljs-strong {
  font-weight: normal;
}
.hljs-emphasis {
  font-style: italic;
}

/* Welcome message styles */
#qs-copilot-welcome {
  color: var(--qs-welcome-color);
  max-width: 500px;
  border: 0.5px solid #ccc;
  border-radius: 0.8em;
  background: var(--qs-welcome-background);
  box-shadow: 0.1em 0.1em 0.4em rgba(0, 0, 0, 0.1);
  font-family: system-ui;
  font-size: 0.9em;
  padding: 1em;
}

.qs-copilot-title {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  font-size: 1.5em;
  font-weight: 400;
  margin-bottom: 0.8em;
}

.qs-copilot-blurb {
  margin-bottom: 0.8em;
  line-height: 1.33em;
}

.qs-copilot-demo1 {
  border: 0.5px solid #888;
  border-radius: 0.4em;
  background: var(--qs-welcome-chatbox);
  /* dark: #313131 */
  margin: 0.4em 0.8em;
  padding: 0.4em 0.6em;
  display: inline-block;
  font-style: italic;
}

.qs-copilot-disclaimer {
  font-size: 0.8em;
  color: gray;
  margin-top: 0.8em;
}

.confirm-button {
  background-color: var(--vscode-button-background);
  color: var(--vscode-button-foreground);
  border: none;
  border-radius: 4px;
  padding: 0.3em 0.6em;
  margin-top: 0.4em;
  margin-bottom: 0.2em;
  margin-left: 0.6em;
  margin-right: 0;
  cursor: pointer;
}
