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

@chat-bg: #00000000;
@chat-input-bg: white;

#html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  overflow: hidden;
  background-color: #00000000;
}

.dark-mode {
  background-color: #1a1a2e;

  .action-container {
    background-color: #16162a;
  }

  .chat-container {
    background-color: #16162a;
    .scroll_enabled {
      background-color: #16162a;
    }
  }

  .replacement-container {
    background-color: #16162a;
  }

  .chat-input {
    background-color: #2a2a40;
    border: 1px solid #3a3a50;

    &:focus-within {
      border-color: #7c3aed;
      box-shadow: 0 1px 4px rgba(124, 58, 237, 0.2);
    }

    .user-textarea {
      color: #e8e8f0;
    }

    .chat-input-button {
      color: #e8e8f0;
    }

    label {
      color: #e8e8f0;
    }

    .autocomplete-container {
      background-color: #2a2a40f0;
      color: #e8e8f0;
      border-color: rgba(255, 255, 255, 0.08);
      box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.3),
        0 1px 4px rgba(0, 0, 0, 0.2);
    }

    .autocomplete-container .completions li:hover {
      background-color: rgba(167, 139, 250, 0.12);
    }

    .autocomplete-scrollbar {
      background-color: rgba(255, 255, 255, 0.06);
    }

    .autocomplete-scrollbar-indicator {
      background-color: rgba(167, 139, 250, 0.4);
    }
  }

  .inline-ghost {
    color: #6b7280;
  }

  .chat-message-agent {
    background-color: #2a2a40;
  }

  .chat-message-user {
    background-color: #3b2d63;
  }

  .chat-message-content {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  }

  .chat-message-kind-info {
    color: #999;
  }

  details.reasoning-thinking {
    border-color: #3a3a50;
  }

  details.reasoning-thinking summary {
    color: #aaa;
  }

  details.reasoning-thinking pre {
    border-top-color: #3a3a50;
    background: rgba(255, 255, 255, 0.03);
    color: #ccc;
  }

  .chat-message-metrics-agent {
    background-color: #232338;
  }

  .chat-message-metrics-user {
    background-color: #322850;
  }

  .agent-icon {
    background-color: #2a2a40;
  }

  .user-icon {
    background: #4c1d95;
    color: #c4b5fd;
  }

  .chat-timestamp {
    color: #666;
  }

  .track-list {
    h3 {
      color: #ccc;
    }

    li {
      border-bottom-color: rgba(255, 255, 255, 0.06);
    }
  }

  .track-title {
    color: #e8e8f0;
  }

  .track-artist {
    color: #999;
  }

  .track-info div {
    color: #888;
  }

  .now-playing-title {
    color: #e8e8f0;
  }

  .now-playing-artist {
    color: #bbb;
  }

  .now-playing-album {
    color: #888;
  }

  .now-playing-times {
    color: #888;
  }

  .now-playing-bar {
    background: #3a3a50;
  }

  .now-playing-bar-fill {
    background: #a78bfa;
  }

  .now-playing-device {
    color: #666;
  }

  .chat-message-agent {
    background-color: #2a2a40;
  }

  .chat-message-user {
    background-color: #3b2d63;
  }

  .chat-message-content {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  }

  .chat-message-metrics-agent {
    background-color: #232338;
  }

  .chat-message-metrics-user {
    background-color: #322850;
  }

  .agent-icon {
    background-color: #2a2a40;
  }

  .user-icon {
    background: #4c1d95;
    color: #c4b5fd;
  }

  .chat-timestamp {
    color: #666;
  }

  .track-list {
    h3 {
      color: #ccc;
    }

    li {
      border-bottom-color: rgba(255, 255, 255, 0.06);
    }
  }

  .track-title {
    color: #e8e8f0;
  }

  .track-artist {
    color: #999;
  }

  .track-info div {
    color: #888;
  }

  .now-playing-title {
    color: #e8e8f0;
  }

  .now-playing-artist {
    color: #bbb;
  }

  .now-playing-album {
    color: #888;
  }

  .now-playing-times {
    color: #888;
  }

  .now-playing-bar {
    background: #3a3a50;
  }

  .now-playing-bar-fill {
    background: #a78bfa;
  }

  .now-playing-device {
    color: #666;
  }

  .action-text {
    color: lightgray;
  }

  .chat-separator-line {
    background-color: #444;
  }

  .chat-separator-text {
    color: #666;
  }
}

.history {
  filter: grayscale(100%);
}

.chat-separator {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  text-align: center;
  font-size: 10px;
  margin: 20px 20px;
}

.chat-separator-line {
  flex-grow: 1;
  width: 40px;
  background-color: darkgray;
  height: 2px;
}

.chat-separator-text {
  margin: 0px 10px;
  color: darkgray;
  height: 20px;
}

.wrapper {
  height: 100%;
  width: 100%;
  position: absolute;
  background-color: #00000000;
}

.user-textarea {
  padding: 5px 8px;
  display: flex;
  width: calc(100% - 48px);
  overflow: hidden;
  resize: none;
  outline: 0px solid transparent;
  min-height: 30px;
  line-height: 30px;
  font-family: inherit;
  font-size: inherit;
  align-self: flex-start;
}

.inline-ghost {
  color: #9ca3af;
  pointer-events: none;
  user-select: none;
}

.replacement-textarea {
  padding: 10px 16px;
  display: block;
  width: 100%;
  overflow: hidden;
  resize: none;
  outline: 0px solid transparent;
  min-height: 40px;
  line-height: 20px;
  font-family: inherit;
  font-size: inherit;
  align-self: flex-start;
}

.action-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: white;
}

.choice-panel {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 40px;
  font-family: inherit;
  font-size: inherit;
}

.choice-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
}

.choice-button:hover {
  background-color: #c6e3ef;
}
.choice-button:focus {
  box-shadow:
    inset 0px 0.8px 0px -0.25px rgba(255, 255, 255, 0.2),
    0px 0.5px 1px rgba(0, 0, 0, 0.1),
    0px 0px 0px 3.5px rgba(58, 108, 217, 0.5);
  outline: 0;
}

.checkbox-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: auto;
  padding: 4px 0;
  gap: 2px;
}

.checkbox-choice {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.checkbox-choice:hover {
  background-color: #f0f0f0;
}

.checkbox-buttons {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.action-text {
  padding: 10px 16px;
  align-self: center;
}

.preface-text {
  // bottom border
  border-bottom: 1px dotted #808080;
  padding-bottom: 5px;
  margin-bottom: 10px;
}

.replacement-title {
  display: flex;
  align-items: flex-start;
  height: 40px;
  color: green;
  background-color: white;
}

.replacement-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: white;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  bottom: 0px;
  position: absolute;
  background-color: @chat-bg;
  width: 100%;
}

.chat {
  /* use flexbox to align the messages vertically */
  display: flex;
  flex-direction: column-reverse;
  height: 100%;
  scroll-behavior: smooth;
  overflow-y: auto;
  font-family: inherit;
  font-size: inherit;
  background-color: @chat-bg;
  padding: 25px 10px 25px 10px;
}

.track-list {
  max-height: 350px;
  overflow-y: auto;
  border-radius: 8px;
  padding-right: 4px;

  h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: #333;
  }

  ol {
    margin: 0;
    padding-left: 24px;
    list-style-type: decimal;
  }

  li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);

    &:last-child {
      border-bottom: none;
    }
  }
}

.playlist-list {
  max-height: 350px;
  overflow-y: auto;
  border-radius: 8px;
  padding-right: 4px;
}

.playlist-title {
  color: #6b21a8;
  font-weight: 600;
}

.track-artist {
  color: #555;
  font-size: 0.9em;
}

.track-title {
  color: #1a1a1a;
  font-weight: 600;
}

.track-album-cover-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.track-info {
  flex: 1;
  min-width: 0;

  div {
    font-size: 0.85em;
    color: #666;
  }
}

.track-album-cover {
  width: 52px;
  height: 52px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Now Playing status card */
.now-playing-card {
  padding: 4px 0;
}

.now-playing-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.now-playing-art {
  width: 72px;
  height: 72px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.now-playing-info {
  flex: 1;
  min-width: 0;
}

.now-playing-title {
  font-weight: 600;
  font-size: 15px;
  color: #1a1a1a;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-playing-artist {
  font-size: 13px;
  color: #555;
  margin-bottom: 1px;
}

.now-playing-album {
  font-size: 12px;
  color: #888;
}

.now-playing-progress {
  margin-top: 10px;
}

.now-playing-times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #888;
  margin-bottom: 4px;
}

.now-playing-bar {
  height: 4px;
  background: #e5e5e5;
  border-radius: 2px;
  overflow: hidden;
}

.now-playing-bar-fill {
  height: 100%;
  background: #7c3aed;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.now-playing-device {
  margin-top: 8px;
  font-size: 11px;
  color: #aaa;
}

.now-playing-empty {
  color: #888;
  font-style: italic;
}

.read-only .chat-input {
  display: none;
}

.write-only {
  .chat-input {
    max-height: 45px;
  }

  .chat {
    display: none;
  }
}

.chat-input.listening {
  background-color: aquamarine;
}

.chat-input {
  display: flex;
  padding: 6px 8px;
  background-color: @chat-input-bg;
  align-self: flex-end;
  margin: 8px 12px 12px 12px;
  width: calc(
    100% - 24px
  ); // Note: subtracted value should match horizontal margin total from line above
  border: solid 1px #e0e0e0;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: border-color 0.2s ease;

  &:focus-within {
    border-color: #a78bfa;
    box-shadow: 0 1px 4px rgba(167, 139, 250, 0.15);
  }
}

.chat-input-drag {
  color: #cccccc;
  font-style: italic;
}

/* Container */
.chat-message-container {
  padding-left: 10px;
  padding-right: 10px;
  margin-bottom: 8px;
  margin-top: 8px;
  width: 55%;
  transform-origin: 0 100%;
  transform: scale(0);
  animation: message 0.15s ease-out 0s forwards;
}

.chat-message-container-agent {
  .chat-message-container;
  margin-left: 10px;
}

.chat-message-container-user {
  .chat-message-container;
  margin-right: 10px;
  align-self: flex-end;
}

/* Body */
.chat-message-body {
  border-radius: 12px;
  margin-bottom: 4px;
}

.chat-message-user {
  .chat-message-body;
  position: relative;
  background-color: #f0eef5;
  margin-right: 36px;
}

.chat-message-agent {
  margin-left: 36px;
  position: relative;
  background-color: #f3f4f6;
}

/* Content */
.chat-message-content {
  padding: 10px 16px;
  word-wrap: break-word;
  overflow-x: auto;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.chat-message-kind-status {
  font-style: italic;
  color: grey;
}

.chat-message-kind-warning {
  font-style: italic;
  color: rgb(146, 146, 0);
}

.chat-message-kind-error {
  font-style: italic;
  color: red;
}

.chat-message-kind-success {
  font-style: italic;
  color: green;
}

.chat-message-kind-info {
  font-size: 0.85em;
  color: #666;
  padding: 2px 0;
}

/* Collapsible thinking block for reasoning engine */
details.reasoning-thinking {
  margin: 4px 0;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 0;
  font-size: 0.85em;
}

details.reasoning-thinking summary {
  cursor: pointer;
  padding: 4px 10px;
  font-weight: 600;
  color: #888;
  user-select: none;
  list-style: none;
}

details.reasoning-thinking summary::before {
  content: "\25B6";
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s ease;
  font-size: 0.7em;
}

details.reasoning-thinking[open] summary::before {
  transform: rotate(90deg);
}

details.reasoning-thinking pre {
  margin: 0;
  padding: 8px 10px;
  white-space: pre-wrap;
  word-wrap: break-word;
  border-top: 1px solid #e0e0e0;
  background: rgba(0, 0, 0, 0.02);
  max-height: 300px;
  overflow-y: auto;
}

.chat-message-agent-text {
  white-space: break-spaces;
}

.chat-message-user-text {
  white-space: break-spaces;
}

table.table-message {
  table-layout: fixed;
  text-overflow: ellipsis;
  text-wrap: pretty;
  width: 100%;
}

table.table-message th,
table.table-message td {
  border: solid 1px black;
  padding: 0px 10px 0px 10px;
}

.chat-message-metrics {
  margin: 0px;
  border-radius: 0px 0px 8px 8px;
  font-size: 10px;
  font-style: normal;
  z-index: 50;
  text-align: right;
}

.chat-message-metrics-agent {
  .chat-message-metrics;
  background-color: #e8e9eb;
}

.chat-message-metrics-user {
  .chat-message-metrics;
  background-color: #e2e0ec;
}

/* hidden metrics */
.chat-message-body-hide-metrics {
  .chat-message-body;
}
.chat-message-body-hide-metrics .chat-message-metrics {
  display: none;
}

.chat-message-body-hide-metrics .tts-metrics {
  display: none;
}

.chat-message-body-hide-metrics:hover {
  border-radius: 8px 8px 0px 0px;
}

.chat-message-body-hide-metrics:hover .chat-message-metrics {
  display: block;
  position: absolute;
  width: 100%;
  transform-origin: 0 0;
  transform: scaleY(0);
  animation: metrics 0.15s ease-out 0s forwards;
}

@keyframes metrics {
  0% {
  }
  100% {
    transform: scaleY(1);
    overflow: visible;
  }
}

.metrics-details {
  display: inline-flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 5px;
  margin-bottom: 5px;
}

.metrics-details > div {
  margin-left: 5px;
  margin-right: 5px;
}

.chat-message-hidden {
  display: none;
  visibility: hidden;
}

.chat-timestamp {
  font-size: 10px;
  font-style: normal;
  color: #aaa;
  position: relative;
  margin: 4px;
  letter-spacing: 0.2px;
}

.chat-timestamp-agent {
  .chat-timestamp;
  margin-left: 40px;
}

.chat-timestamp-user {
  .chat-timestamp;
  text-align: end;
  margin-right: 40px;
}

.agent-icon {
  width: 30px;
  height: 30px;
  border-radius: 15px;
  position: absolute;
  left: 0px;
  font-size: 18px;
  font-style: normal;
  text-align: center;
  line-height: 30px;
  background-color: #e8e9eb;
}

.user-icon {
  width: 30px;
  height: 30px;
  border-radius: 15px;
  position: absolute;
  right: 0px;
  font-size: 14px;
  font-style: normal;
  text-align: center;
  line-height: 30px;
  background: #e2dff0;
  color: #5b4a8a;
  font-family: inherit;
  font-weight: 600;
}

.agent-name {
  font-style: normal;
  font-weight: bold;
  margin-right: 8px;
}

.agent-name:hover .clickable {
  cursor: pointer;
  text-decoration: underline;
  font-weight: bolder;
}

.timeString {
  font-style: normal;
}

.chat-message-explained {
  position: relative;
}

.chat-message-explained-icon {
  align-self: flex-end;
  border: none;
  background-color: transparent;
  margin-right: 5px;
  position: absolute;
  top: 0;
  right: 0;
}

.chat-message-action-data {
  white-space: nowrap;
  font-size: 80%;
}

.chat-message-explained[data-expl]:hover:after {
  content: attr(data-expl);
  position: absolute;
  text-align: right;
  top: 0px;
  right: 30px;
  white-space: nowrap;
  color: gray;
  background-color: lightyellow;
  border: 1px solid black;
  padding: 1px 5px 1px 5px;
  font-size: 70%;
}

.chat-input-button {
  align-self: flex-end;
  border: none;
  background-color: transparent;
  width: 24px;
  height: 24px;
  padding: 0px;
  margin: 6px 3.5px;
  cursor: pointer;
}

.chat-input-button:disabled svg {
  fill: lightslategray;
}

.chat-input-micSelector {
  border: 0px;
  margin-left: 25px;
  background-color: white;
  width: 100%;
  max-width: 85%;
}

.chat-input-dropImage {
  max-width: 96px;
  max-height: 96px;
  width: auto;
  height: auto;
}

.chat-input-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  overflow: auto;
}

.chat-smallImage img {
  max-width: 175px;
  max-height: 175px;
}

.chat-input-separator-container {
  width: 4px;
  margin-bottom: 7px;
}

.chat-input-separator {
  width: 0.5px;
  height: 24px;
  background-color: #bbbbbb;
  position: absolute;
  margin-bottom: 14px;
  vertical-align: bottom;
}

.chat-title {
  width: 100%;
  text-align: center;
  position: absolute;
  font-size: 8px;
  user-select: none;
  opacity: 0.5;
}

@keyframes message {
  0% {
  }
  100% {
    transform: scale(1);
    overflow: visible;
  }
}

@import "./searchMenuCommon.less";

span.ansi-black-fg {
  color: black;
}

span.ansi-red-fg {
  color: rgb(128, 0, 0);
}

span.ansi-green-fg {
  color: rgb(0, 128, 0);
}

span.ansi-yellow-fg {
  color: rgb(128, 128, 0);
}

span.ansi-blue-fg {
  color: rgb(0, 0, 128);
}

span.ansi-magenta-fg {
  color: rgb(128, 0, 128);
}

span.ansi-cyan-fg {
  color: rgb(0, 128, 128);
}

span.ansi-white-fg {
  color: rgb(192, 192, 192);
}

span.ansi-gray-fg span.ansi-bright-black-fg {
  color: rgb(128, 128, 128);
}

span.ansi-bright-red-fg {
  color: rgb(192, 0, 0);
}

span.ansi-bright-green-fg {
  color: rgb(0, 192, 0);
}

span.ansi-bright-yellow-fg {
  color: rgb(192, 192, 0);
}

span.ansi-bright-blue-fg {
  color: rgb(0, 0, 192);
}

span.ansi-bright-magenta-fg {
  color: rgb(192, 0, 192);
}

span.ansi-bright-cyan-fg {
  color: rgb(0, 192, 192);
}

span.ansi-bright-white-fg {
  color: rgb(255, 255, 255);
}

.scroll_enabled::-webkit-scrollbar {
  width: 10px;
}
.scroll_enabled::-webkit-scrollbar-corner {
  background: rgba(0, 0, 0, 0);
}
.scroll_enabled::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 10px;
}
.scroll_enabled::-webkit-scrollbar-thumb:hover {
  background: #555;
}
.scroll_enabled::-webkit-scrollbar-track {
  background-color: rgba(0, 0, 0, 0);
  margin-right: 4px;
}

.clickable {
  cursor: pointer;
}

.metrics {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  max-height: 90%;
  margin-left: 20px;
}

.metric-row {
  display: flex;
  margin-left: 10px;
  margin-bottom: 10px;
}

.metric-label {
  margin-right: 5px;
}

input[type="file"] {
  display: none;
}

.custom-file-upload {
  border: 0px solid #ccc;
  display: inline-block;
  padding: 6px 12px;
  cursor: pointer;
}

.notification-error {
  color: red;
}

.notification-warning {
  color: orange;
}

.notification-info {
  color: blue;
}

.notification-debug {
  color: pink;
}

.action-text table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  margin-bottom: 10px;
}

.action-text tr {
  border-top: 1px solid lightgray;
  border-bottom: 1px solid lightgray;
}
.action-text td {
  padding: 1px 10px 1px 10px;
  height: 22px;
}

.action-text .autocomplete-container {
  bottom: 25px;
}
.action-text td.name-cell {
  width: 30%;
}

.action-text td.value-cell {
  border-left: 1px solid lightgray;
  width: 62%;
}

.action-text td.button-cell {
  padding: 0px;
  text-align: center;
}

.action-text input,
.action-text select,
.action-text button {
  width: 100%;
  height: 100%;
}

.action-button {
  padding: 4px;
  border: lightgray;
  background-color: transparent;
  display: none;
  opacity: 0;
  width: 100%;
}
.action-text-editable .action-button {
  display: block;
  opacity: 0.25;
}

.action-text-editable tr:hover .action-button,
.action-text-editable tr.editing .action-button {
  display: block;
  opacity: 1;
}

.action-text-editable tr.missing .delete-button {
  display: none;
}

.action-text tr.error td.name-cell,
.action-text tr.error input {
  color: red;
  font-weight: bold;
}

.action-text tr.missing {
  display: none;
}

.action-text-editable tr.missing {
  display: table-row;
}

.action-text-editable tr.missing td.name-cell {
  font-style: italic;
  color: lightgray;
}

.references {
  font-size: small;
  font-weight: 400;

  a {
    font-size: small;
    font-weight: 200;
  }
}

.ai-video-container {
  width: auto;
  height: auto;
}

.ai-video {
  width: 100%;
  height: 100%;
}

// ─── Voice Mode Banner ────────────────────────────────────────────────────────

.voice-mode-banner {
  display: none;
  padding: 4px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 2px solid teal;
  border-radius: 6px;
  color: teal;
  text-align: center;
  margin: 4px 8px;
  letter-spacing: 0.05em;
}

.voice-mode-banner.claude-focus {
  border-color: #c87137;
  color: #c87137;
}

// ─── Voice Mode Layout ────────────────────────────────────────────────────────

.voice-mode {
  // Show banner
  .voice-mode-banner {
    display: block;
  }

  // Hide all message history except the last result
  .chat-message-container:not(:last-child) {
    display: none;
  }

  // Make the last result a large, glanceable card
  .chat-message-container:last-child {
    width: 100%;
    margin: 0;
    padding: 0 8px;

    .chat-message-content {
      font-size: 1.4rem;
      line-height: 1.6;
      padding: 20px 24px;
      border-radius: 16px;
    }
  }

  // Larger chat input
  .chat-input {
    .user-textarea {
      font-size: 1.1rem;
      line-height: 1.6;
      min-height: 40px;
    }
  }
}
