.chat-btn {
  background: #00ccff;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 0 10px #00ccff;
}

:root {
  --chat-width: 360px;
  --chat-height: 420px;
}

.chat-box {
  width: var(--chat-width);
  height: var(--chat-height);
  background: #111;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: white;
  position: absolute;
  bottom: 60px;
  right: 0;
  box-shadow: 0 0 20px #00ccff;
}

.chat-box.hidden {
  display: none;
}


.chat-messages {
  flex: 3; /* 📌 больше места */
  overflow-y: auto;
  font-size: 14px;
  padding: 5px;
  background: #222;
  border-radius: 5px;
}


#chat-input {
  padding: 6px 8px;
  border-radius: 5px;
  border: none;
  background: #333;
  color: white;
  font-size: 14px;
  resize: none;
  line-height: 1.4;
  height: 40px;
  display: flex;
  align-items: center;
}



#chat-send {
  background: #00ccff;
  border: none;
  padding: 5px 10px;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}


.user-message {
  background-color: #222;
  color: #00ccff;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.bot-message {
  background-color: #222;
  color: #44d444;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}



.bot-greeting {
  position: absolute;
  bottom: 70px; /* 🔽 ближе к иконке */
  right: 10px;   /* 🔼 плотнее к краю */
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 204, 255, 0.4);
  color: #ffffff;
  padding: 12px 16px 12px 14px;
  border-radius: 12px;
  max-width: 420px;
  width: max-content;
  font-size: 15px;
  line-height: 1.4;
  box-shadow: 0 0 10px rgba(0, 204, 255, 0.4), 0 0 25px rgba(0, 204, 255, 0.2);
  z-index: 10000;
  animation: fade-in 0.3s ease-out;
}

.greeting-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}

.greeting-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.greeting-text {
  flex: 1;
  word-break: break-word;
  white-space: normal;
}

.greeting-close {
  position: absolute;
  top: 1px;              /* 🟢 Расположение сверху */
  right: 1px;           /* 🟢 Расположение справа */
  background: none;
  border: none;
  font-size: 24px;       /* 🟢 Размер кнопки */
  color: #ff4d4d;      /* ⚪ Стандартный цвет */
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease, transform 0.2s ease;
}

.greeting-close:hover {
  color: #ff4d4d; /* 🔴 красный при наведении */
}

.greeting-close:active {
  color: #ff0000;        /* 🔥 Цвет при нажатии */
  transform: scale(0.9); /* 👇 Эффект нажатия */
}


@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* 📱 Адаптация бота под мобильные устройства */
@media (max-width: 768px) {
  :root {
    --chat-width: 95vw;
    --chat-height: 60vh;
  }

  #chat-widget {
    bottom: 20px;
    right: 20px;
  }

  .chat-box {
    position: fixed;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    width: var(--chat-width);
    height: var(--chat-height);
    max-width: 360px;
    background: #111;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: white;
    box-shadow: 0 0 20px #00ccff;
    z-index: 9999;
  }

  .chat-box.hidden {
    display: none;
  }

  #chat-input {
    font-size: 16px;
    height: 42px;
  }

  .chat-btn {
    width: 45px;
    height: 45px;
    font-size: 22px;
  }

  .bot-greeting {
    position: absolute;
    bottom: 60px;
    right: 20px;            /* подвинем чуть левее от края */
    max-width: 280px;
    background: #111;
    color: white;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 0 15px #00ccff;
    font-size: 14px;
    z-index: 9999;
  }

}
