/* Chatbot Styles */

.chat-toggle-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  z-index: 999;
}

.chat-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.chat-toggle-btn:active {
  transform: scale(0.95);
}

.chat-icon-open,
.chat-icon-close {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Chatbot Container */
.chatbot-container {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  height: 400px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  transform: scale(0) translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.chatbot-container.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Header */
.chatbot-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-radius: 12px 12px 0 0;
}

.chatbot-header-content h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.status-online {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  gap: 4px;
}

.close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* Messages Area */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8f9fa;
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #b0b0b0;
}

/* Message Styles */
.message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-content {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.message.user {
  align-items: flex-end;
}

.message.user .message-content {
  flex-direction: row-reverse;
}

.message.bot {
  align-items: flex-start;
}

.bot-avatar {
  font-size: 20px;
  flex-shrink: 0;
}

.message-text {
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.4;
  word-wrap: break-word; 
  font-size: 14px;
}

.message.user .message-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.message.bot .message-text {
  background: white;
  color: #333;
  border-bottom-left-radius: 4px;
  border: 1px solid #e0e0e0;
}

.message-time {
  font-size: 11px;
  color: #999;
  padding: 0 4px;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 16px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #667eea;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-10px);
  }
}

/* Input Area */
.chatbot-input-area {
  padding: 16px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.chat-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-input:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
}

.send-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: all 0.2s ease;
  font-size: 14px;
}

.send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.send-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Footer */
.chatbot-footer {
  padding: 12px 16px;
  background: #f0f0f0;
  border-top: 1px solid #e0e0e0;
  font-size: 12px;
  color: #666;
  text-align: center;
  line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 480px) {
  .chatbot-container {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    right: 0;
    bottom: 0;
    border-radius: 0;
    bottom: 0;
  }

  .chatbot-container.open {
    bottom: 0;
  }

  .chat-toggle-btn {
    bottom: 16px;
    right: 16px;
  }

  .message-text {
    max-width: 85%;
  }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
  .chatbot-container {
    background: #2d2d2d;
  }

  .chatbot-messages {
    background: #1a1a1a;
  }

  .message.bot .message-text {
    background: #3a3a3a;
    color: #e0e0e0;
    border-color: #555;
  }

  .chat-input {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
  }

  .chatbot-footer {
    background: #3a3a3a;
    border-color: #555;
    color: #aaa;
  }
}
