/* RAG Chat Widget — shared styles for all guide pages
 * All selectors prefixed dbs-chat- to avoid collisions.
 * Loaded by rag-chat.js (injected) or via <link> in guide pages.
 */

.dbs-chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1e3a5f;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s;
}
.dbs-chat-fab:hover { background: #2d4f7a; transform: scale(1.06); }
.dbs-chat-fab svg { width: 26px; height: 26px; fill: #fff; }

.dbs-chat-panel {
  display: none;
  position: fixed;
  bottom: 88px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 100px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  z-index: 9999;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}
.dbs-chat-panel.open { display: flex; }
.dbs-chat-panel.mobile-open {
  top: 0; bottom: 0; right: 0; left: 0;
  width: 100%; max-width: 100%;
  border-radius: 0;
}

.dbs-chat-header {
  padding: 16px 20px;
  background: #1e3a5f;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dbs-chat-header-title { font-size: 0.95rem; font-weight: 600; line-height: 1.3; }
.dbs-chat-header-sub { font-size: 0.75rem; opacity: 0.8; margin-top: 2px; }
.dbs-chat-close {
  background: none; border: none; cursor: pointer;
  color: #fff; font-size: 1.4rem; line-height: 1; padding: 4px;
  opacity: 0.8; transition: opacity 0.15s;
}
.dbs-chat-close:hover { opacity: 1; }

.dbs-chat-disclaimer {
  padding: 10px 20px;
  background: #f0f4ff;
  font-size: 0.73rem;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
}

.dbs-chat-suggestions {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dbs-chat-suggestions-label {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.dbs-chat-suggest-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: #334155;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
  font-family: 'Inter', sans-serif;
  line-height: 1.3;
}
.dbs-chat-suggest-btn:hover { background: #e2e8f0; border-color: #cbd5e1; }

.dbs-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.dbs-chat-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  word-break: break-word;
}
.dbs-chat-msg.user {
  align-self: flex-end;
  background: #1e3a5f;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.dbs-chat-msg.assistant {
  align-self: flex-start;
  background: #f1f5f9;
  color: #1e293b;
  border-bottom-left-radius: 4px;
}
.dbs-chat-msg.typing {
  color: #94a3b8;
  font-style: italic;
  font-size: 0.8rem;
}
.dbs-chat-msg .dbs-chat-cite {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 4px;
  font-style: italic;
}

.dbs-chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.dbs-chat-input {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  resize: none;
  max-height: 120px;
  outline: none;
  transition: border-color 0.15s;
  line-height: 1.4;
}
.dbs-chat-input:focus { border-color: #1e3a5f; }
.dbs-chat-send {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: #1e3a5f;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.dbs-chat-send:hover { background: #2d4f7a; }
.dbs-chat-send:disabled { background: #94a3b8; cursor: not-allowed; }
.dbs-chat-send svg { width: 18px; height: 18px; fill: #fff; }

@media (max-width: 520px) {
  .dbs-chat-panel { bottom: 80px; right: 12px; }
  .dbs-chat-fab { bottom: 16px; right: 16px; }
}
