/* ============================================================
   chatbot.css - Primer AI assistant widget
   OmicsEdge Consulting — dark sequencer theme
   ============================================================ */

/* === BUBBLE BUTTON === */
#primer-bubble {
  position: fixed;
  bottom: 5.5rem;
  right: 2rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #26A769;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(38,167,105,0.45), 0 2px 8px rgba(0,0,0,0.4);
  z-index: 9000;
  outline: none;
  animation: primerBob 2.8s ease-in-out infinite;
}

@keyframes primerBob {
  0%,  100% { transform: translateY(0);    }
  50%        { transform: translateY(-8px); }
}

#primer-bubble:hover {
  animation-play-state: paused;
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(38,167,105,0.6), 0 3px 12px rgba(0,0,0,0.4);
}

#primer-bubble:active {
  animation-play-state: paused;
  transform: scale(0.95);
}

/* Notification dot */
#primer-notif-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #C45E8C;
  border: 2px solid #26A769;
  animation: primerDotPulse 2s infinite;
}

@keyframes primerDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.7; transform: scale(1.2); }
}

/* === CHAT PANEL === */
#primer-panel {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  width: 360px;
  height: 520px;
  background: #091210;
  border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.55), 0 4px 16px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9001;
  transform: translateY(24px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.175,0.885,0.32,1.275), opacity 0.25s ease;
  border: 0.5px solid rgba(38,167,105,0.25);
}

#primer-panel.primer-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* === PANEL HEADER === */
.primer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #0D1A0F;
  border-bottom: 0.5px solid rgba(38,167,105,0.15);
  flex-shrink: 0;
}

.primer-header-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(38,167,105,0.15);
  border: 1px solid rgba(38,167,105,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.primer-header-info {
  flex: 1;
  min-width: 0;
}

.primer-header-title {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: #C8F0D4;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.primer-header-status {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.primer-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #26A769;
  animation: primerOnline 3s infinite;
  flex-shrink: 0;
}

@keyframes primerOnline {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

.primer-status-text {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: rgba(140,196,160,0.6);
  letter-spacing: 0.06em;
}

.primer-close-btn {
  background: none;
  border: none;
  color: rgba(200,240,212,0.4);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.primer-close-btn:hover {
  color: #C8F0D4;
  background: rgba(38,167,105,0.1);
}

/* === MESSAGES AREA === */
.primer-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  background: #060E09;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.primer-messages::-webkit-scrollbar { width: 4px; }
.primer-messages::-webkit-scrollbar-track { background: transparent; }
.primer-messages::-webkit-scrollbar-thumb { background: rgba(38,167,105,0.3); border-radius: 2px; }

.primer-msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  animation: primerMsgIn 0.25s ease;
}

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

.primer-msg.primer-msg-bot  { align-self: flex-start; align-items: flex-start; }
.primer-msg.primer-msg-user { align-self: flex-end;   align-items: flex-end; }

.primer-bubble-text {
  padding: 10px 13px;
  border-radius: 12px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  line-height: 1.7;
  word-break: break-word;
}

.primer-msg-bot .primer-bubble-text {
  background: #0D1A0F;
  color: #8DC4A0;
  border-radius: 4px 12px 12px 12px;
  border: 0.5px solid rgba(38,167,105,0.2);
}

.primer-msg-user .primer-bubble-text {
  background: #26A769;
  color: #fff;
  border-radius: 12px 4px 12px 12px;
}

/* Quick reply chips */
.primer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.primer-chip {
  padding: 5px 10px;
  border: 1px solid rgba(38,167,105,0.4);
  border-radius: 20px;
  background: rgba(38,167,105,0.08);
  color: #8DC4A0;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.primer-chip:hover {
  background: rgba(38,167,105,0.2);
  color: #C8F0D4;
  border-color: rgba(38,167,105,0.65);
}

/* Typing indicator */
.primer-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 13px;
  background: #0D1A0F;
  border-radius: 4px 12px 12px 12px;
  border: 0.5px solid rgba(38,167,105,0.2);
  align-self: flex-start;
  animation: primerMsgIn 0.25s ease;
}

.primer-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #26A769;
  animation: primerTypingBounce 1.2s infinite;
}

.primer-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.primer-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes primerTypingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%            { transform: translateY(-6px); opacity: 1; }
}

/* === INPUT AREA === */
.primer-input-area {
  padding: 10px 12px 8px;
  background: #0D1A0F;
  border-top: 0.5px solid rgba(38,167,105,0.12);
  flex-shrink: 0;
}

.primer-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.primer-input {
  flex: 1;
  background: rgba(38,167,105,0.06);
  border: 1px solid rgba(38,167,105,0.25);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: #C8F0D4;
  outline: none;
  resize: none;
  max-height: 80px;
  line-height: 1.5;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.primer-input::placeholder { color: rgba(140,196,160,0.35); }
.primer-input:focus {
  border-color: rgba(38,167,105,0.6);
  background: rgba(38,167,105,0.1);
}

.primer-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #26A769;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}

.primer-send-btn:hover   { background: #1D8A57; }
.primer-send-btn:active  { transform: scale(0.93); }
.primer-send-btn:disabled { background: rgba(38,167,105,0.25); cursor: not-allowed; }

.primer-footer-text {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: rgba(74,122,92,0.7);
  text-align: center;
  margin-top: 6px;
  letter-spacing: 0.06em;
}

.primer-footer-text a { color: rgba(38,167,105,0.55); text-decoration: none; }
.primer-footer-text a:hover { color: #26A769; }

/* === MOBILE === */
@media (max-width: 600px) {
  #primer-panel {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 88vh;
    border-radius: 16px 16px 0 0;
    max-height: 88vh;
  }
  #primer-bubble {
    bottom: 4.5rem;
    right: 1rem;
  }
}
