/* Корневой элемент чата */
.my-chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

/* Группа кнопки чата */
.chat-button-group {
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

/* Блок с текстом */
.chat-text-block {
  padding: 8px 16px;
  background-color: #ffffff;
  color: #000;
  border-radius: 44px 0 0 44px;
  display: flex;
  align-items: center;
  font-family: Arial, sans-serif;
  font-size: 14px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-right: -10px; /* Плотное прилегание к кружочку */
}

/* Кружочек с логотипом */
.chat-circle-logo {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  position: relative; /* Для позиционирования img */
  box-shadow: 0 0 15px rgba(138, 43, 226, 0.7); /* Тень для эффекта */
}

/* Стили для изображения внутри кружочка */
.chat-circle-logo img {
  width: 120px; /* Увеличенный размер картинки */
  height: 120px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* Центрируем изображение */
  object-fit: cover; /* Масштабируем изображение, чтобы оно заполнило круг */
}






/* Контейнер чата */
.chat-wrapper {
  position: fixed;
  bottom: 0;
  right: 20px;
  width: 368px;
  height: 488px;
  background-color: rgba(20, 20, 20, 0.95);
  border-radius: 18px 0px 0px 0px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  box-shadow: 5px 14px 80px rgba(26, 26, 26, 0.12), 10px 10px 40px rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
  .chat-wrapper {
    width: 90%;
    right: 0;
  }
}

.chat-wrapper {
  position: fixed;
  bottom: 0;
  right: 20px;
  width: 368px;
  height: 488px;
  background-color: rgba(20, 20, 20, 0.95);
  border-radius: 18px 0px 0px 0px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  box-shadow: 5px 14px 80px rgba(26, 26, 26, 0.12), 10px 10px 40px rgba(0, 0, 0, 0.08);
}

/* Хедер чата */
.chat-header {
  background-color: #5B14F1;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header-content {
  display: flex;
  align-items: center;
}

/* Логотип робота */
.chat-logo {
  width: 36px;
  height: 36px;
  margin-right: 12px;
}

/* Заголовок чата */
.chat-title {
  color: #fff;
  font-size: 16px;
  margin: 0;
  font-weight: bold;
}

/* Подзаголовок */
.chat-subtitle {
  color: #fff;
  font-size: 12px;
  margin: 0;
}

/* Кнопка закрытия чата */
.chat-close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  color: #fff;
  cursor: pointer;
}

/* Сообщения чата */
.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  overflow-x: hidden; /* Отключаем горизонтальный скроллбар */
  background-color: #ffffff;
  scrollbar-width: thin;
  scrollbar-color: #5B14F1 rgba(0, 0, 0, 0.1);
}

.chat-messages::-webkit-scrollbar {
  width: 6px; /* Сделали скроллбар тоньше */
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(245, 245, 245, 0.8);
}

.chat-messages::-webkit-scrollbar-thumb {
  background-color: #5B14F1;
  border-radius: 4px;
}

/* Сообщение пользователя */
.message-user {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.message-user .message-content {
  background: #5B14F1;
  color: #fff;
  padding: 12px;
  border-radius: 15px;
  max-width: 80%;
  font-size: 15px;
  word-wrap: break-word; /* Перенос длинных строк */
  white-space: pre-wrap; /* Сохранение формата текста и перенос строк */
}

/* Сообщение поддержки */
.message-support {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.message-support .message-content {
  background: #f3f3f3;
  color: #000;
  padding: 12px;
  border-radius: 15px;
  max-width: 80%;
  font-size: 15px;
  word-wrap: break-word; /* Перенос длинных строк */
  white-space: pre-wrap; /* Сохранение формата текста и перенос строк */
}

/* Ввод сообщения */
.chat-input-wrapper {
  display: flex;
  padding: 15px;
  background-color: #ffffff;
}

.chat-textarea {
  height: auto;
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background-color: rgba(0, 0, 0, 0.05);
  color: #000;
  resize: none;
  max-height: 100px;
  overflow-y: auto;
  font-family: Arial, sans-serif;
  font-size: 15px;
}

.chat-textarea::placeholder {
  color: #aaa;
}

/* Кнопка отправки сообщения */
.chat-send-btn {
  height: 40px;
  padding: 10px;
  margin-left: 10px;
  background: #5B14F1;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-send-btn svg {
  width: 20px;
  height: 20px;
}



.typing-indicator {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  height: 20px;
}

.typing-indicator span {
  display: block;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  background: #fff;
  border-radius: 50%;
  opacity: 0.4;
  animation: typing 1.5s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typing {
  0% {
    opacity: 0.4;
    transform: translateY(0);
  }
  20% {
    opacity: 1;
    transform: translateY(-5px);
  }
  40% {
    opacity: 0.4;
    transform: translateY(0);
  }
}


.my-chat-widget .typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.my-chat-widget .typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

.chat-messages h1,
.chat-messages h2,
.chat-messages h3,
.chat-messages h4 {
  font-size: 1.2em;
  margin-bottom: 0.5em;
  font-weight: bold;
}

.chat-messages p,
.chat-messages ul {
  font-size: 1em;
  margin-bottom: 1em;
}

.chat-messages ul {
  list-style-type: disc;
  margin-left: 1.5em;
}

@keyframes typing {
  0% {
    opacity: 0.4;
    transform: translateY(0);
  }
  20% {
    opacity: 1;
    transform: translateY(-5px);
  }
  40% {
    opacity: 0.4;
    transform: translateY(0);
  }
}
