/* Chatbot Modal Styles */

/* Chat Icon - Lower Right Corner */
#chatbot-icon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background-color: #007bff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: transform 0.2s, box-shadow 0.2s;
}

#chatbot-icon:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#chatbot-icon svg {
  width: 32px;
  height: 32px;
  fill: white;
}

/* Modal Container */
#chatbot-modal {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 380px;
  height: 500px;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  z-index: 1001;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

#chatbot-modal.open {
  display: flex;
}

/* Modal Header */
#chatbot-header {
  background-color: #007bff;
  color: white;
  padding: 16px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#chatbot-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

#chatbot-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

#chatbot-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Messages Container */
#chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background-color: #f8f9fa;
}

/* Message Bubbles */
.message {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}

.message.user {
  align-items: flex-end;
}

.message.bot {
  align-items: flex-start;
}

.message-content {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  word-wrap: break-word;
  line-height: 1.4;
  font-size: 14px;
}

.message.user .message-content {
  background-color: #007bff;
  color: white;
  border-bottom-right-radius: 4px;
}

.message.bot .message-content {
  background-color: white;
  color: #333;
  border: 1px solid #e0e0e0;
  border-bottom-left-radius: 4px;
}

.message.error .message-content {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
}

.message-timestamp {
  font-size: 11px;
  color: #6c757d;
  margin-top: 4px;
  padding: 0 4px;
}

/* Typing Indicator */
#typing-indicator {
  display: none;
  align-items: flex-start;
  margin-bottom: 12px;
}

#typing-indicator.visible {
  display: flex;
}

.typing-dots {
  background-color: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  gap: 4px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background-color: #6c757d;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

/* Input Area */
#chatbot-input-area {
  padding: 16px;
  background-color: white;
  border-top: 1px solid #e0e0e0;
  border-radius: 0 0 12px 12px;
  display: flex;
  gap: 8px;
}

#chatbot-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

#chatbot-input:focus {
  border-color: #007bff;
}

#chatbot-input:disabled {
  background-color: #e9ecef;
  cursor: not-allowed;
}

#chatbot-send {
  padding: 10px 20px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

#chatbot-send:hover:not(:disabled) {
  background-color: #0056b3;
}

#chatbot-send:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

/* 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;
}
