/**
 * Chatbot CSS - Dirk Werner Books
 * External stylesheet for use on book pages
 */

/* Quick Action Buttons */
.qa-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e1e6eb;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  min-height: 44px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  transition: all 0.2s ease;
  color: #2c5aa0;
  font-weight: 500;
}

.qa-btn:hover {
  background: #f5f7fa;
  border-color: #2b7bbf;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.qa-btn:focus {
  outline: 3px solid #cfe8ff;
  outline-offset: 2px;
}

.qa-btn:active {
  transform: translateY(1px);
}

.qa-icon {
  font-size: 16px;
  line-height: 1;
}

.qa-label {
  display: inline-block;
  white-space: nowrap;
}

.qa-btn-more {
  background: #f5f7fa;
  font-size: 18px;
  padding: 8px 14px;
}

/* Responsive: Mobile shows only icons */
@media (max-width: 520px) {
  .qa-label {
    display: none;
  }
  .qa-btn {
    padding: 8px 10px;
    min-width: 44px;
    justify-content: center;
  }
  #chat-quick-actions {
    gap: 4px;
    padding: 6px 8px;
  }
}

/* Tablet: Smaller buttons */
@media (min-width: 521px) and (max-width: 768px) {
  .qa-btn {
    font-size: 12px;
    padding: 6px 10px;
  }
  .qa-label {
    font-size: 12px;
  }
}

/* Chat Shell - Book Pages (bottom right) */
#dw-chat-shell {
  position: fixed !important;
  right: 18px !important;
  bottom: 18px !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  z-index: 2147483600 !important;
  width: 400px !important;
  max-width: 90vw !important;
  max-height: 60vh !important;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  border-radius: 10px;
  font-family: Arial, Helvetica, sans-serif;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}

/* Chat Header */
#dw-chat-header {
  background: #274b66;
  color: #fff;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#dw-chat-title {
  font-size: 15px;
  font-weight: bold;
}

/* Chat Body */
#dw-chat-body {
  flex: 1;
  overflow: auto;
  padding: 12px;
  background: #f6f7f8;
}

/* Welcome Message */
#dw-welcome-message {
  background: #e0f2fe;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  color: #0c4a6e;
  font-size: 14px;
  line-height: 1.5;
}

/* Local Messages Container */
#dw-local-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Typing Indicator */
#dw-typing {
  padding: 8px;
  color: #666;
  font-size: 13px;
}

/* Input Area */
#dw-input-wrapper {
  display: flex;
  border-top: 1px solid #eee;
  background: #fff;
}

#dw-input {
  flex: 1;
  border: none;
  padding: 12px;
  font-size: 14px;
  outline: none;
}

#dw-input::placeholder {
  color: #999;
}

#dw-send {
  background: #274b66;
  color: #fff;
  border: none;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 500;
}

#dw-send:hover {
  background: #1d3a52;
}

/* Quick Actions Toolbar */
#chat-quick-actions {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid #eee;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  background: #fafbfc;
}

/* Language Toggle */
#dw-lang-toggle {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
}

#dw-lang-toggle:hover {
  background: rgba(255,255,255,0.1);
}

/* Minimize Button */
#dw-minimize {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

#dw-minimize:hover {
  opacity: 0.8;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  #dw-chat-shell {
    right: 10px !important;
    bottom: 10px !important;
    width: min(380px, 94vw) !important;
    max-height: 70vh !important;
  }
}

/* More Actions Menu */
#more-actions-menu > div {
  position: absolute;
  bottom: 60px;
  right: 10px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 8px;
  min-width: 220px;
  z-index: 100000;
  max-height: 350px;
  overflow-y: auto;
}

/* Book Context Message (for book pages) */
.book-context-msg {
  background: #f0f9ff;
  border-left: 3px solid #3b82f6;
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 10px;
}
