/* Chatbot Widget Styles */

.chat-toggle-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chat-toggle-btn:active {
  transform: scale(0.95);
}

#chat-widget-container {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 380px;
  max-height: 0;
  border-radius: 12px;
  background: white;
  box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 9998;
  display: flex;
  flex-direction: column;
}

#chat-widget-container.open {
  max-height: 600px;
  opacity: 1;
  pointer-events: auto;
}

.chat-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
}

.chat-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.chat-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.chat-close-btn:hover {
  transform: rotate(90deg);
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  background: #fafafa;
}

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

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

.chat-message p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  max-width: 90%;
}

.chat-message ul {
  margin: 8px 0;
  padding-left: 20px;
  font-size: 13px;
}

.chat-message ul li {
  margin: 4px 0;
}

.chat-message.user p {
  background: #667eea;
  color: white;
  align-self: flex-end;
  margin-left: auto;
}

.chat-message.bot p {
  background: white;
  color: #333;
  border: 1px solid #e0e0e0;
  align-self: flex-start;
}

.chat-message.bot.error p {
  background: #fee;
  border-color: #fcc;
  color: #c33;
}

.chat-message.bot.typing p {
  color: #999;
  font-style: italic;
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e0e0e0;
  background: white;
}

#chat-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

#chat-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

#chat-input::placeholder {
  color: #999;
}

.chat-send-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 60px;
}

.chat-send-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chat-send-btn:active:not(:disabled) {
  transform: translateY(0);
}

.chat-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 480px) {
  #chat-widget-container {
    width: calc(100vw - 40px);
    max-width: 100%;
    bottom: 80px;
  }

  .chat-toggle-btn {
    bottom: 16px;
    right: 16px;
  }

  #chat-messages {
    max-height: 300px;
  }

  .chat-message p {
    max-width: 85%;
  }
}

/* Scroll bar styling */
#chat-messages::-webkit-scrollbar {
  width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
  background: #999;
}
