/* AI Chatbot Styles */
.ai-chat-button {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #22756d, #2e7d32);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(34, 117, 109, 0.4);
  z-index: 1000;
  transition: all 0.4s ease;
  opacity: 0;
  transform: translateY(100px);
  pointer-events: none;
}

.ai-chat-button.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ai-chat-button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 25px rgba(34, 117, 109, 0.5);
}

.chat-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff6f61;
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  border: 2px solid white;
}

.ai-chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 350px;
  height: 500px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateY(100%) scale(0.8);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
}

.ai-chat-widget.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.chat-header {
  background: linear-gradient(135deg, #22756d, #2e7d32);
  color: white;
  padding: 16px;
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-title {
  font-weight: 600;
  font-size: 16px;
}

.chat-status {
  font-size: 12px;
  opacity: 0.9;
}

.close-chat {
  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 0.2s;
}

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

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8f9fa;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 2px;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: messageSlide 0.3s ease-out;
}

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

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

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

.message-content {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.user-message .message-content {
  background: linear-gradient(135deg, #22756d, #2e7d32);
  color: white;
  border-bottom-right-radius: 6px;
}

.bot-message .message-content {
  background: white;
  color: #333;
  border: 1px solid #e1e5e9;
  border-bottom-left-radius: 6px;
}

.message-time {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
  align-self: flex-end;
}

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

.typing {
  opacity: 0.7;
}

.typing-dots {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

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

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingDot {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.chat-input-container {
  padding: 16px;
  border-top: 1px solid #e1e5e9;
  display: flex;
  gap: 8px;
  background: white;
  border-radius: 0 0 16px 16px;
}

#chat-input {
  flex: 1;
  border: 1px solid #e1e5e9;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#chat-input:focus {
  border-color: #22756d;
}

.send-button {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #22756d, #2e7d32);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.send-button:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(34, 117, 109, 0.3);
}

.send-button:active {
  transform: scale(0.95);
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .ai-chat-widget {
    width: calc(100vw - 20px);
    height: calc(100vh - 40px);
    bottom: 10px;
    right: 10px;
    left: 10px;
    border-radius: 12px;
  }
  
  .ai-chat-button {
    bottom: 70px;
    right: 15px;
  }
}

/* Dark theme support */
body.dark-theme .ai-chat-widget {
  background: #2d2d2d;
}

body.dark-theme .chat-messages {
  background: #1e1e1e;
}

body.dark-theme .bot-message .message-content {
  background: #3d3d3d;
  color: #e0e0e0;
  border-color: #555;
}

body.dark-theme #chat-input {
  background: #3d3d3d;
  color: #e0e0e0;
  border-color: #555;
}

body.dark-theme .chat-input-container {
  background: #2d2d2d;
  border-color: #555;
}