/* Toggle button */
#chatbot-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  color: #fff;
  background-color: none;
  font-size: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10000;
  user-select: none;
}

#chatbot-toggle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Tooltip (dymek informacyjny) */
#chatbot-tooltip {
  position: fixed;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 12px;
  padding: 5px 7px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 10px;
  font-weight: 600;
  color: #000;
  text-align: center;
  z-index: 10000000;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  max-width: 400px;
  line-height: 1.4;
}

#chatbot-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

#chatbot-tooltip.hide {
  display: none;
}

.chatb-tooltip-arrow {
  position: absolute;
  bottom: -6px;
  right: 20px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #fff;
}

.chatb-tooltip-arrow::before {
  content: "";
  position: absolute;
  bottom: 1px;
  left: -9px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid #fff;
}

/* Animowany kursor */
.chatb-chatb-typing-cursor {
  display: inline-block;
  background-color: #0073aa;
  width: 2px;
  height: 1.2em;
  margin-left: 2px;
  animation: blink 1s infinite;
  vertical-align: baseline;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

/* Chat container */
#chatbot-container {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 420px;
  height: 475px;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 21px;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); */
  font-family: "Open Sans", sans-serif;
  font-weight: 400;
  display: flex;
  flex-direction: column;
  z-index: 10000000;
  overflow: hidden;
}

@media (max-width: 500px) {
  #chatbot-container {
    width: 90%;
  }
}

#chatbot-container.hidden {
  display: none;
}

#chatbot-toggle-tools {
  cursor: pointer;
  position: absolute;
  right: 10px;
  padding: 5px 10px;
}

#chatbot-toggle-tools div {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 2px solid #555;
  margin-bottom: 1px;
}

#chatbot-toggle-tools div.open {
  background: #555;
}

#chatbot-tools {
  position: absolute;
  /* padding: 6px 10px; */
  text-align: right;
  background: white;
  max-width: 400px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 20px;
  box-sizing: border-box;
  right: 20px;
  top: 60px;
  box-shadow: 0px 0px 4px 2px rgba(0, 0, 0, 0.1);
}

.chatb-toolBtn {
  background-color: #fff;
  border: 1px solid #d5d9d9;
  border-radius: 8px;
  box-shadow: rgba(213, 217, 217, 0.5) 0 2px 5px 0;
  box-sizing: border-box;
  color: #0f1111;
  cursor: pointer;
  display: inline-block;
  font-family: "Amazon Ember", sans-serif;
  font-size: 13px;
  line-height: 29px;
  padding: 0 10px 0 11px;
  position: relative;
  text-align: center;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  vertical-align: middle;
}

.chatb-toolBtn:hover {
  background-color: #f7fafa;
}

.chatb-toolBtn:focus {
  border-color: #008296;
  box-shadow: rgba(213, 217, 217, 0.5) 0 2px 5px 0;
  outline: 0;
}
#chatbot-tools.hidden {
  display: none;
}

/* Tryb osadzony (shortcode/blok): render w treści, bez fixed position */
#chatbot-container.embedded {
  position: static;
  bottom: auto;
  right: auto;
  width: 100%;
  /* Bez wymuszania max-width i marginesów – render dokładnie w miejscu w treści */
  margin: 0;
}

.chatb-icon-wrapper {
  width: 24px;
  height: 24px;
  background: linear-gradient(180deg, #c3a157, #ecdca7);
  border-radius: 50%;
  padding: 2px;
  border: 1px solid #d9d9d9;
  display: flex;
  justify-content: center;
  align-items: center;
}

.chatb-icon-wrapper img {
  width: 22px;
  height: 22px;
}

#chatbot-header {
  background: #fff;
  color: #fff;
  padding: 20px;
  font-weight: bold;
  text-align: center;
  display: flex;
}

/* Header logo alignment classes */
.chatb-header-logo-left {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
}

.chatb-header-logo-center {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.chatb-header-logo-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
}

/* Messages */
#chatbot-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 300px;
  font-size: 14px;
  background: #f9f9f9;
}

.chatb-message {
  display: flex;
  margin-bottom: 8px;
  align-items: flex-end;
}

.chatb-message.bot {
  justify-content: flex-start;
}

.chatb-message.bot .chatb-icon-wrapper {
  margin-right: 5px;
}

.chatb-message.user .chatb-icon-wrapper {
  margin-left: 5px;
}

.chatb-message.user {
  justify-content: flex-end;
}

.chatb-message .bubble {
  padding: 8px 12px;
  border-radius: 12px;
  max-width: 80%;
}

@media (max-width: 700px) {
  .chatb-message .bubble {
    max-width: 88%;
  }
}

.chatb-message.bot .bubble {
  background: #fff;
  border: 1px solid #d9d9d9;
}

.chatb-message.user .bubble {
  background: #fff;
  border: 1px solid #d9d9d9;
}

.chatb-message .icon {
  font-size: 18px;
  margin: 0 5px;
}

/* Retry icon button shown on limit exceeded */
.chatb-retry-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0 4px;
  color: inherit;
  font-size: 14px;
}
.chatb-retry-btn:hover {
  opacity: 0.8;
}

/* Input */
#chatbot-input-container {
  position: relative;
  display: flex;
  padding: 20px;
}

#chatbot-input {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 8px;
  resize: none;
  height: 80px;
  font-family: "Open Sans", sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: #333;
}

#chatbot-input::placeholder {
  font-family: "Open Sans", sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: #999;
  opacity: 1;
}

#chatbot-send {
  position: absolute;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(180deg, #c3a157, #ecdca7);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  width: 30px;
  height: 30px;
  padding: 0;
}

#chatbot-send:focus,
#chatbot-send:focus-visible,
.chatb-quick-reply:focus,
.chatb-quick-reply:focus-visible {
  outline: none;
}

#chatbot-send:hover img {
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.05));
}

/* Quick replies */
#chatbot-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px;
}

.chatb-quick-reply {
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 15px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 13px;
}

.chatb-quick-reply:hover {
  background: #0073aa;
  color: #fff;
}

/* chatb-typing dots */
.chatb-typing {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 2px;
  background: #555;
  border-radius: 50%;
  animation: blink 1.4s infinite both;
}

.chatb-typing:nth-child(2) {
  animation-delay: 0.2s;
}
.chatb-typing:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0% {
    opacity: 0.2;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0.2;
  }
}
