/* ========== General Container Styling ========== */
.chat-container {
  width: 90%;
  max-width: 800px;
  margin: auto;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  font-family: 'Arial', sans-serif;
}

/* ========== Chatbox Styling ========== */
.chat-box {
  height: 600px; /* Fixed height for the chatbox */
  overflow-y: auto;
  padding: 10px;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  position: relative; /* Prevents unintended expansion */
}

/* ========== Message Styling ========== */
.chat-box .chat-bubble {
  padding: 0 10px;
  border-radius: 12px;
  max-width: 70%;
  margin-bottom: 10px;
  word-wrap: break-word; /* Ensures long words are broken */
  overflow-wrap: break-word; /* Ensures long words are broken */
}

.chat-box .chat-bubble.user-message {
  background-color: #007bff !important;
  color: white !important;
  align-self: flex-end;
}

.chat-box .chat-bubble.bot-message {
  background-color: #e0e0e0 !important;
  color: black !important;
  align-self: flex-start;
}

.chat-bubble a {
  pointer-events: none;
  text-decoration: none;
  font-weight: none;
  font-style: none;
  color: white !important;
}

/* Typing Indicator */
.chat-bubble.typing-indicator {
  min-height: 10px; /* Adjust as needed */
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 15px; /* Add some padding */
}

/* Typing Indicator Animation */
.typing-indicator {
  display: flex;
  gap: 6px;
  align-items: center;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background-color: #666;
  border-radius: 50%;
  animation: typingAnimation 1.5s infinite ease-in-out;
}

/* Create delay for each dot */
.typing-indicator span:nth-child(1) {
  animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingAnimation {
  0% {
    opacity: 0.2;
    transform: translateY(0px);
  }
  50% {
    opacity: 1;
    transform: translateY(-4px);
  }
  100% {
    opacity: 0.2;
    transform: translateY(0px);
  }
}

.chat-box .chat-bubble p {
  margin-top: 10px;
  margin-bottom: 10px;
}

/* Target all pre elements under .chat-box .chat-bubble */
.chat-box .chat-bubble pre {
  overflow: scroll;
}

/* ========== Input Box Styling ========== */
.input-box {
  display: flex;
  margin-top: 20px;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.input-box textarea {
  flex: 1;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
  font-family: 'Arial', sans-serif;
  resize: none; /* Prevent manual resizing */
  min-height: 40px;
  max-height: 150px; /* Allow growth up to this point */
  height: 40px;
  overflow-y: auto; /* Enable vertical scrolling */
}


/* Placeholder Styling */
.input-box textarea::placeholder {
  color: #888;
}

/* ========== Button Styling ========== */
button {
  padding: 12px 18px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-left: 10px;
  font-size: 16px;
}

button:hover {
  background-color: #0056b3;
}

button:disabled {
  background-color: #d3d3d3; /* Light grey background */
  color: #888; /* Grey text */
  cursor: not-allowed; /* Change the cursor to indicate it's disabled */
}
