.chatbot-modal .modal-dialog {
  max-width: 90vw;
}
.chatbot-modal .modal-content {
  background: linear-gradient(180deg, #ffffff 0%, #f7f4ff 100%);
  border-radius: 1rem;
  overflow: hidden;
  height: 80vh;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(99, 102, 241, 0.15);
  box-shadow: 0 20px 60px rgba(30, 41, 59, 0.2);
  color: #1f2937;
}
.chatbot-modal .modal-body {
  flex: 1;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.chatbot-modal .modal-header {
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  background: linear-gradient(90deg, rgba(255, 99, 71, 0.12), rgba(59, 130, 246, 0.12));
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  color: #1f2937;
}
.chatbot-modal .modal-title {
  font-size: 1.2rem;
  color: #1f2937;
}

.chatbot-modal .modal-header p {
  color: #1f2937;
}

.chatbot-header-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.chatbot-status {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6rem;
}

.chatbot-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.75rem;
  background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.08), transparent 55%), radial-gradient(circle at bottom right, rgba(249, 115, 22, 0.08), transparent 60%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chatbot-message {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
  animation: fadeInUp 0.3s ease-out;
}
.chatbot-message-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border-bottom-right-radius: 0.35rem;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
}
.chatbot-message-assistant {
  align-self: flex-start;
  background: #ffffff;
  color: #1f2937;
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-bottom-left-radius: 0.35rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.chatbot-meta {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chatbot-confidence {
  font-size: 0.6rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.12);
  color: #3730a3;
  margin-left: auto;
  align-self: flex-end;
}

.chatbot-sources {
  width: 100%;
  font-size: 0.65rem !important;
}
.chatbot-sources .chatbot-source .btn-sm {
  margin-right: 8px;
  margin-bottom: 3px;
  font-size: inherit;
}
.chatbot-sources a {
  /* color: #2563eb;
  text-decoration: underline; */
}

.chatbot-footer {
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  border-top: 1px solid rgba(99, 102, 241, 0.15);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(6px);
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.chatbot-error {
  width: 100%;
  margin: 0;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.chatbot-scroll-btn {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: #1f2937;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
  z-index: 2;
}
.chatbot-scroll-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.chatbot-counter {
  font-size: 0.6rem;
}

.chatbot-input .form-control {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgba(99, 102, 241, 0.25);
  box-shadow: none;
}
.chatbot-input .form-control:focus {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.15);
}

.chatbot-actions .btn {
  min-width: 110px;
}
.chatbot-actions .btn i.uil {
  padding: 0 4px 0 1px;
}

@media (max-width: 767px) {
  .chatbot-messages {
    padding: 1rem;
  }
  .chatbot-message {
    max-width: 100%;
  }
}