/**
 * @file
 * Floating jes-ai help widget.
 *
 * Port of CHATBOT_INTEGRATION_GUIDE.md plus HelpButtonStack lazy-load
 * and Zendesk launcher hiding.
 */

/* ── Floating button stack (bottom-right corner) ── */

#button-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 150px;
  z-index: 10000;
  transition: opacity 0.2s, transform 0.2s;
  font-family: Arial, Helvetica, sans-serif;
}

#button-stack.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.jes-ai-header {
  background: white;
  border-radius: 15px;
  padding: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
}

.jes-ai-header-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-grow: 1;
  padding-right: 8px;
}

.jes-ai-logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0077c8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 8px;
}

.jes-ai-logo-text {
  color: white;
  font-weight: bold;
  font-size: 12px;
}

.jes-ai-header-text {
  font-size: 14px;
  font-weight: bold;
  color: black;
}

.jes-ai-button {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 15px;
  border: none;
  font-size: 12px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
}

.jes-ai-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.jes-ai-button:focus-visible {
  outline: 2px solid #1775ef;
  outline-offset: 2px;
}

.jes-ai-button--human {
  background: linear-gradient(90deg, #2e51cc 0%, #00c29b 100%);
}

.jes-ai-button--ai {
  background: linear-gradient(90deg, #7018c8 0%, #ff31e4 100%);
}

.jes-ai-button-icon {
  width: 30px;
  height: 30px;
  margin-right: 8px;
  border-radius: 3px;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

/* ── Chat panel (slides in from the right) ── */

#chat-container {
  position: fixed;
  bottom: 0;
  right: 0;
  top: 0;
  width: 600px;
  overflow: hidden;
  background: white;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  transform: scale(0.95) translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

#chat-container.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 1024px) {
  #chat-container.open {
    width: 100%;
  }
}

#chat-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
