/* Chatbot CSS */
.chatbot-container {
  position: fixed;
  bottom: 140px;
  right: 75px;
  width: 420px;
  max-width: 95vw;
  height: 600px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border-radius: 24px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 1001 !important;
  animation: slideUp 0.4s ease-out;
}

.chatbot-container.show {
  display: flex;
}

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

.chat-header {
  background: #e9582c;
  color: #ffffff;
  padding: 24px;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
}

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

.status-indicator {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

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

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

.message-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 85%;
}

.message-wrapper.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

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

.message {
  padding: 14px 18px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.5;
  position: relative;
  animation: messageSlide 0.4s ease-out;
  white-space: pre-wrap;
}

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

.message.bot {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  color: #1e293b;
  border-bottom-left-radius: 6px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.message.user {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.avatar.bot img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: scale-down;
}

.avatar.user {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.option-btn {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  color: #4f46e5;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.option-btn:hover {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  border-color: #4f46e5;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25);
}

.treatments-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.treatment-item {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  color: #374151;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.treatment-item:hover {
  background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
  border-color: #7c3aed;
  transform: translateY(-1px);
}

.chat-input {
  display: flex;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 20px;
  gap: 12px;
}

.input-wrapper {
  flex: 1;
  position: relative;
}

#userInput {
  width: 100%;
  border: 1px solid #e2e8f0;
  padding: 16px 20px;
  font-size: 15px;
  border-radius: 16px;
  outline: none;
  transition: all 0.3s ease;
  background: #f8fafc;
  font-family: inherit;
}

#userInput:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
  background: #ffffff;
}

.send-btn {
  background: #e95a2f;
  border: none;
  color: white;
  padding: 9px 20px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 18px;
  /* box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4); */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50%;
}

.send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(79, 70, 229, 0.5);
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  border-bottom-left-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.typing-text {
  color: #64748b;
  font-size: 14px;
  margin-right: 8px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4f46e5;
  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);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

.welcome-animation {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
}

.welcome-logo {
  font-size: 48px;
  margin-bottom: 16px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

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

  .chat-header {
    padding: 20px;
    font-size: 20px;
  }

  .message-wrapper {
    max-width: 90%;
  }

  .treatments-grid {
    grid-template-columns: 1fr;
  }
}

/* Close button (add this to your HTML if needed) */
.close-btn {
  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 ease;
  position: absolute;
  top: 15px;
  right: 15px;
}

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

@media (max-width: 480px) {
  .chatbot-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    bottom: 0;
    right: 0;
  }
}