/* =========================================
   AI Chatbot Widget
   ========================================= */

.chatbot-widget {
  position: fixed;
  bottom: 120px;
  right: 30px;
  z-index: 9999;
  font-family: var(--font-main);
}

.chatbot-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--gradient-1);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.chatbot-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.4);
}

.chatbot-button i {
  font-size: 16px;
}

.chatbot-window {
  position: fixed;
  bottom: 120px;
  right: 30px;
  width: 380px;
  height: 520px;
  background: var(--primary);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 10000;
}

.chatbot-window.active {
  display: flex;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--gradient-1);
  color: #fff;
}

.chatbot-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
}

.chatbot-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

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

.chatbot-messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: var(--primary-light);
}

.chatbot-message {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chatbot-message.bot {
  align-items: flex-start;
}

.chatbot-message.user {
  align-items: flex-end;
}

.chatbot-message-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.chatbot-message.bot .chatbot-message-bubble {
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.chatbot-message.user .chatbot-message-bubble {
  background: var(--gradient-1);
  color: #fff;
}

.chatbot-input-area {
  padding: 16px 20px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}

.chatbot-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  font-family: var(--font-main);
  outline: none;
  transition: var(--transition);
}

.chatbot-input:focus {
  border-color: var(--accent);
}

.chatbot-send {
  width: 44px;
  height: 44px;
  background: var(--gradient-1);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.chatbot-send:hover {
  transform: scale(1.05);
}

.chatbot-typing {
  display: none;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 80px;
}

.chatbot-typing.active {
  display: block;
}

.chatbot-typing-dots {
  display: flex;
  gap: 4px;
}

.chatbot-typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  30% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .chatbot-widget {
    bottom: 100px;
    right: 20px;
  }

  .chatbot-button {
    padding: 10px 16px;
    font-size: 13px;
  }

  .chatbot-window {
    width: calc(100vw - 40px);
    height: calc(100vh - 200px);
    bottom: 100px;
    right: 20px;
  }
}
