
/* ========================================================
   Conversation "Chat Bubble" Styling
   ======================================================== */

.conversation-messages {
  display: none;
}

.notebook-editor.conversation-active {
  display: flex;
  flex-direction: column;
  border: 1px solid #e0e7ff;
  border-radius: 0.75rem;
  background: #fafafe;
  overflow: hidden;
  height: 24rem;
}

.notebook-editor.conversation-active .conversation-messages {
  display: block;
  padding: 1rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.notebook-editor.conversation-active textarea {
  border: none;
  border-top: 1px solid #e0e7ff;
  border-radius: 0;
  resize: none;
  height: 4.5rem;
  min-height: 3.5rem;
  flex: 0 0 auto;
}

.notebook-editor.conversation-active textarea:focus {
  box-shadow: none;
  outline: none;
  ring: none;
}

.conversation-message {
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.65rem;
  border-radius: 0.5rem;
  animation: slideIn 0.3s ease;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.conversation-message:last-child {
  margin-bottom: 0;
}

.conversation-message .conversation-role {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
  opacity: 0.7;
}

.conversation-message.assistant {
  background: #eef2ff;
  border-left: 3px solid #6366f1;
  margin-right: 2.5rem;
  color: #312e81;
}

.conversation-message.user {
  background: #f0fdf4;
  border-left: 3px solid #22c55e;
  margin-left: 2.5rem;
  color: #14532d;
}

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

/* ===== Conversation floating send button ===== */
.notebook-editor{
  position:relative;
}
#btnConversationContinueFloating{
  position:absolute;
  z-index:30;
  background:linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  color:#fff;
  border-radius:999px;
  width:2.75rem;
  height:2.75rem;
  right:0.85rem;
  display:flex;
  align-items:center;
  justify-content:center;
  line-height:1;
  border:1px solid rgba(255, 255, 255, 0.2);
  box-shadow:0 8px 18px rgba(67, 56, 202, 0.3);
  transition:transform .12s ease, box-shadow .12s ease;
  pointer-events:auto;
}
#btnConversationContinueFloating.hidden{
  display:none;
}
.conversation-close{
  position:absolute;
  top:-0.35rem;
  right:-0.35rem;
  width:1.1rem;
  height:1.1rem;
  border-radius:999px;
  background:#111827;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:0.75rem;
  line-height:1;
  box-shadow:0 2px 6px rgba(0,0,0,0.2);
}
#btnConversationContinueFloating:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 20px rgba(67, 56, 202, 0.35);
}
#btnConversationContinueFloating:active{
  transform:translateY(0);
}
.conversation-send-icon{
  width:1.2rem;
  height:1.2rem;
  transform:scaleX(-1);
  transform-origin:center;
  transform-box: fill-box;
  display:block;
  flex-shrink:0;
}

@media (max-width: 640px) {
  #btnConversationContinueFloating{
    width:3.25rem;
    height:3.25rem;
    box-shadow:0 10px 24px rgba(67, 56, 202, 0.35);
  }
  .conversation-send-icon{
    width:1.5rem;
    height:1.5rem;
  }
  .conversation-close{
    width:1.35rem;
    height:1.35rem;
    font-size:0.95rem;
  }
}

@media (pointer: coarse) {
  #btnConversationContinueFloating{
    width:3.25rem;
    height:3.25rem;
  }
  .conversation-send-icon{
    width:1.5rem;
    height:1.5rem;
  }
}

/* ===== Universal Loading Spinner Animation ===== */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.animate-spin {
  animation: spin 1s linear infinite;
}
