/* ==========================================================
   Forge Chatbot — standalone widget для статического блога forge-ai.ru/blog/.
   Все селекторы префиксованы forge-chatbot- — изолировано от стилей статей.
   Парность с landing-app/styles/chatbot.css по визуалу.
   ========================================================== */

.forge-chatbot-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #2f86ff;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.18);
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  padding: 0;
}

.forge-chatbot-btn:hover {
  background: #1f6fe0;
  transform: scale(1.06);
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.22);
}

.forge-chatbot-btn:active {
  transform: scale(0.96);
}

.forge-chatbot-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(47, 134, 255, 0.4), 0 8px 24px rgba(16, 24, 40, 0.18);
}

.forge-chatbot-btn svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.forge-chatbot-window {
  position: fixed;
  bottom: 92px;
  right: 24px;
  z-index: 9999;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border: 1px solid #e6eaf2;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(16, 24, 40, 0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: #0f172a;
  line-height: 1.5;
}

.forge-chatbot-window--visible {
  display: flex;
}

.forge-chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #2f86ff;
  color: #fff;
  flex-shrink: 0;
}

.forge-chatbot-header-title {
  font-size: 15px;
  font-weight: 700;
}

.forge-chatbot-header-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 20px;
  line-height: 1;
}

.forge-chatbot-header-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.forge-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #ffffff;
}

.forge-chatbot-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
}

.forge-chatbot-msg--bot {
  align-self: flex-start;
  background: #f3f4f6;
  color: #0f172a;
  border-bottom-left-radius: 4px;
}

.forge-chatbot-msg--user {
  align-self: flex-end;
  background: #2f86ff;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.forge-chatbot-typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 12px 16px;
  background: #f3f4f6;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}

.forge-chatbot-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
  animation: forge-chatbot-bounce 1.2s infinite ease-in-out;
}

.forge-chatbot-typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.forge-chatbot-typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes forge-chatbot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

.forge-chatbot-input-area {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e6eaf2;
  background: #ffffff;
  flex-shrink: 0;
}

.forge-chatbot-input {
  flex: 1;
  border: 1px solid #e6eaf2;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: #0f172a;
  background: #ffffff;
  resize: none;
  min-height: 40px;
  max-height: 100px;
  outline: none;
}

.forge-chatbot-input:focus {
  border-color: #2f86ff;
  box-shadow: 0 0 0 3px rgba(47, 134, 255, 0.15);
}

.forge-chatbot-send {
  background: #2f86ff;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  transition: background 0.16s ease;
}

.forge-chatbot-send:hover:not(:disabled) {
  background: #1f6fe0;
}

.forge-chatbot-send:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .forge-chatbot-window {
    width: calc(100vw - 24px);
    height: calc(100vh - 100px);
    right: 12px;
    bottom: 84px;
  }
  .forge-chatbot-btn {
    bottom: 16px;
    right: 16px;
  }
}
