/* Контейнер чат-бота */
.chatbot {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
}

/* Кнопка-триггер чат-бота */
.chatbot__trigger {
  position: relative;
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #a30041 0%, #d4004e 100%);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(163, 0, 65, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: float 3s ease-in-out infinite;
}

.chatbot__trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(163, 0, 65, 0.4);
}

.chatbot__trigger:active {
  transform: scale(0.95);
}

/* Анимация плавания */
@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Пульсирующие кольца */
.chatbot__pulse-ring {
  position: absolute;
  width: 70px;
  height: 70px;
  border: 2px solid rgba(163, 0, 65, 0.3);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.chatbot__pulse-ring--secondary {
  border: 2px solid rgba(163, 0, 65, 0.2);
  animation: pulse 2s infinite 0.5s;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* Иконка логотипа */
.chatbot__icon {
  position: relative;
  z-index: 2;
}

.chatbot__logo {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.chatbot__trigger:hover .chatbot__logo {
  transform: rotate(360deg);
}

/* Окно чата */
.chatbot__window {
  position: absolute;
  bottom: 90px;
  right: 0;
  width: 380px;
  height: 600px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.9);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  border: 1px solid rgba(55, 54, 60, 0.1);
}

.chatbot__window--active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Заголовок чата */
.chatbot__header {
  background: linear-gradient(135deg, #a30041 0%, #d4004e 100%);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
}

.chatbot__header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot__avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.chatbot__bot-info {
  display: flex;
  flex-direction: column;
}

.chatbot__title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.chatbot__status {
  font-size: 12px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chatbot__status::before {
  content: "";
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: blink 2s infinite;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0.3;
  }
}

.chatbot__close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.chatbot__close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Контент чата */
.chatbot__content {
  height: calc(100% - 80px);
  display: flex;
  flex-direction: column;
}

/* Приветствие пользователя */
.chatbot__welcome {
  padding: 15px 20px;
  background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
  border-bottom: 1px solid rgba(55, 54, 60, 0.1);
}

.chatbot__welcome-content {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #37363c;
  font-size: 14px;
}

.chatbot__welcome-content i {
  color: #a30041;
  font-size: 18px;
}

/* Форма авторизации */
.chatbot__auth-form {
  padding: 30px 25px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.chatbot__auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.chatbot__auth-title {
  color: #37363c;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.chatbot__auth-subtitle {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
}

.chatbot__form {
  display: flex;
  flex-direction: column;
}

.chatbot__form-group {
  margin-bottom: 20px;
}

.chatbot__label {
  display: block;
  color: #37363c;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.chatbot__input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #f5f5f7;
  border-radius: 12px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: #f5f5f7;
  color: #37363c;
}

.chatbot__input:focus {
  outline: none;
  border-color: #a30041;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(163, 0, 65, 0.1);
}

.chatbot__input::placeholder {
  color: #9ca3af;
}

.chatbot__auth-btn {
  width: 100%;
  background: linear-gradient(135deg, #a30041 0%, #d4004e 100%);
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.chatbot__auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(163, 0, 65, 0.3);
}

.chatbot__auth-btn:active {
  transform: translateY(0);
}

/* Область сообщений */
.chatbot__messages {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chatbot__messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chatbot__messages-container::-webkit-scrollbar {
  width: 4px;
}

.chatbot__messages-container::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot__messages-container::-webkit-scrollbar-thumb {
  background: rgba(163, 0, 65, 0.2);
  border-radius: 2px;
}

/* Сообщения */
.chatbot__message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  animation: messageSlide 0.3s ease-out;
  word-wrap: break-word;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chatbot__message--user {
  background: linear-gradient(135deg, #a30041 0%, #d4004e 100%);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  animation: messageSlideRight 0.3s ease-out;
}

.chatbot__message--bot {
  background: #f5f5f7;
  color: #37363c;
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  border: 1px solid rgba(55, 54, 60, 0.1);
  animation: messageSlideLeft 0.3s ease-out;
}

.chatbot__message-time {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 4px;
}

@keyframes messageSlideRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes messageSlideLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Индикатор печати */
.chatbot__typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #f5f5f7;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  max-width: 80%;
  align-self: flex-start;
  margin: 0 20px 16px;
  border: 1px solid rgba(55, 54, 60, 0.1);
}

.chatbot__typing-dots {
  display: flex;
  gap: 4px;
}

.chatbot__typing-dots span {
  width: 6px;
  height: 6px;
  background: #a30041;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.chatbot__typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}
.chatbot__typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.chatbot__typing-indicator span:last-child {
  font-size: 12px;
  color: #6b7280;
}

/* Контейнер ввода */
.chatbot__input-container {
  padding: 20px;
  border-top: 1px solid rgba(55, 54, 60, 0.1);
  background: #ffffff;
}

.chatbot__input-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chatbot__message-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #f5f5f7;
  border-radius: 24px;
  font-size: 14px;
  resize: none;
  outline: none;
  transition: all 0.3s ease;
  background: #f5f5f7;
  color: #37363c;
  max-height: 120px;
}

.chatbot__message-input:focus {
  border-color: #a30041;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(163, 0, 65, 0.1);
}

.chatbot__message-input::placeholder {
  color: #9ca3af;
}

.chatbot__send-btn {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #a30041 0%, #d4004e 100%);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.chatbot__send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(163, 0, 65, 0.3);
}

.chatbot__send-btn:active {
  transform: scale(0.95);
}

.chatbot__send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Уведомления */
.notification {
  position: fixed;
  top: 30px;
  right: 30px;
  background: #ffffff;
  border: 1px solid rgba(55, 54, 60, 0.1);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateX(100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
  max-width: 300px;
}

.notification--show {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.notification__content {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #37363c;
  font-size: 14px;
  font-weight: 500;
}

.notification__content i {
  color: #10b981;
  font-size: 16px;
}

/* Адаптивность */
@media (max-width: 480px) {
  .chatbot {
    bottom: 20px;
    right: 20px;
  }

  .chatbot__window {
    width: calc(100vw - 40px);
    height: calc(100vh - 100px);
    bottom: 80px;
    right: 20px;
    left: 20px;
  }

  .notification {
    right: 20px;
    left: 20px;
    max-width: none;
  }
}

/* Анимации появления */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Анимация загрузки */
.chatbot__loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Эффекты при наведении */
.chatbot__trigger::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #a30041, #d4004e, #a30041);
  border-radius: 50%;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.chatbot__trigger:hover::before {
  opacity: 1;
}
