/* ===========================
   CHATBOT.CSS
   =========================== */

#research-chat-panel {
  position: fixed;
  top: 0; right: 0;
  width: 360px; height: 100vh;
  background: var(--bg);
  border-left: 1px solid #e6e9ef;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s ease;
  z-index: 9999;
}

#research-chat-panel.open {
  transform: translateX(0);
}

/* HEADER */
.chat-header {
  padding: 14px 18px;
  background: var(--card);
  border-bottom: 1px solid #e6e9ef;
  display: flex;
  justify-content: flex-end;
}

#close-chat {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--muted);
  cursor: pointer;
}

/* IFRAME */
.chat-iframe-wrapper {
  flex: 1;
  overflow: hidden;
}

/* OPEN CHAT BUTTON */
.open-chat-btn {
  position: fixed;
  bottom: 28px; right: 28px;
  background: rgba(158, 161, 160, 0.654);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  box-shadow: var(--shadow);
}

.open-chat-btn:hover {
  background: var(--accent);
}

/* BACKDROP */
#chat-backdrop {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 9990;
}

#chat-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* DRAG HANDLE */
#drag-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px; height: 100%;
  cursor: grab;
}

/* Drag states */
.left-panel.snapping { transition: transform 0.25s ease; }
.left-panel.dragging { transition: none !important; }
