/*
 * Copyright (C) 2024 Microsoft Corporation
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #222;
  color: #ddd;
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: normal;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

h1 {
  margin-left: 5%;
  width: 90%;
  font-size: 36px;
  margin-bottom: 20px;
  text-align: center;
}

.message-name code {
  color: #333;
}

.chat {
  background-color: #333;
  border-radius: 5px;
  padding: 20px;
  margin-bottom: 50px;
}

.chat-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  position: fixed;
  bottom: 50px;
  left: 10%;
  width: 80%;
}

.chat-input form {
  flex: 1;
  display: flex;
  margin-right: 10px;
}

.chat-input textarea#message-input {
  width: 100%;
  min-height: 40px;
  max-height: 150px;
  padding: 10px;
  font-size: 16px;
  border-radius: 5px;
  border: none;
  background-color: #444;
  color: #ddd;
  resize: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
}

.chat-input button[type="submit"] {
  margin-top: 10px;
  height: 40px;
  width: 40px;
  border-radius: 5px;
  background-color: #3f51b5;
  border: none;
  color: #ddd;
  font-size: 24px;
  cursor: pointer;
  margin-left: 5px;
}

.chat-input button[type="submit"].busy {
  background-color: transparent;
  cursor: not-allowed;
}

.chat-input button#clear-button {
  margin-top: 10px;
  height: 40px;
  width: 40px;
  border-radius: 5px;
  background-color: #f44336;
  border: none;
  color: #ddd;
  font-size: 24px;
  cursor: pointer;
  margin-left: 5px;
}

.chat-history {
  /* needs to leave some space free in the bottom for the input */
  padding-bottom: 80px;
}

.chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 300px;
  overflow-y: auto;
}

.message-data {
  margin-bottom: 5px;
}

.message-name {
  font-weight: bold;
}

.message {
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 10px;
  padding-left: 20px;
  font-family: monospace;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.message pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-even {
  background-color: #284534;
}

.message-odd {
  background-color: #456;
}

.message-error {
  background-color: #5f2336;
}

.message a, .more-examples a {
  color: #1E90FF;
  text-decoration: none;
}

.message a:hover, .more-examples a:hover {
  text-decoration: underline;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.spinner {
  animation: spin 1s linear infinite;
}

.status {
  position: fixed;
  left: 10%;
  bottom: 0;
  width: 40%;
  text-align: center;
}

.build-id {
  bottom: 0;
  right: 10%;
  width: 40%;
  position: fixed;
  text-align: center;
  text-overflow: ellipsis;
  font-family: monospace;
}

.more-examples {
  bottom: 0;
  right: 1%;
  width: 5%;
  position: fixed;
  text-align: center;
  text-overflow: ellipsis;
  font-family: monospace;
}

.confirmation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirmation-dialog {
  background-color: #333;
  border-radius: 5px;
  padding: 20px;
  text-align: center;
}

.confirmation-dialog button {
  background-color: #444;
  color: #ddd;
  border: none;
  border-radius: 5px;
  padding: 8px 16px;
  font-size: 16px;
  cursor: pointer;
  margin: 5px;
}

.confirmation-dialog button:hover {
  background-color: #555;
}

#hamburger-button {
  position: fixed;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  background-color: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  cursor: pointer;
  z-index: 1000;
}

.hamburger-line {
  width: 24px;
  height: 3px;
  background-color: #ddd;
  border-radius: 2px;
}

ul#message-list {
  list-style-type: none;
}

#hamburger-button.open .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

#hamburger-button.open .hamburger-line:nth-child(2) {
  opacity: 0;
}

#hamburger-button.open .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.sidebar {
  position: fixed;
  top: 0;
  right: -50%;
  width: 50%;
  height: 100%;
  background-color: #333;
  padding: 20px;
  overflow-y: auto;
  transition: right 0.3s;
  z-index: 999;
}

.sidebar.open {
  right: 0;
}

#chain-of-thought {
  white-space: pre-wrap;
  color: #ddd;
}

/* Add this after the #chain-of-thought block */
.chain-of-thought-container {
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 5px;
}

.chain-of-thought-container:nth-child(even) {
  background-color: #444;
}

.chain-of-thought-container:nth-child(odd) {
  background-color: #555;
}

.observation {
  color: #FF69B4;
  display: block;
}

.thought {
  color: #24CE90;
  display: block;
}

.message ol, .message ul {
  margin-left: 3em;
  margin-top: -2em;
  margin-bottom: -1em;
}

.message li {
  margin-top: -1em;
  margin-bottom: -.5em;
  margin-left: 1em;
}

@media (max-width: 767px) {
  .container {
    padding: 10px;
  }

  #send-button {
    display: none
  }

  h1 {
    font-size: 24px;
  }

  body {
    font-size: 14px;
  }

  .chat-input {
    bottom: 10px;
    left: 5%;
    width: 90%;
  }

  .status {
    left: 5%;
    bottom: 0;
    width: 90%;
  }

  .sidebar {
    width: 100%;
    right: -100%;
  }

  #hamburger-button {
    top: 5px;
    right: 5px;
  }

  .system-status {
    font-size: 8px;
  }

  .build-id {
    display: none;
  }

  .more-examples {
    bottom: 0;
    right: 2.5%;
    width: 5%;
    font-size: 16px;
    font-weight: bold;
    position: fixed;
    text-align: center;
    text-overflow: ellipsis;
    font-family: monospace;
  }

}
