/* ──────────────────────────────────────────────────────────────────
 * hive-chat.css — live LLM chat panel, sitewide
 * Companion to /assets/hive-chat.js
 * Dark theme, 380×540 panel, floating bottom-right.
 * chat-bee occupies bottom-right; hive-chat button sits above it.
 * ────────────────────────────────────────────────────────────────── */

/* ── Trigger button ── */
#hive-chat-btn {
  position: fixed;
  right: 24px;
  bottom: 64px; /* clear the 34px compat ticker + 30px gap */
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #262624;
  border: 1.5px solid rgba(47,128,255,.65);
  box-shadow: 0 0 0 1px rgba(47,128,255,.22), 0 10px 32px -8px rgba(0,0,0,.7);
  cursor: pointer;
  z-index: 10001; /* above compat ticker (z=60) */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .22s cubic-bezier(.2,.7,.2,1.05), box-shadow .22s, border-color .22s;
  outline: none;
}
#hive-chat-btn:hover {
  transform: translateY(-2px) scale(1.06);
  border-color: #2F80FF;
  box-shadow: 0 0 0 1px rgba(47,128,255,.5), 0 14px 36px -6px rgba(0,0,0,.75);
}
#hive-chat-btn:focus-visible {
  outline: 2px solid #2F80FF;
  outline-offset: 4px;
}
/* Hover label "Ask Hive" so the icon's purpose is unambiguous */
#hive-chat-btn::after {
  content: "Ask Hive";
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: #262624;
  color: #EAF2FF;
  font-family: 'Inter','-apple-system',sans-serif;
  font-size: 12.5px;
  letter-spacing: .01em;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid rgba(47,128,255,.45);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .22s cubic-bezier(.2,.7,.2,1.05);
}
#hive-chat-btn:hover::after,
#hive-chat-btn:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* hexagon icon svg inside button */
#hive-chat-btn svg {
  display: block;
}

/* gold pulse dot on button — brand-consistent */
#hive-chat-btn .hc-pulse {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2F80FF;
  box-shadow: 0 0 6px 2px rgba(47,128,255,.6);
  animation: hc-pulse-ring 2.2s ease-out infinite;
}
@keyframes hc-pulse-ring {
  0%   { transform: scale(.9); opacity: 1; }
  60%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(.9); opacity: 0; }
}

/* ── Panel ── */
#hive-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 130px; /* clear ticker (34) + FAB (56) + gap */
  z-index: 10002; /* above FAB + ticker */
  width: 380px;
  height: 540px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 100px);
  background: #262624;
  border: 1px solid rgba(41,179,126,.28);
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(41,179,126,.08),
    0 32px 80px -20px rgba(0,0,0,.82),
    inset 0 1px 0 rgba(255,255,255,.04);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.97);
  transform-origin: bottom right;
  transition: opacity .22s, transform .26s cubic-bezier(.2,.7,.2,1.05), visibility .22s;
}
#hive-chat-panel.hc-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ── Header ── */
.hc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(41,179,126,.15);
  background: rgba(38, 38, 36,.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-shrink: 0;
}
.hc-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hc-title {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #29B37E;
  line-height: 1;
}
.hc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #29B37E;
  box-shadow: 0 0 5px 1px rgba(41,179,126,.7);
  animation: hc-dot-blink 2.6s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes hc-dot-blink {
  0%,100% { opacity: 1; }
  50%      { opacity: .45; }
}
.hc-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.hc-btn-icon {
  background: transparent;
  border: none;
  color: rgba(234,242,255,1);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 6px;
  transition: color .15s, background .15s;
  line-height: 1;
  font-family: inherit;
}
.hc-btn-icon:hover {
  color: #EAF2FF;
  background: rgba(255,255,255,.06);
}
.hc-btn-icon[title="Close"] {
  font-size: 16px;
}

/* ── Messages ── */
.hc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.hc-messages::-webkit-scrollbar {
  width: 4px;
}
.hc-messages::-webkit-scrollbar-track {
  background: transparent;
}
.hc-messages::-webkit-scrollbar-thumb {
  background: rgba(41,179,126,.25);
  border-radius: 2px;
}

/* individual message */
.hc-msg {
  display: flex;
  flex-direction: column;
  max-width: 92%;
}
.hc-msg.hc-user {
  align-self: flex-end;
  align-items: flex-end;
}
.hc-msg.hc-assistant {
  align-self: flex-start;
  align-items: flex-start;
}
.hc-msg-bubble {
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}
.hc-user .hc-msg-bubble {
  background: rgba(41,179,126,.15);
  border: 1px solid rgba(41,179,126,.25);
  color: #EAF2FF;
  border-bottom-right-radius: 4px;
}
.hc-assistant .hc-msg-bubble {
  background: rgba(58, 58, 56,.9);
  border: 1px solid rgba(255,255,255,.07);
  color: #D8E0E8;
  border-bottom-left-radius: 4px;
}
/* markdown link styling inside assistant messages */
.hc-assistant .hc-msg-bubble a {
  color: #29B37E;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.hc-assistant .hc-msg-bubble a:hover {
  color: #45D49A;
}

/* typing cursor during streaming */
.hc-cursor {
  display: inline-block;
  width: 2px;
  height: 13px;
  background: #29B37E;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: hc-cursor-blink .8s step-end infinite;
}
@keyframes hc-cursor-blink {
  0%,100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* system / error / rate-limit notices */
.hc-notice {
  align-self: center;
  background: rgba(47,128,255,.1);
  border: 1px solid rgba(47,128,255,.25);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  color: rgba(234,242,255,1);
  text-align: center;
  max-width: 94%;
  line-height: 1.45;
}
.hc-notice.hc-notice--info {
  background: rgba(41,179,126,.07);
  border-color: rgba(41,179,126,.2);
}
.hc-notice.hc-notice--warn {
  background: rgba(47,128,255,.08);
  border-color: rgba(47,128,255,.25);
  color: rgba(234,242,255,1);
}

/* welcome state */
.hc-welcome {
  align-self: center;
  text-align: center;
  color: rgba(234,242,255,1);
  font-size: 12.5px;
  line-height: 1.55;
  padding: 20px 16px;
}
.hc-welcome strong {
  color: rgba(234,242,255,1);
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

/* ── Input area ── */
.hc-input-area {
  flex-shrink: 0;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(41,179,126,.12);
  background: rgba(38, 38, 36,.6);
}
.hc-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.hc-input {
  flex: 1;
  resize: none;
  background: rgba(58, 58, 56,.95);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  color: #EAF2FF;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 13.5px;
  line-height: 1.45;
  padding: 8px 11px;
  outline: none;
  min-height: 38px;
  max-height: 110px;
  overflow-y: auto;
  transition: border-color .15s;
  scrollbar-width: thin;
}
.hc-input:focus {
  border-color: rgba(41,179,126,.45);
}
.hc-input::placeholder {
  color: rgba(234,242,255,.28);
}
.hc-send {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #29B37E;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, transform .15s;
  align-self: flex-end;
}
.hc-send:hover:not(:disabled) {
  background: #32C98F;
  transform: scale(1.05);
}
.hc-send:disabled {
  background: rgba(41,179,126,.3);
  cursor: not-allowed;
}
.hc-send svg {
  display: block;
}

/* ── Footer ── */
.hc-footer {
  padding: 5px 14px 8px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: .09em;
  color: rgba(234,242,255,.22);
  border-top: 1px solid rgba(255,255,255,.04);
  flex-shrink: 0;
  text-transform: uppercase;
}

/* ── Mobile ── */
@media (max-width: 540px) {
  #hive-chat-btn {
    right: 16px;
    bottom: 92px;
  }
  #hive-chat-panel {
    right: 8px;
    bottom: 152px;
    width: calc(100vw - 16px);
    max-height: calc(100vh - 100px);
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  #hive-chat-panel {
    transition: opacity .15s, visibility .15s;
    transform: none;
  }
  #hive-chat-panel.hc-open {
    transform: none;
  }
  .hc-pulse,
  .hc-dot,
  .hc-cursor {
    animation: none;
  }
}

/* ── Suggestion chips (deterministic backend follow-ups) ── */
.hc-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px 0 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.hc-chip {
  appearance: none;
  background: rgba(47,128,255,0.08);
  color: #E8DDC2;
  border: 1px solid rgba(47,128,255,0.35);
  border-radius: 999px;
  padding: 5px 11px;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.hc-chip:hover,
.hc-chip:focus-visible {
  background: rgba(47,128,255,0.16);
  border-color: rgba(47,128,255,0.6);
  outline: none;
}
.hc-typing .hc-msg-bubble {
  min-height: 18px;
}
