/* Prompt Alchemist Assistant Styles */

.prompt-alchemist-container {
  max-width: 800px;
  margin: 0 auto;
  font-family: "Open Sans", sans-serif;
}

.prompt-alchemist-chat {
  display: flex;
  flex-direction: column;
  background-color: #f5f5f5;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  min-height: 500px;
  position: relative;
  /* Mobile messaging app style */
  background-image: linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.7)),
    url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23dcdcdc' fill-opacity='0.4' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.chat-header {
  background-color: #4a6cf7;
  color: white;
  padding: 16px;
  text-align: center;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.chat-header h3 {
  margin: 0;
  font-size: 18px;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  max-height: 600px;
  display: flex;
  flex-direction: column;
}

.chat-message-container {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
  max-width: 85%;
  animation: fadeIn 0.3s ease-in-out;
}

.chat-message-container.bot {
  align-self: flex-start;
}

.chat-message-container.user {
  align-self: flex-end;
}

.chat-message-container.system {
  align-self: center;
  max-width: 90%;
}

.chat-bubble {
  padding: 12px 16px;
  position: relative;
  border-radius: 18px;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-bubble p {
  margin: 0;
}

.chat-bubble.bot {
  background-color: white;
  color: #333;
  border-bottom-left-radius: 4px;
  margin-right: auto;
}

/* Chat bubble tail for bot messages */
.chat-bubble.bot:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -10px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-bottom-right-radius: 16px;
  z-index: -1;
}

.chat-bubble.bot:before {
  content: "";
  position: absolute;
  bottom: 0;
  left: -20px;
  width: 20px;
  height: 20px;
  background-color: #f5f5f5;
  border-bottom-right-radius: 10px;
  z-index: -1;
}

.chat-bubble.user {
  background-color: #4a6cf7;
  color: white;
  border-bottom-right-radius: 4px;
  margin-left: auto;
  text-align: right;
}

/* Chat bubble tail for user messages */
.chat-bubble.user:after {
  content: "";
  position: absolute;
  bottom: 0;
  right: -10px;
  width: 20px;
  height: 20px;
  background-color: #4a6cf7;
  border-bottom-left-radius: 16px;
  z-index: -1;
}

.chat-bubble.user:before {
  content: "";
  position: absolute;
  bottom: 0;
  right: -20px;
  width: 20px;
  height: 20px;
  background-color: #f5f5f5;
  border-bottom-left-radius: 10px;
  z-index: -1;
}

/* System message styling */
.chat-bubble.system {
  background-color: #fffde7;
  color: #5f5f5f;
  border: 1px solid #fff9c4;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message-metadata {
  font-size: 12px;
  margin-top: 4px;
  opacity: 0.7;
}

.message-metadata.bot {
  margin-left: 8px;
}

.message-metadata.user {
  margin-right: 8px;
  text-align: right;
}

.message-metadata.system {
  text-align: center;
  font-size: 11px;
  opacity: 0.6;
}

.chat-input-container {
  padding: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background-color: white;
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
}

.chat-input-form {
  display: flex;
  width: 100%;
  gap: 12px;
  align-items: center;
}

.chat-input-field {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  font-family: "Open Sans", sans-serif;
  font-size: 16px;
  transition: border-color 0.2s ease;
  background-color: #f8f8f8;
}

.chat-input-field:focus {
  border-color: #4a6cf7;
  outline: none;
  background-color: white;
}

.chat-input-button {
  padding: 12px 24px;
  background-color: #4a6cf7;
  color: white;
  border: none;
  border-radius: 24px;
  font-family: "Open Sans", sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-input-button.icon {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
}

.chat-input-button.secondary {
  background-color: #f0f0f0;
  color: #333;
  margin-left: 8px;
}

.chat-input-button svg {
  width: 24px;
  height: 24px;
}

.chat-input-button:hover {
  background-color: #3a5ce5;
}

.chat-input-button.secondary:hover {
  background-color: #e0e0e0;
}

.chat-input-button:disabled {
  background-color: #c0c0c0;
  cursor: not-allowed;
}

.chat-output {
  background-color: #f5f5f5;
  padding: 16px;
  border-radius: 8px;
  margin-top: 12px;
  font-family: monospace;
  white-space: pre-wrap;
  overflow-x: auto;
  border: 1px solid #e0e0e0;
  max-height: 300px;
  overflow-y: auto;
}
/* Style for the resubmit button */
.action-button.resubmit {
  background-color: #4a6cf7;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.action-button.resubmit:hover {
  background-color: #3a5ce7;
}
.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.action-button {
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.action-button.copy {
  background-color: #f0f0f0;
  color: #333;
  border: 1px solid #ddd;
}

.action-button.refine {
  background-color: #4a6cf7;
  color: white;
  border: 1px solid #4a6cf7;
}

.action-button.retry {
  background-color: white;
  color: #4a6cf7;
  border: 1px solid #4a6cf7;
}

.action-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  background-color: white;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  padding: 15px 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  width: fit-content;
  position: relative;
  margin-bottom: 16px;
  align-self: flex-start;
}

/* Chat bubble tail for typing indicator */
.typing-indicator:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -10px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-bottom-right-radius: 16px;
  z-index: -1;
}

.typing-indicator:before {
  content: "";
  position: absolute;
  bottom: 0;
  left: -20px;
  width: 20px;
  height: 20px;
  background-color: #f5f5f5;
  border-bottom-right-radius: 10px;
  z-index: -1;
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  background-color: #4a6cf7;
  border-radius: 50%;
  display: inline-block;
  margin: 0 2px;
  opacity: 0.6;
}

.typing-indicator span:nth-child(1) {
  animation: blink 1s infinite 0.2s;
}

.typing-indicator span:nth-child(2) {
  animation: blink 1s infinite 0.4s;
}

.typing-indicator span:nth-child(3) {
  animation: blink 1s infinite 0.6s;
}

/* Retry container */
.retry-container {
  display: flex;
  width: 100%;
  gap: 8px;
}

/* Connection status indicator */
.connection-status {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.8);
}

.connection-status.online {
  color: #4caf50;
}

.connection-status.offline {
  color: #f44336;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes blink {
  0% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.3;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Message status indicators */
.message-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 12px;
  margin-top: 2px;
  color: #888;
}

.message-status.sent .status-icon,
.message-status.delivered .status-icon,
.message-status.read .status-icon {
  margin-left: 4px;
  width: 16px;
  height: 16px;
}

/* Responsive styles */
@media (max-width: 768px) {
  .chat-message-container {
    max-width: 90%;
  }

  .action-buttons {
    flex-direction: column;
  }

  .action-button {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .chat-input-form {
    flex-wrap: wrap;
  }
}
