/**
 * Docs Chatbot Styles
 * Dark theme chat panel integrated into sidebar
 * Toggle between traditional nav/search and NLP chatbot
 */

/* Mode Toggle in Sidebar Header */
.docs-sidebar-mode-toggle {
  display: flex;
  background: #2d2d30;
  border-radius: 6px;
  padding: 3px;
  margin: 12px 16px;
}

.docs-mode-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: #858585;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.docs-mode-btn:hover {
  color: #d4d4d4;
}

.docs-mode-btn.active {
  background: var(--accent, #fd6c1d);
  color: white;
}

.docs-mode-btn i {
  font-size: 11px;
}

/* Sidebar in Chat Mode */
.docs-sidebar.chat-mode {
  background: #1e1e1e;
  border-right-color: #333;
}

.docs-sidebar.chat-mode .docs-sidebar-header {
  background: #252526;
  border-bottom-color: #333;
}

.docs-sidebar.chat-mode .docs-sidebar-header h2 {
  color: #d4d4d4;
}

/* Hide nav content when in chat mode */
.docs-sidebar.chat-mode .docs-search-container,
.docs-sidebar.chat-mode .docs-nav-api-link,
.docs-sidebar.chat-mode .docs-nav {
  display: none;
}

/* Show chat panel when in chat mode */
.docs-chat-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: #1e1e1e;
}

.docs-sidebar.chat-mode .docs-chat-panel {
  display: flex;
}

/* Chat Header */
.docs-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #252526;
  border-bottom: 1px solid #333;
}

.docs-chat-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1e1e1e;
  padding: 6px 12px;
  border-radius: 4px 4px 0 0;
  border: 1px solid #333;
  border-bottom: none;
}

.docs-chat-tab-icon {
  font-size: 14px;
  color: var(--accent, #fd6c1d);
}

.docs-chat-title {
  font-size: 13px;
  font-weight: 600;
  color: #d4d4d4;
  margin: 0;
  font-family: 'Courier New', monospace;
}

.docs-chat-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.docs-chat-control-btn {
  background: none;
  border: none;
  color: #858585;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  line-height: 1;
}

.docs-chat-control-btn:hover {
  background: #333;
  color: #d4d4d4;
}

/* Messages Container */
.docs-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #1e1e1e;
  font-family: 'Courier New', monospace;
  min-height: 0;
}

.docs-chat-messages::-webkit-scrollbar {
  width: 8px;
}

.docs-chat-messages::-webkit-scrollbar-track {
  background: #252526;
}

.docs-chat-messages::-webkit-scrollbar-thumb {
  background: #3e3e42;
  border-radius: 4px;
}

.docs-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #4e4e52;
}

/* Message Bubbles */
.docs-chat-message {
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.docs-chat-message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.docs-chat-message-header.user {
  color: #4ec9b0;
}

.docs-chat-message-header.bot {
  color: var(--accent, #fd6c1d);
}

.docs-chat-message-header i {
  font-size: 12px;
}

.docs-chat-message-content {
  padding: 12px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.6;
  border-left: 3px solid;
}

.docs-chat-message.user .docs-chat-message-content {
  background: #2d2d30;
  color: #d4d4d4;
  border-left-color: #4ec9b0;
}

.docs-chat-message.bot .docs-chat-message-content {
  background: #252526;
  color: #d4d4d4;
  border-left-color: var(--accent, #fd6c1d);
}

/* Bot message formatting */
.docs-chat-message-content p {
  margin: 0 0 8px 0;
}

.docs-chat-message-content p:last-child {
  margin-bottom: 0;
}

.docs-chat-message-content strong {
  color: #dcdcaa;
}

.docs-chat-message-content em {
  color: #9cdcfe;
}

.docs-chat-message-content code {
  background: #1e1e1e;
  color: #ce9178;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
}

/* Document Card */
.docs-chat-doc-card {
  background: #2d2d30;
  border: 1px solid #3e3e42;
  border-radius: 6px;
  padding: 12px;
  margin-top: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.docs-chat-doc-card:hover {
  border-color: var(--accent, #fd6c1d);
  background: #333;
}

.docs-chat-doc-card-title {
  font-weight: 600;
  font-size: 12px;
  color: #4ec9b0;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.docs-chat-doc-card-title i {
  font-size: 11px;
  color: var(--accent, #fd6c1d);
}

.docs-chat-doc-card-desc {
  font-size: 11px;
  color: #9cdcfe;
  line-height: 1.45;
}

.docs-chat-doc-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.docs-chat-doc-card-tag {
  background: #3e3e42;
  color: #d4d4d4;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
}

/* Typing Indicator */
.docs-chat-typing {
  display: flex;
  gap: 4px;
  padding: 12px;
  background: #252526;
  border-radius: 4px;
  border-left: 3px solid var(--accent, #fd6c1d);
  align-self: flex-start;
}

.docs-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #fd6c1d);
  animation: typingDot 1.4s ease-in-out infinite;
}

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

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

@keyframes typingDot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* Quick Actions */
.docs-chat-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.docs-chat-quick-action {
  background: #3e3e42;
  border: 1px solid #4e4e52;
  color: #d4d4d4;
  padding: 6px 12px;
  border-radius: 14px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Courier New', monospace;
}

.docs-chat-quick-action:hover {
  background: var(--accent, #fd6c1d);
  border-color: var(--accent, #fd6c1d);
  color: white;
}

/* Suggestions Panel */
.docs-chat-suggestions {
  padding: 12px 16px;
  background: #252526;
  border-bottom: 1px solid #333;
}

.docs-chat-suggestions-title {
  font-size: 10px;
  text-transform: uppercase;
  color: #858585;
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
  font-family: 'Courier New', monospace;
}

.docs-chat-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.docs-chat-suggestion {
  background: #3e3e42;
  border: 1px solid #4e4e52;
  color: #d4d4d4;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Courier New', monospace;
}

.docs-chat-suggestion:hover {
  background: var(--accent, #fd6c1d);
  border-color: var(--accent, #fd6c1d);
  color: white;
}

/* Input Container */
.docs-chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid #333;
  background: #252526;
}

.docs-chat-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #1e1e1e;
  border: 1px solid #3e3e42;
  border-radius: 4px;
  padding: 2px;
}

.docs-chat-input-prompt {
  padding: 0 8px;
  color: var(--accent, #fd6c1d);
  font-weight: 700;
  font-family: 'Courier New', monospace;
  font-size: 14px;
}

.docs-chat-input {
  flex: 1;
  padding: 10px 4px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-family: 'Courier New', monospace;
  color: #d4d4d4;
  min-width: 0;
}

.docs-chat-input:focus {
  outline: none;
}

.docs-chat-input::placeholder {
  color: #858585;
  font-style: italic;
}

.docs-chat-send {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--accent, #fd6c1d);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.docs-chat-send:hover:not(:disabled) {
  background: #e55a10;
}

.docs-chat-send:disabled {
  background: #3e3e42;
  cursor: not-allowed;
}

.docs-chat-send i {
  font-size: 12px;
  color: white;
}

/* Status Bar */
.docs-chat-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px;
  background: #007acc;
  font-size: 10px;
  color: white;
  font-family: 'Courier New', monospace;
}

.docs-chat-statusbar-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.docs-chat-statusbar-item i {
  font-size: 10px;
}

/* Mobile Adjustments */
@media (max-width: 1024px) {
  .docs-sidebar.chat-mode {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .docs-chat-messages {
    padding: 12px;
  }

  .docs-chat-input-area {
    padding: 12px;
  }
}
