#chat-popup-wrapper {
  position: fixed;
  bottom: 25px;
  right: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 9999;
  pointer-events: none; /* отключаем перехват кликов */
}

#chat-popup-button {
  background-color: #0084ff;
  color: white;
  border: none;
  border-radius: 25px;
  padding: 12px 24px;
  font-size: 16px;
  cursor: pointer;
  margin-bottom: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: background-color 0.3s ease;
  pointer-events: auto; /* включаем клики */
}

#social-buttons {
  display: flex;
  gap: 10px;
  pointer-events: auto; /* включаем клики */
}

.social-icon img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.social-icon img:hover {
  transform: scale(1.1);
}

#chat-box {
  display: none;
  position: fixed;
  bottom: 120px; /* выше основной кнопки */
  right: 25px;
  width: 350px;
  max-height: 65vh;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  z-index: 9998;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto; /* чат тоже должен быть кликабельным */
}

#chat-box-header {
  background: #003366;
  color: white;
  padding: 10px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#chat-box-close {
  cursor: pointer;
  font-weight: bold;
}

#chat-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background: #fafafa;
}

.chat-message {
  margin-bottom: 10px;
  white-space: pre-wrap;
}

.user {
  color: blue;
  font-weight: bold;
}

.assistant {
  color: green;
  font-weight: bold;
}

#chat-input-container {
  display: flex;
  padding: 10px;
  border-top: 1px solid #ddd;
}

#chat-input {
  flex: 1;
  padding: 10px;
  font-size: 14px;
}

#chat-send {
  padding: 10px 15px;
  background: #003366;
  color: white;
  border: none;
  margin-left: 5px;
  cursor: pointer;
}

.typing-indicator {
  font-weight: bold;
  font-style: italic;
  color: green;
}

.dot-flash::after {
  content: '';
  display: inline-block;
  width: 1em;
  text-align: left;
  animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
  0%   { content: ''; }
  33%  { content: '.'; }
  66%  { content: '..'; }
  100% { content: '...'; }
}
