/* Investor Q&A chat widget — matches the deck's dark/cyan theme (deckstyle.css :root vars) */

#invariant-chat-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  font-family: 'Inter', -apple-system, sans-serif;
}

#invariant-chat-launcher {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--cyan-dim, #00a0b0);
  background: var(--dark2, #101018);
  color: var(--text, #e0e0e8);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 24px var(--cyan-glow, rgba(0, 229, 255, 0.3));
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#invariant-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 32px var(--cyan-glow, rgba(0, 229, 255, 0.3));
}
#invariant-chat-launcher .ic-launcher-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gradient, linear-gradient(135deg, #00e5ff, #007cf0));
  color: var(--dark, #0a0a0f);
  font-weight: 900;
  font-size: 12px;
}

#invariant-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  width: min(380px, calc(100vw - 40px));
  height: min(560px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: var(--dark2, #101018);
  border: 1px solid var(--cyan-dim, #00a0b0);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5), 0 0 32px var(--cyan-glow, rgba(0, 229, 255, 0.3));
  overflow: hidden;
}
#invariant-chat-panel.ic-hidden,
#invariant-chat-root.ic-unauthenticated #invariant-chat-launcher {
  display: none;
}

.ic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(136, 136, 160, 0.2);
  background: var(--dark3, #1a1a2e);
}
.ic-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  color: var(--text, #e0e0e8);
  font-size: 14px;
}
#invariant-chat-close {
  background: none;
  border: none;
  color: var(--text-dim, #8888a0);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}
#invariant-chat-close:hover { color: var(--text, #e0e0e8); }

.ic-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ic-msg {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.ic-msg-bot {
  align-self: flex-start;
  background: var(--dark3, #1a1a2e);
  color: var(--text, #e0e0e8);
  border: 1px solid rgba(136, 136, 160, 0.15);
}
.ic-msg-user {
  align-self: flex-end;
  background: var(--gradient, linear-gradient(135deg, #00e5ff, #007cf0));
  color: var(--dark, #0a0a0f);
  font-weight: 500;
}
.ic-msg-error {
  align-self: flex-start;
  background: rgba(231, 111, 81, 0.15);
  color: var(--red, #e76f51);
  border: 1px solid rgba(231, 111, 81, 0.3);
}

.ic-sources {
  align-self: flex-start;
  max-width: 88%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: -4px;
}
.ic-source-tag {
  font-size: 10.5px;
  color: var(--cyan, #00e5ff);
  border: 1px solid var(--cyan-dim, #00a0b0);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}

.ic-suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: flex-start;
  max-width: 100%;
}
.ic-suggestion {
  text-align: left;
  background: none;
  border: 1px solid rgba(136, 136, 160, 0.3);
  color: var(--text-dim, #8888a0);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12.5px;
  cursor: pointer;
}
.ic-suggestion:hover {
  border-color: var(--cyan-dim, #00a0b0);
  color: var(--text, #e0e0e8);
}

.ic-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(136, 136, 160, 0.2);
  background: var(--dark3, #1a1a2e);
}
#invariant-chat-input {
  flex: 1;
  background: var(--dark, #0a0a0f);
  border: 1px solid rgba(136, 136, 160, 0.3);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text, #e0e0e8);
  font-size: 13.5px;
  font-family: inherit;
}
#invariant-chat-input:focus { outline: none; border-color: var(--cyan-dim, #00a0b0); }
.ic-input-row button[type="submit"] {
  background: var(--gradient, linear-gradient(135deg, #00e5ff, #007cf0));
  color: var(--dark, #0a0a0f);
  border: none;
  border-radius: 8px;
  width: 36px;
  font-weight: 900;
  cursor: pointer;
}
.ic-input-row button[type="submit"]:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 480px) {
  #invariant-chat-root { right: 12px; bottom: 12px; }
  #invariant-chat-panel { right: 12px; bottom: 78px; }
}
