/* --- CHATBOT STYLES --- */

.chatbot-container {
  position: fixed;
  bottom: 100px;
  right: 25px;
  z-index: 9998;
  display: none;
  flex-direction: column;
  gap: 15px;
}

.chatbot-container.active {
  display: flex;
}

.chatbot-modal {
  width: 400px;
  height: 600px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
  overflow: hidden;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chatbot-header {
  background: linear-gradient(135deg, #241594 0%, #941574 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.chatbot-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.chatbot-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8f9fc;
}

/* Scrollbar styling */
.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: #941574;
  border-radius: 10px;
}

.chatbot-message {
  display: flex;
  gap: 8px;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chatbot-message.user {
  justify-content: flex-end;
}

.chatbot-message.bot {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 15px;
  word-wrap: break-word;
  line-height: 1.5;
  font-size: 0.95rem;
}

.chatbot-message.user .message-bubble {
  background: linear-gradient(135deg, #241594 0%, #941574 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.chatbot-message.bot .message-bubble {
  background: white;
  color: #333;
  border: 1px solid #e0e0e0;
  border-bottom-left-radius: 4px;
}

.message-bubble a {
  color: #241594;
  font-weight: 600;
  text-decoration: underline;
}

.chatbot-message.user .message-bubble a {
  color: #ffd9f0;
}

.chatbot-input-container {
  padding: 15px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 8px;
  background: white;
}

.chatbot-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 25px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-family: 'Segoe UI', Roboto, sans-serif;
  transition: all 0.3s ease;
}

.chatbot-input:focus {
  outline: none;
  border-color: #941574;
  box-shadow: 0 0 8px rgba(148, 21, 116, 0.3);
}

.chatbot-send {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #241594 0%, #941574 100%);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.chatbot-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(36, 21, 148, 0.3);
}

.chatbot-send:active {
  transform: scale(0.95);
}

/* Dark Mode */
html.dark-mode .chatbot-modal {
  background: #252535;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

html.dark-mode .chatbot-messages {
  background: #1a1a28;
}

html.dark-mode .chatbot-message.bot .message-bubble {
  background: #2a2a3a;
  color: #d0d0d8;
  border-color: #3a3a4a;
}

html.dark-mode .chatbot-input-container {
  background: #252535;
  border-top-color: #3a3a4a;
}

html.dark-mode .chatbot-input {
  background: #1a1a28;
  border-color: #3a3a4a;
  color: #d0d0d8;
}

html.dark-mode .chatbot-input::placeholder {
  color: #888;
}

html.dark-mode .chatbot-input:focus {
  border-color: #d4a5ff;
  box-shadow: 0 0 8px rgba(200, 184, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .chatbot-modal {
    width: calc(100vw - 50px);
    height: 70vh;
    max-height: 500px;
    max-width: 450px;
  }

  .chatbot-container {
    bottom: 85px;
    right: 20px;
  }

  .message-bubble {
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  .chatbot-modal {
    width: calc(100vw - 30px);
    height: 65vh;
  }

  .chatbot-header h3 {
    font-size: 1rem;
  }

  .chatbot-messages {
    padding: 15px;
  }

  .chatbot-input {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .chatbot-send {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #941574;
  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.5;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-10px);
  }
}
