.ctxh-chatbox-wrapper {
  font-family: "Inter", sans-serif;
  display: flex;
  justify-content: center;
  padding: 16px;
  width: 100%;
  min-height: 400px;
  box-sizing: border-box;
  margin: 0 auto;
}

.ctxh-chatbox-window {
  width: 100%;
  max-width: 400px;
  background-color: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
}

.ctxh-chatbox-header {
  background-color: #2563eb;
  color: white;
  padding: 16px;
  display: flex;
  align-items: center;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.ctxh-chatbox-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.ctxh-chatbox-messages {
  height: 500px;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.message-line {
  display: flex;
  margin-bottom: 12px;
}

.user-line {
  justify-content: flex-end;
}

.ai-line {
  justify-content: flex-start;
}

.message-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  max-width: 85%;
  word-wrap: break-word;
  line-height: 1.5;
  font-size: 0.95rem;
}

.user-message {
  background-color: #3b82f6;
  color: white;
  border-bottom-right-radius: 6px;
}

.ai-message {
  background-color: #f3f4f6;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 6px;
}

.ctxh-chatbox-input-area {
  padding: 16px;
  border-top: 1px solid #e5e7eb;
}

.ctxh-chatbox-input-group {
  display: flex;
}

.ctxh-chatbox-input {
  flex-grow: 1;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-right: none;
  border-radius: 8px 0 0 8px;
  outline: none;
  transition: border-color 0.15s;
}

.ctxh-chatbox-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.ctxh-chatbox-button {
  background-color: #2563eb;
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 0 8px 8px 0;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
}

.ctxh-chatbox-button:hover:not(:disabled) {
  background-color: #1d4ed8;
}

.ctxh-chatbox-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.loading-dots {
  display: flex;
  align-items: center;
}

.loading-dots div {
  width: 8px;
  height: 8px;
  background-color: #9ca3af;
  border-radius: 50%;
  display: inline-block;
  margin: 0 2px;
  animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots div:nth-child(1) {
  animation-delay: -0.32s;
}
.loading-dots div:nth-child(2) {
  animation-delay: -0.16s;
}
.loading-dots div:nth-child(3) {
  animation-delay: 0s;
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

@media (max-width: 640px) {
  .ctxh-chatbox-window {
    border-radius: 0;
    box-shadow: none;
  }
  .ctxh-chatbox-messages {
    height: 60vh;
  }
  .ctxh-chatbox-header {
    padding: 12px;
  }
  .ctxh-chatbox-header h3 {
    font-size: 1.1rem;
  }
}
