/* www/chat_styles.css */

.chat-toggle-button {
  position: fixed; /* Fixed position */
  top: 10px;      /* Adjust as needed for navbar height */
  right: 20px;
  z-index: 1051;  /* Higher than sidebar to be clickable if sidebar somehow overlaps header */
}

/* Styles for the chat sidebar itself are mostly inline in chatSidebarUI for now,
   but could be moved here. For example: */
.chat-sidebar {
  position: fixed !important;
  right: 0;
  top: 0;
  height: 100vh;
  width: 350px;
  min-width: 250px;
  max-width: 3200px;
  z-index: 1050;
  background-color: #f8f9fa;
  border-left: 1px solid #dee2e6;
  box-shadow: -2px 0 5px rgba(0,0,0,0.1);
  transition: width 0.1s ease-out;
  padding: 15px;
  display: none;
  pointer-events: auto;
}

.chat-messages-area {
  /* height: calc(100vh - 200px); */ /* Adjust based on header/footer/input area */
  /* overflow-y: auto; */
  /* border: 1px solid #ccc; */
  /* padding: 10px; */
  /* margin-bottom: 10px; */
  /* background-color: white; */
}

.chat-input-area {
  /* display: flex; */
  box-sizing: border-box; /* Add this to the container */
}

/* Basic styling for messages (example) */
.chat-message {
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 15px;
  word-wrap: break-word;
  max-width: 85%;
  clear: both; /* Ensures messages don't overlap if floats were used */
}
.user-message {
  background-color: #007bff; /* Primary blue for user */
  color: white;
  float: right;
  margin-left: auto; /* Pushes to the right */
  border-bottom-right-radius: 5px; /* Slightly different rounding for bubble effect */
}
.agent-message {
  background-color: #e9ecef; /* Light grey for agent */
  color: #495057;
  float: left;
  margin-right: auto; /* Pushes to the left */
  border-bottom-left-radius: 5px; /* Slightly different rounding for bubble effect */
}

/* Styling for disclaimer messages */
.agent-message.disclaimer {
  background-color: #fff3cd; /* Light yellow background for warning */
  border: 1px solid #ffeaa7; /* Light orange border */
  color: #856404; /* Dark yellow-brown text */
  font-size: 0.9em; /* Slightly smaller text */
  font-style: italic; /* Italic for emphasis */
}

/* Styles for the custom chat tab list item */
.custom-chat-tab-li {
  position: relative; /* Allows precise positioning of the link if needed */
  margin-top: 12px; /* ADJUSTED: Increased to 15px to move the tab down further. */
}

/* Styles for the custom chat tab link */
#customChatTabLink {
  padding: 10px 15px; /* Adjust padding to match other tabs */
  line-height: 20px;  /* Adjust line-height to match other tabs */
  display: block;
  position: relative;
  color: white !important; /* Make font color white */
}

#customChatTabLink:hover,
#customChatTabLink:focus {
  text-decoration: none;
  background-color: #333333; /* Darker background on hover for white text, e.g., dark grey */
  color: white !important; /* Ensure hover text color is also white */
}

/* Ensure input and button in chat sidebar respect their defined widths */
.chat-input-area #chatInput {
  box-sizing: border-box;
  flex-grow: 1; /* Allow input to take available space */
  margin-right: 5px; /* Add a small margin to separate from button if needed */
  height: 38px !important; /* Explicit height */
}

.chat-input-area #sendChatMsg {
  box-sizing: border-box;
  flex-shrink: 0; /* Prevent button from shrinking */
  display: inline-flex !important;    /* Make the button a flex container */
  align-items: center !important;   /* Vertically center content inside the button */
  justify-content: center !important; /* Horizontally center content (good for icon+text) */
  height: 38px !important; /* Explicit height, matching input */
  padding-left: 10px !important; /* Ensure some horizontal padding for button text */
  padding-right: 10px !important; /* Ensure some horizontal padding for button text */
}

/* Resize handle styles */
.resize-handle {
  position: absolute;
  left: 0;
  top: 0;
  width: 8px;
  height: 100%;
  cursor: ew-resize;
  background-color: transparent;
  z-index: 9999 !important;
  transition: background-color 0.2s;
  pointer-events: auto;
}

.resize-handle:hover {
  background-color: rgba(0, 0, 0, 0.1) !important;
}

.thinking-message {
  background-color: #fffbe6;
  border-left: 4px solid #ffd700;
  position: relative;
}
.thinking-text, .thought-item {
  font-family: 'Fira Mono', 'Consolas', monospace;
  white-space: pre-wrap;
  display: block;
  vertical-align: middle;
}
.thinking-text.typing-cursor:after, .thought-item.typing-cursor:after {
  content: '|';
  animation: blink-cursor 1s steps(1) infinite;
  margin-left: 2px;
  color: #888;
}
@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.thoughts-area {
  background: #f9f9f9;
  border-left: 2px dashed #ffd700;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 8px;
}
.thought-toggle-arrow {
  cursor: pointer;
  font-size: 1.1em;
  color: #bfa100;
  margin-right: 4px;
  user-select: none;
}

/* Literature consultation styles */
.consultation-message {
  background-color: #f0f8ff !important;
  border: 1px solid #87ceeb;
  color: #2f4f4f;
  font-style: italic;
  margin-bottom: 5px !important;
}

.literature-consultation-buttons {
  margin: 10px 0;
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  clear: both;
}

.consultation-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.consultation-row:last-child {
  margin-bottom: 0;
}

.consultation-btn {
  flex: 1;
  padding: 10px 15px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-underlying {
  background-color: #28a745;
  color: white;
}

.btn-underlying:hover {
  background-color: #218838;
  transform: translateY(-2px);
}

.btn-external {
  background-color: #007bff;
  color: white;
}

.btn-external:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
}

.btn-both {
  background-color: #ffc107;
  color: #212529;
}

.btn-both:hover {
  background-color: #e0a800;
  transform: translateY(-2px);
}

.btn-skip {
  background-color: #6c757d;
  color: white;
}

.btn-skip:hover {
  background-color: #545b62;
  transform: translateY(-2px);
}


 