/* Rosalind Slide-over Panel */

.rosalind-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent2);
  color: var(--text);
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.15s ease, background 0.15s ease;
  z-index: 200;
}

.rosalind-btn:hover {
  transform: scale(1.08);
  background: var(--accent);
}

/* Panel */
.rosalind-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 100vw;
  background: var(--nav-bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 300;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.rosalind-panel.open {
  transform: translateX(0);
}

/* Header */
.rosalind-header {
  background: #1B4F8A;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.rosalind-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rosalind-name {
  font-size: 1rem;
  font-weight: 600;
  color: white;
}

.rosalind-context {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  color: rgba(255,255,255,0.8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rosalind-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0.25rem;
  line-height: 1;
}

.rosalind-close:hover {
  color: white;
}

/* Messages */
.rosalind-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.msg {
  max-width: 85%;
  padding: 0.625rem 0.875rem;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.msg-user {
  align-self: flex-end;
  background: var(--accent2);
  color: white;
  border-bottom-right-radius: 3px;
}

.msg-assistant {
  align-self: flex-start;
  background: var(--card-bg);
  color: var(--text);
  border-bottom-left-radius: 3px;
}

.msg-typing {
  align-self: flex-start;
  background: var(--card-bg);
  color: var(--muted);
  padding: 0.625rem 1rem;
  border-radius: 10px;
  border-bottom-left-radius: 3px;
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--muted);
  border-radius: 50%;
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* Input */
.rosalind-input-bar {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.rosalind-input {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 38px;
  max-height: 120px;
}

.rosalind-input:focus {
  border-color: var(--accent);
}

.rosalind-input::placeholder {
  color: var(--muted);
}

.rosalind-send {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: white;
  padding: 0 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s ease;
  align-self: flex-end;
  height: 38px;
}

.rosalind-send:hover {
  background: var(--accent2);
}

.rosalind-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Overlay for mobile */
.rosalind-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 250;
}

.rosalind-overlay.visible {
  display: block;
}

@media (max-width: 768px) {
  .rosalind-panel {
    width: 100vw;
  }

  .rosalind-btn {
    min-width: 48px;
    min-height: 48px;
  }

  .rosalind-send {
    min-height: 44px;
    padding: 0 1rem;
  }

  .rosalind-close {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
