/* AI Chatbot Styles */
#chatbot-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  font-family: var(--default-font);
}

/* Toggle Button */
.chatbot-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-color), var(--secondary-accent));
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(91, 127, 110, 0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
}

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

.chatbot-toggle.hidden {
  display: none;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(91, 127, 110, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(91, 127, 110, 0.7);
  }
}

/* Chat Window */
.chatbot-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 550px;
  max-height: calc(100vh - 140px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

.chatbot-window.active {
  display: flex;
}

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

/* Chat Header */
.chatbot-header {
  background: linear-gradient(135deg, var(--accent-color), var(--secondary-accent));
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

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

.chatbot-status {
  font-size: 12px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chatbot-status::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.chatbot-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 5px;
  transition: all 0.2s ease;
  border-radius: 4px;
}

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

/* Messages Area */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

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

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

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

/* Message Bubble */
.message {
  display: flex;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}

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

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-color), var(--secondary-accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.user-message .message-avatar {
  background: #64748b;
  order: 1;
}

.message-content {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.user-message {
  flex-direction: row-reverse;
}

.user-message .message-content {
  background: linear-gradient(135deg, var(--accent-color), var(--secondary-accent));
  color: white;
}

.message-content p {
  margin: 0;
  line-height: 1.5;
  font-size: 14px;
}

.message-content ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.message-content li {
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.5;
}

.message-content strong {
  font-weight: 600;
}

/* Quick Questions */
.quick-questions {
  margin-top: 12px;
}

.quick-questions-label {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #64748b;
}

.quick-question-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent-color), var(--secondary-accent));
  color: white;
  border: none;
  padding: 6px 12px;
  margin: 4px 4px 4px 0;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-question-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(91, 127, 110, 0.3);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.typing-indicator .message-content {
  padding: 16px;
  display: flex;
  gap: 4px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: #94a3b8;
  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% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

/* Input Container */
.chatbot-input-container {
  padding: 16px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
}

.chatbot-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
  font-family: var(--default-font);
}

.chatbot-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(91, 127, 110, 0.1);
}

.chatbot-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-color), var(--secondary-accent));
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(91, 127, 110, 0.4);
}

.chatbot-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  #chatbot-container {
    bottom: 20px;
    right: 20px;
  }

  .chatbot-toggle {
    width: 56px;
    height: 56px;
    font-size: 24px;
  }

  .chatbot-window {
    width: calc(100vw - 40px);
    height: calc(100vh - 100px);
    bottom: 76px;
    right: -10px;
  }

  .chatbot-header {
    padding: 16px;
  }

  .chatbot-avatar {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .chatbot-title h4 {
    font-size: 14px;
  }

  .message-content {
    max-width: 80%;
  }
}
