.chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}

.chatbot-bubble {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 24px;
  box-shadow: 0 4px 20px rgba(59, 111, 212, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.chatbot-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(59, 111, 212, 0.45);
}

.chatbot-bubble:active {
  transform: scale(0.95);
}

.chatbot-panel {
  display: none;
  width: 380px;
  height: 540px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  margin-bottom: 12px;
  flex-direction: column;
  overflow: hidden;
  animation: chatbotSlideIn 0.25s ease;
}

@keyframes chatbotSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chatbot-widget.open .chatbot-panel {
  display: flex;
}

.chatbot-header {
  padding: 16px 20px;
  background: var(--accent);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.chatbot-title {
  font-weight: 600;
  font-size: 15px;
}

.chatbot-status {
  font-size: 12px;
  opacity: 0.8;
}

.chatbot-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8f9fc;
}

.chatbot-messages::-webkit-scrollbar {
  width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #d0d5e0;
  border-radius: 2px;
}

.message {
  display: flex;
  max-width: 85%;
}

.message.user {
  align-self: flex-end;
}

.message.bot {
  align-self: flex-start;
}

.message-content {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  word-wrap: break-word;
  white-space: pre-wrap;
}

.message.user .message-content {
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.message.bot .message-content {
  background: white;
  color: var(--text-primary);
  border: 1px solid #e8ecf4;
  border-bottom-left-radius: 4px;
}

.chatbot-input-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid #e8ecf4;
  background: white;
  flex-shrink: 0;
}

.chatbot-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f0f2f7;
  color: var(--text-primary);
  font-family: inherit;
}

.chatbot-input::placeholder {
  color: var(--text-muted);
}

.chatbot-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}

.chatbot-send:hover {
  background: var(--accent-dim);
}

.chatbot-send:active {
  transform: scale(0.9);
}

.typing .message-content {
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing .message-content span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingDot 1.2s infinite;
}

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

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

@keyframes typingDot {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}
