/* AI Chatbot Frontend Styles - Ensure Visibility */
#ai-chatbot-widget {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.ai-chatbot-widget {
  position: fixed;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ai-chatbot-widget.bottom-right {
  bottom: 20px;
  right: 20px;
}

.ai-chatbot-widget.bottom-left {
  bottom: 20px;
  left: 20px;
}

.ai-chatbot-widget.top-right {
  top: 20px;
  right: 20px;
}

.ai-chatbot-widget.top-left {
  top: 20px;
  left: 20px;
}

.chatbot-toggle {
  width: 60px;
  height: 60px;
  background: var(--chatbot-primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--chatbot-shadow);
  transition: all 0.3s ease;
  color: white;
}

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

.chatbot-container {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: var(--chatbot-width);
  height: var(--chatbot-height);
  background: var(--chatbot-background-color);
  border-radius: var(--chatbot-border-radius);
  box-shadow: var(--chatbot-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.chatbot-title h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.language-selector select {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  margin-top: 5px;
}

.language-selector select option {
  background: var(--chatbot-primary-color);
  color: white;
}

.chatbot-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

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

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: var(--chatbot-background-color);
}

.message {
  max-width: 80%;
  word-wrap: break-word;
}

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

.user-message .message-content {
  background: var(--chatbot-primary-color);
  color: white;
  padding: 12px 16px;
  border-radius: 18px 18px 4px 18px;
}

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

.bot-message .message-content {
  background: #f1f3f5;
  color: var(--chatbot-text-color);
  padding: 12px 16px;
  border-radius: 18px 18px 18px 4px;
}

.message-time {
  font-size: 11px;
  color: #666;
  margin-top: 4px;
  text-align: right;
}

.bot-message .message-time {
  text-align: left;
}

.file-upload-area {
  padding: 10px 20px;
  border-top: 1px solid #eee;
  background: #f9f9f9;
}

.uploaded-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.uploaded-file {
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  gap: 6px;
}

.uploaded-file .remove-file {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-container {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  border-top: 1px solid #eee;
  gap: 10px;
  background: var(--chatbot-background-color);
}

.attach-button,
.send-button {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.attach-button:hover,
.send-button:hover {
  background: #f1f3f5;
  color: var(--chatbot-primary-color);
}

#chatbot-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  color: var(--chatbot-text-color);
  background: var(--chatbot-background-color);
}

#chatbot-input:focus {
  border-color: var(--chatbot-primary-color);
}

.send-button {
  background: var(--chatbot-primary-color);
  color: white;
}

.send-button:hover {
  background: var(--chatbot-primary-color);
  opacity: 0.9;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: #f1f3f5;
  border-radius: 18px 18px 18px 4px;
  align-self: flex-start;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #999;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

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

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

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  .chatbot-container {
    width: 300px !important;
    height: 450px !important;
  }

  .ai-chatbot-widget.bottom-right,
  .ai-chatbot-widget.bottom-left {
    bottom: 10px;
  }

  .ai-chatbot-widget.bottom-right {
    right: 10px;
  }

  .ai-chatbot-widget.bottom-left {
    left: 10px;
  }
}

/* Scrollbar styling */
.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

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

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

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
