/* ============================================================
   Chatbot Icon enhancements
   NOTE: Removed `!important` everywhere except where actually
   needed for cascade override. Removed the 24/7 pulse animation
   (was distracting). Hover still has the bounce effect.
   ============================================================ */

.chatbot-toggle {
  width: 60px;
  height: 60px;
  font-size: 28px;
  box-shadow: 0 8px 25px rgba(232, 102, 0, 0.5);
}

/* Subtle pulse only on first load (5 seconds), then stops */
.chatbot-toggle:not(.chatbot-seen) {
  animation: pulse-attention 2s ease-in-out 3;
}

@keyframes pulse-attention {
  0%, 100% {
    box-shadow: 0 8px 25px rgba(232, 102, 0, 0.5);
  }
  50% {
    box-shadow: 0 8px 35px rgba(232, 102, 0, 0.7),
                0 0 0 10px rgba(232, 102, 0, 0.1);
  }
}

.chatbot-toggle:hover {
  transform: scale(1.15) rotate(10deg);
  box-shadow: 0 10px 40px rgba(232, 102, 0, 0.7);
  animation: none;
}

/* ============================================================
   AI Chatbot enhancements — real LLM integration
   ============================================================ */

/* Header status: green pulsing dot + AI label */
.chatbot-status {
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2effa8;
  animation: statusPulse 2s infinite;
  flex-shrink: 0;
}
@keyframes statusPulse {
  0%   { box-shadow: 0 0 0 0 rgba(46, 255, 168, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(46, 255, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 255, 168, 0); }
}

/* Header action buttons (clear + close) */
.chatbot-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Suggested question chips */
.chatbot-chips {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 15px 0 15px;
  background: var(--bg-primary);
  flex-shrink: 0;
}
.chatbot-chips.visible { display: flex; }
.chatbot-chip {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: inherit;
}
.chatbot-chip:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

/* Streaming text cursor */
.chatbot-message.streaming .message-content p { display: inline; }
.chatbot-message.streaming .stream-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  margin-inline-start: 2px;
  background: var(--accent-color);
  border-radius: 2px;
  vertical-align: text-bottom;
  animation: cursorBlink 0.9s steps(2) infinite;
}
@keyframes cursorBlink {
  0%, 49%  { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* System notes (offline notice / new chat confirmation) */
.chatbot-note {
  align-self: center;
  max-width: 88%;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-tertiary);
  background: var(--bg-tertiary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  line-height: 1.4;
}

/* Disclaimer under input */
.chatbot-disclaimer {
  padding: 8px 15px 14px;
  font-size: 10.5px;
  color: var(--text-tertiary);
  text-align: center;
  background: var(--bg-primary);
  flex-shrink: 0;
}

/* Send button busy state */
.chatbot-input button:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}
.chatbot-input button.sending { animation: sendPulse 1.2s ease-in-out infinite; }
@keyframes sendPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.35); }
  50%      { box-shadow: 0 0 0 7px rgba(var(--accent-rgb), 0); }
}

/* Mobile fine-tuning */
@media (max-width: 600px) {
  .chatbot-chip { font-size: 11px; padding: 5px 10px; }
  .chatbot-disclaimer { font-size: 9.5px; padding: 5px 10px 8px; }
}

/* Reduced motion: disable decorative pulses */
@media (prefers-reduced-motion: reduce) {
  .status-dot,
  .stream-cursor,
  .chatbot-input button.sending { animation: none !important; }
}

/* Keyboard focus visibility inside the chatbot window (WCAG 2.4.7 / QA-03).
   Sends, closes, clears, chips and the input all get a visible orange ring
   when focused via keyboard. Higher specificity than the input's
   outline:none reset. */
.chatbot-window :focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
  border-radius: 4px;
}
