.chatbot-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #2563eb;
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 1000;
  transition: transform 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-toggle:hover {
  transform: scale(1.1);
  background: #1d4ed8;
}

.chatbot {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 400px;
  max-width: calc(100vw - 40px);
  max-height: 550px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  display: none;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
}

.chatbot--open {
  display: flex;
}

.chatbot-header {
  background: #1e3a5f;
  color: white;
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.chatbot-header h3 {
  margin: 0;
  font-size: 1.1rem;
  flex: 1;
}

.chatbot-subtitle {
  font-size: 0.8rem;
  opacity: 0.8;
  width: 100%;
}

.chatbot-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.8;
}

.chatbot-close:hover {
  opacity: 1;
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  max-height: 380px;
  background: #f8fafc;
}

.chatbot-message {
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 90%;
  line-height: 1.5;
  font-size: 0.9rem;
}

.chatbot-message p {
  margin: 0 0 8px 0;
}

.chatbot-message p:last-child {
  margin-bottom: 0;
}

.chatbot-message--user {
  background: #2563eb;
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.chatbot-message--bot {
  background: white;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}

.chatbot-message--discovery {
  background: #ecfdf5;
  border-color: #10b981;
  border-left: 3px solid #10b981;
}

.chatbot-message--typing {
  opacity: 0.7;
  font-style: italic;
}

.chatbot-message a {
  color: #2563eb;
  text-decoration: underline;
}

.chatbot-message--user a {
  color: #bfdbfe;
}

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

.chatbot-message li {
  margin-bottom: 4px;
}

.chatbot-input-container {
  display: flex;
  padding: 12px;
  border-top: 1px solid #e2e8f0;
  background: white;
  gap: 8px;
}

.chatbot-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
}

.chatbot-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.chatbot-send {
  padding: 10px 20px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.chatbot-send:hover {
  background: #1d4ed8;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  .chatbot {
    bottom: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .chatbot-messages {
    max-height: calc(100vh - 180px);
  }

  .chatbot-toggle {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }
}

/* Fix: Ensure links are visible in discovery messages */
.chatbot-message--discovery a {
  color: #1e40af !important;
  text-decoration: underline;
  font-weight: 500;
}

.chatbot-message--discovery a:hover {
  color: #1e3a8a !important;
}

/* Ensure list items are visible */
.chatbot-message--discovery li,
.chatbot-message--discovery p {
  color: #1e293b;
}

/* Force link visibility in bot messages */
.chatbot-message--bot a,
.chatbot-message--bot a:link,
.chatbot-message--bot a:visited {
  color: #2563eb !important;
  text-decoration: underline !important;
  font-weight: 500;
}
.chatbot-message--bot a:hover {
  color: #1d4ed8 !important;
}
