/**
 * Global ChatKit Styles
 *
 * This file contains global overrides for the ChatKit UI library.
 * It ensures the chatbot UI matches your site's design.
 *
 * To use: Add this to docusaurus.config.js:
 *   stylesheets: ['/ragchat.css']
 */

/* ChatKit container overrides */
.cs-main-container {
  font-family: inherit;
  background: transparent;
}

.cs-chat-container {
  background: #ffffff;
}

.cs-message-list {
  background: #fafafa;
  padding: 16px;
}

/* Message styling */
.cs-message--incoming .cs-message__content {
  background: #e3f2fd;
  color: #1565c0;
  border-radius: 18px 18px 18px 4px;
  padding: 12px 16px;
  max-width: 80%;
}

.cs-message--outgoing .cs-message__content {
  background: #1976d2;
  color: white;
  border-radius: 18px 18px 4px 18px;
  padding: 12px 16px;
  max-width: 80%;
}

/* Avatar styling */
.cs-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.cs-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Message input styling */
.cs-message-input {
  border-top: 1px solid #e0e0e0;
  background: white;
  padding: 12px 16px;
}

.cs-message-input__content-editor {
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 20px;
  background: #fafafa;
  transition: all 0.2s;
}

.cs-message-input__content-editor:focus {
  outline: none;
  border-color: #1976d2;
  background: white;
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.cs-button--send {
  background: #1976d2;
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.cs-button--send:hover:not(:disabled) {
  background: #1565c0;
}

.cs-button--send:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Typing indicator */
.cs-typing-indicator {
  padding: 8px 16px;
  margin: 8px 0;
}

.cs-typing-indicator__dot {
  background: #1976d2;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: 0 2px;
  animation: bounce 1.4s infinite ease-in-out both;
}

.cs-typing-indicator__dot:nth-child(1) {
  animation-delay: -0.32s;
}

.cs-typing-indicator__dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Scrollbar styling for message list */
.cs-message-list__scroll-wrapper::-webkit-scrollbar {
  width: 8px;
}

.cs-message-list__scroll-wrapper::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.cs-message-list__scroll-wrapper::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.cs-message-list__scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Dark mode support */
[data-theme='dark'] .cs-chat-container {
  background: #1e1e1e;
}

[data-theme='dark'] .cs-message-list {
  background: #252525;
}

[data-theme='dark'] .cs-message--incoming .cs-message__content {
  background: #2d3748;
  color: #e2e8f0;
}

[data-theme='dark'] .cs-message--outgoing .cs-message__content {
  background: #3182ce;
  color: white;
}

[data-theme='dark'] .cs-message-input {
  background: #2d2d2d;
  border-top-color: #444;
}

[data-theme='dark'] .cs-message-input__content-editor {
  background: #3a3a3a;
  border-color: #555;
  color: #e2e8f0;
}

[data-theme='dark'] .cs-message-input__content-editor:focus {
  background: #404040;
  border-color: #3182ce;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .cs-message--incoming .cs-message__content,
  .cs-message--outgoing .cs-message__content {
    max-width: 90%;
    font-size: 14px;
  }

  .cs-message-input__content-editor {
    font-size: 13px;
  }

  .cs-avatar {
    width: 28px;
    height: 28px;
  }
}
