/* AI Chat Widget - используем существующие стили проекта */
.ai-chat-widget {
  max-width: 100%;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  background: #fff;
  border: none;
  border-radius: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.ai-chat-widget.minimized .ai-chat-body {
  display: none;
}

.ai-chat-header {
  background: #ffffff;
  color: #000;
  padding: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border-bottom: 2px solid #ffffff;
  position: relative;
  overflow: hidden;
}

.ai-chat-header-gif {
  width: 232px;
  height: auto;
  max-height: 200px;
  display: block;
  object-fit: contain;
  margin: 0 auto;
}

.ai-chat-toggle {
  background: #fff !important;
  color: #000 !important;
  border: 2px solid #000 !important;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  margin: 0 !important;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  flex-shrink: 0;
}

.ai-chat-toggle:hover {
  background: #f9b6ba !important;
}

.ai-chat-body {
  display: flex;
  flex-direction: column;
  max-height: 400px;
  overflow: hidden;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}

.ai-chat-message {
  display: flex;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}

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

.ai-chat-message.user {
  flex-direction: row-reverse;
}

.ai-chat-avatar {
  width: 50px;
  height: 50px;
  border-radius: 0;
  border: 2px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: #fff;
}

.ai-chat-message.user .ai-chat-avatar {
  background: #caffd0;
  border-color: #34b44a;
}

.ai-chat-message.ai .ai-chat-avatar {
  background: #f9b6ba;
  border-color: #000;
}

.ai-chat-content {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 6px;
  word-wrap: break-word;
  line-height: 1.5;
  border: 2px solid #000;
  background: #fff;
  color: #000;
  font-size: 14px;
}

.ai-chat-message.user .ai-chat-content {
  background: #caffd0;
  border-color: #34b44a;
  color: #000;
}

.ai-chat-message.ai .ai-chat-content {
  background: #fff;
  border-color: #000;
  color: #000;
}

.ai-chat-input-container {
  background: transparent;
  display: flex;
  gap: 10px;
  align-items: center;
}

.ai-chat-input {
  flex: 1;
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 2px solid #000 !important;
  border-radius: 0 !important;
  font-size: 16px;
  outline: none;
  background: #fff;
  color: #000;
      font-family: system-ui;
}

.ai-chat-input:focus {
  border-color: #000 !important;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.ai-chat-send {
  width: auto;
  height: auto;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  margin-bottom: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-chat-send img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.ai-chat-send:hover img {
  opacity: 0.8;
}

.ai-chat-send:active img {
  opacity: 0.6;
}

.ai-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ai-chat-send:disabled img {
  opacity: 0.5;
}

.ai-chat-loading {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}

.ai-chat-loading span {
  width: 8px;
  height: 8px;
  background: #34b44a;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

.ai-chat-loading span:nth-child(1) {
  animation-delay: -0.32s;
}

.ai-chat-loading span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Responsive */
@media (max-width: 900px) {
  .ai-chat-widget {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .ai-chat-body {
    max-height: 300px;
  }
}
