/*
 * Basic styling for the chatbot interface.
 * The page uses a flexbox layout to center the chat container
 * and ensures a responsive design for both mobile and desktop screens.
 */

/* Global styles */
body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* The main chat container */
.chat-container {
  width: 90%;
  max-width: 600px;
  height: 80vh;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  padding: 16px;
  box-sizing: border-box;
}

/* The unordered list that holds chat messages */
.chat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
}

/* Styling for individual message bubbles */
.message {
  margin-bottom: 10px;
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 10px;
  line-height: 1.4;
  word-wrap: break-word;
  /* Preserve whitespace and line breaks to align bullets and paragraphs */
  white-space: pre-wrap;
}

/* Bot message bubbles */
.message.bot {
  background-color: #e6e6e6;
  align-self: flex-start;
  color: #333333;
}

/* User message bubbles */
.message.user {
  background-color: #007bff;
  color: #ffffff;
  align-self: flex-end;
}

/* Container for choice buttons */
.choices {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Individual choice buttons */
.choice-button {
  padding: 10px;
  border: none;
  border-radius: 5px;
  background-color: #f0f0f0;
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
  transition: background-color 0.2s ease;
}

/* Hover state for buttons */
.choice-button:hover {
  background-color: #e0e0e0;
}

/* Restart button styling */
.restart-button {
  background-color: #28a745;
  color: #ffffff;
}

.restart-button:hover {
  background-color: #218838;
}

/* Link preview styles */
.link-preview {
  margin-top: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.link-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.link-preview span {
  padding: 8px;
  font-size: 0.85rem;
  color: #007bff;
  word-break: break-all;
}

/* Additional styles for the screenshot upload flow */
.upload-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#screenshot-input {
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.send-button {
  background-color: #28a745;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 10px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.send-button:hover:not(:disabled) {
  background-color: #218838;
}

.send-button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.uploaded-image {
  max-width: 100%;
  height: auto;
  border-radius: 5px;
  margin-top: 4px;
}