/* --- AI and User Message Styles --- */
.raw-typer-output .ai-message {
  color: #333;
  margin-top: 8px;
  margin-bottom: 8px;
  margin-right: auto;
  max-width: 90%;
  text-align: left;
  word-wrap: break-word;
}

.raw-typer-output .user-message {
  background-color: #007bff;
  color: white;
  padding: 10px 15px;
  border-radius: 15px;
  margin-top: 8px;
  margin-bottom: 8px;
  margin-left: auto;
  margin-right: 10px;
  max-width: 70%;
  width: fit-content;
  word-wrap: break-word;
}

/* --- Feedback Controls --- */
.feedback-controls {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
  /* This height helps prevent layout shift */
  min-height: 20px; 
}

/* The "Was this helpful?" text */
.feedback-text {
  font-size: 12px;
  color: #666;
  margin-right: 4px;
}

/* Hide feedback on older messages by default */
.ai-message:not(.latest) .feedback-controls {
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

/* Show feedback on hover for older messages */
.ai-message:not(.latest):hover .feedback-controls {
  opacity: 1;
}

.feedback-button {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: #666;
  opacity: 0.7;
  transition: all 0.2s ease-in-out;
}

.feedback-button:hover {
  opacity: 1;
  color: #000;
}

.feedback-button svg {
  width: 16px;
  height: 16px;
  display: block;
}

.feedback-button.selected {
  opacity: 1;
  color: #2d2d2d;
}

/* --- Main Chat Area Layout --- */
.raw-typer-output {
  margin-top: 1em;
  padding: 1em;
  min-height: 50px;
  background: #fff;
  white-space: normal;
  word-wrap: break-word;
  width: 100%;
  height: 100%;
  overflow: auto;
}

/* --- Typing Indicator and Cursor --- */
.raw-typer-output .cursor {
  margin-bottom: 2px !important;
  display: inline-block;
  width: 6px;
  height: 1em;
  background: #333;
  margin-left: 1px;
  animation: raw-contr-blink 1s infinite;
  vertical-align: bottom;
}

@keyframes raw-contr-blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.loading-dots {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 10px;
  margin-bottom: 10px;
}

.loading-dots .dot {
  background-color: #a0a0a0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: 0 4px;
  animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots .dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots .dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1.0);
  }
}

/* --- Code Block Formatting --- */
.raw-typer-output pre > code {
  background-color: #f3f3f3;
  display: block;
  overflow-x: auto;
  padding: 1em;
}

.raw-typer-output p > code {
  background-color: #f3f3f3;
  padding: 0.4em;
}

/* --- Chat Input Area --- */
.gpt-input-wrapper {
  position: absolute;
  bottom: 0;
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 32px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  padding: 12px;
  margin: 24px;
  width: calc(100% - 48px);
  gap: 8px;
  box-sizing: border-box;
  align-self: center;
}

.gpt-input-wrapper .gpt-textarea {
  padding: 12px 12px 0px 12px;
  height: 80%;
  resize: none;
  border: none;
  outline: none;
  font-size: 18px;
  line-height: 1.5;
  border-radius: 24px;
  font-family: inherit;
  box-sizing: border-box;
  min-height: 24px;
  max-height: 200px;
  white-space: pre-wrap;
  word-break: break-word;
  width: 100%;
}

.gpt-input-wrapper .gpt-cc-buttons {
  display: flex;
  justify-content: end;
  align-items: center;
}

.gpt-input-wrapper .gpt-button-talk {
  display: none;
  border-width: 1px;
  border-color: #0d0d0d1a;
  background-color: #0000;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  margin-right: 10px;
}

.gpt-input-wrapper .gpt-send {
  background: black;
  color: white;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  margin-right: 10px;
}

.gpt-input-wrapper .gpt-send:hover {
  background: #333;
}

.gpt-input-wrapper.gpt-input-wrapper-disabled .gpt-send {
  cursor: inherit;
  background-color: #333;
}