body { font-family: 'Segoe UI', sans-serif; background: #f4f4f9; }

/* Аватарът идва от CSS променлива --avatar-img (задава се в темплейта) */
.chat-toggle {
  position: fixed; bottom: 20px; right: 20px;
  width: 64px; height: 64px; border-radius: 50%;
  background-image: var(--avatar-img, none);
  background-size: cover; background-position: center;
  box-shadow: 0 0 10px rgba(0, 128, 128, 0.5);
  animation: pulse 2s infinite; cursor: pointer; z-index: 9999;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 128, 128, 0.5); }
  70% { box-shadow: 0 0 0 20px rgba(0, 128, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 128, 128, 0); }
}

.chat-container {
  position: fixed; bottom: 100px; right: 20px;
  width: 370px; max-height: 620px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  border-radius: 16px; overflow: hidden;
  background: white; display: none;
  flex-direction: column; font-size: 15px;
  z-index: 10000;
}
.chatbox {
  padding: 15px; height: 460px;
  overflow-y: auto; flex-grow: 1;
  display: flex; flex-direction: column;
  gap: 10px; background: #ffffff;
}
.msg { display: flex; flex-direction: column; max-width: 85%; word-break: break-word; }
.msg-user {
  align-self: flex-end;
  background: #e8eaf6; color: #1a237e;
  border-radius: 18px 18px 0 18px; padding: 10px 14px;
}
.msg-bot {
  align-self: flex-start;
  background: #B11016; color: #ffff;
  border-radius: 18px 18px 18px 0; padding: 10px 14px;
}

/* Динамичен аватар и тук */
.msg-bot.bot-avatar::before {
  content: ""; width: 40px; height: 40px;
  background-image: var(--avatar-img, none);
  background-size: cover; background-position: center;
  border-radius: 50%; display: inline-block;
  margin-right: 10px; vertical-align: middle;
  margin-bottom: 10px;
}

.chat-input {
  border: none; border-top: 1px solid #ccc;
  padding: 12px; width: calc(100% - 24px);
  font-size: 14px;
}
.greeting-gif {
  max-width: 100%; border-radius: 12px;
  margin-top: 10px; display: block;
}
.msg-bot a {
  display: inline-block; margin-top: 6px;
  background: #80cbc4; color: #fff !important;
  text-decoration: none; padding: 6px 12px;
  border-radius: 8px; font-weight: bold;
}
.msg-bot a:hover { background: #4db6ac; }
.typing { display: inline-block; width: 20px; text-align: center; animation: blink 1s infinite; }
@keyframes blink { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

.quick-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.quick-buttons button {
  padding: 6px 10px;
  background: #c8e6c9;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  transition: background 0.3s;
  text-wrap: auto;
  margin: 5px;
}
.quick-buttons button:hover { background: #a5d6a7; }

.chat-input-wrapper { display: flex; align-items: center; }
#sendBtn {
  background: #B11016;
  color: white;
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 18px;
  border-radius: 0 6px 6px 0;
}
.chat-input {
  flex: 1;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px 0 0 16px;
}
