/*

This CSS file will be included with your plugin, and
available in the app when your plugin is enabled.

If your plugin does not need CSS, delete this file.

*/

.button-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.button-container .mod-cta {
  flex: 1; /* Make buttons take equal width */
  margin: 25px; /* Adds some space between buttons */
}

.warning-message {
  background-color: black;
  color: orange;
  padding: 10px;
  margin: 10px 0;
  border-radius: 5px;
  border: 1px solid orange;
  font-weight: bolder;
  text-align: center;
}

.copilot-setting-item-name {
  font-weight: bold;
  display: block;
  color: var(--inline-title-color);
  margin-top: 20px;
  margin-bottom: 10px;
}

.copilot-setting-item-description {
  display: block;
  margin-top: 10px;
  margin-bottom: 10px;
}

.copilot-setting-item-control {
  width: 50%; /* Adjust the width as needed */
  max-width: 100%; /* Ensures it doesn't exceed the parent width */
}

.copilot-setting-item-control::placeholder {
  color: gray; /* Set the color you want for the placeholder text */
  opacity: 0.5; /* Adjust for lighter appearance */
}

.copilot-setting-item-control[type="range"] {
  width: 70%;
}

.chat-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden; /* Fix overflow and can't scroll up */
}

.bottom-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  width: 100%;
  flex: 0 0 auto;
  box-sizing: border-box;
}

.chat-icons-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 8px 8px 0;
  order: 1;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-scaler {
  transform: scale(1.6);
}

.tooltip-text {
  visibility: hidden;
  opacity: 0;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 5px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 100%;
  left: 50%;
  margin-bottom: 4px;
  transform: translateX(-50%);
  transition: opacity 0.3s;
}

.select-wrapper {
  position: relative;
  display: inline-block;
}

.select-wrapper:hover .tooltip-text,
.chat-icon-button.clickable-icon:hover .tooltip-text {
  visibility: visible !important;
  opacity: 1 !important;
}

.chat-icon-button.clickable-icon {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 22px !important;
  height: 22px !important;
  cursor: pointer !important;
  position: relative !important;
}

.chat-icon-selection {
  color: var(--inline-title-color);
}

.chat-input-container {
  display: flex;
  padding: 8px;
  box-sizing: border-box;
  flex-grow: 1;
  width: 100%;
  order: 2;
  position: relative;
}

.chat-input-container textarea {
  width: 100%;
  margin-right: 0;
  margin-bottom: 8px;
  resize: none;
  overflow: auto;
  min-height: 60px;
  max-height: 200px;
  box-sizing: border-box;
  border: 1px solid gray;
  border-radius: 10px;
  padding: 15px 60px 15px 15px;
}

.chat-input-container textarea::placeholder {
  color: var(--inline-title-color);
  opacity: 0.5;
}

.chat-input-container button {
  position: absolute;
  right: 22px;
  bottom: 31px;
  padding: 8px;
  margin: 0;
  z-index: 1;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-size: calc(var(--font-text-size) - 2px);
  box-sizing: border-box;
  scroll-behavior: smooth;
  margin-top: auto;
  user-select: text;
}

.chat-message-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 8px;
}

.message {
  display: flex;
  padding: 0;
  border-radius: 4px;
  position: relative;
  margin-bottom: 0;
}

.message-icon {
  width: 24px;
  margin-right: 8px;
  color: var(--inline-title-color);
  flex-shrink: 0;
}

.message-content-wrapper {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  max-width: 100%;
}

.message-content {
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.6 !important;
}

.message-content p {
  margin-top: 0;
  margin-bottom: 0;
}

.message-content table {
  margin-top: 15px;
  margin-bottom: 15px;
}

/* Style for inline code */
.message-content code {
  background-color: var(--code-background);
  padding: 2px 4px;
  border-radius: 3px;
  color: var(--code-normal);
}

/* Style for code blocks */
.message-content pre {
  background-color: var(--background-primary-alt);
  border-radius: 4px;
  padding: 10px;
  border: 1px solid var(--background-modifier-border);
}

.message-content pre code {
  background-color: transparent;
  padding: 0;
  color: var(--code-normal);
  line-height: 1.5 !important;
  display: block;
}

/* Style for the copy button in code blocks */
.message-content pre {
  position: relative;
}

.message-content pre .copy-code-button {
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px 8px;
  color: var(--text-muted);
  background-color: var(--background-primary);
  border: 1px solid var(--background-modifier-border);
  border-radius: 0 4px 0 4px;
  font-size: 0.8em;
  transition: all 0.1s ease;
  opacity: 0;
}

.message-content pre:hover .copy-code-button {
  opacity: 1;
}

.message-content pre .copy-code-button:hover {
  background-color: var(--background-modifier-hover);
  color: var(--text-normal);
}

.message-content ul,
.message-content ol {
  padding-left: 20px;
  margin: 10px;
}

.message-buttons-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.message-timestamp {
  font-size: 0.7em;
  color: var(--text-faint, #bbb);
  opacity: 0.7;
  font-style: italic;
}

.chat-message-buttons {
  display: flex;
  gap: 4px;
  align-items: center;
  height: 24px;
  margin-left: auto;
}

.chat-message-buttons button {
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.chat-message-buttons button:hover {
  color: var(--text-normal);
}

.chat-message-buttons button svg {
  width: 16px;
  height: 16px;
}

.user-message {
  white-space: pre-wrap;
  width: 95%;
  color: var(--inline-title-color);
}

.bot-message {
  width: 95%;
}

.copilot-command-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.copilot-command-input-container {
  width: 90%;
  margin: auto;
}

.copilot-command-input-container input,
.copilot-command-input-container textarea {
  display: block;
  width: 100%;
  margin-top: 10px;
}

.copilot-command-input-container textarea {
  height: 150px;
  resize: vertical;
}

.copilot-command-save-btn-container {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.copilot-command-save-btn {
  margin-top: 15px;
}

.model-settings-table {
  border-collapse: collapse;
  width: 100%;
}

.model-settings-table th,
.model-settings-table td {
  text-align: center;
  vertical-align: middle;
  padding: 0.5em;
  border: none !important;
  height: 2.5em;
}

.model-settings-table th {
  font-weight: bold;
}

.model-settings-table th:nth-child(1) {
  width: 10%;
}

.model-settings-table th:nth-child(2) {
  width: 50%;
}

.model-settings-table th:nth-child(3) {
  width: 16%;
}

.model-settings-table th:nth-child(4),
.model-settings-table th:nth-child(5),
.model-settings-table th:nth-child(6) {
  width: 8%;
}

.model-settings-table .switch {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  margin-top: -1.2em;
}

.add-custom-model {
  margin-top: 20px;
}

.switch.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.switch.disabled input:checked + .slider {
  background-color: #ccc;
}

.switch.disabled input:focus + .slider {
  box-shadow: 0 0 1px #ccc;
}

.switch.disabled input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

.model-select {
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select-wrapper::after {
  content: "\25BC";
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  pointer-events: none;
}

.add-model-button {
  margin-top: 15px;
}

.edit-textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
  overflow-y: hidden;
}

.edit-textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.copilot-notice-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
}

.copilot-notice-message {
  margin-bottom: 16px;
}

.copilot-notice-container button {
  align-self: flex-end;
  margin-top: 16px;
  margin-left: auto;
}

.similar-notes-modal-container {
  width: 80vw;
  height: 80vh;
}

.similar-notes-modal {
  max-width: 100%;
  max-height: 100%;
}

.similar-notes-container {
  max-height: calc(80vh - 100px);
  overflow-y: auto;
  padding: 10px;
}

.similar-note-item {
  margin-bottom: 10px;
}

.similar-note-title {
  cursor: pointer;
  color: var(--text-accent);
}

.similar-note-item details > summary {
  list-style: none;
}

.similar-note-item details > summary::before {
  content: "▶";
  display: inline-block;
  width: 20px;
  transition: transform 0.3s;
}

.similar-note-item details[open] > summary::before {
  transform: rotate(90deg);
}

.similar-note-item details > p {
  margin-left: 20px;
  margin-top: 5px;
}
