/* Chatbot Widget CSS */
@import url("https://fonts.googleapis.com/css2?family=Lobster+Two:ital,wght@0,400;0,700;1,400;1,700&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap");
@import url('https://fonts.googleapis.com/css2?family=TikTok+Sans:opsz,wght@12..36,300..900&display=swap');

/* Floating Button */
.chatbot-floating-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #29ace9 0%, #082a44 100%);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(102, 144, 234, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: all 0.3s ease;
  z-index: 999;
}

.chatbot-floating-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.chatbot-floating-btn.active {
  background: linear-gradient(135deg, #29ace9 20%, #082a44 100%);
}

/* Chat Window */
.chatbot-window {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 380px;
  max-width: 90vw;
  height: 450px;
  background: transparent;
  border-radius: 16px;
  box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  transform: scale(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease;
  z-index: 999;
}

.chatbot-window.show {
  transform: scale(1);
}

/* Chat Header */
.chatbot-header {
  background: linear-gradient(135deg, #29ace9 0%, #082a44 100%);
  color: white;
  padding: 16px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  opacity: 0.8;
}

.chatbot-header h3 {
  margin: 0;
  font-family: "TikTok Sans", sans-serif;
  font-size: 16px;
  font-weight: 600;
}

.chatbot-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-close-btn:hover {
  transform: rotate(90deg);
  transition: transform 0.2s ease;
}

/* Messages Container */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.1);
}

/* Message Bubble */
.chatbot-message {
  display: flex;
  gap: 8px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  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;
}

.chatbot-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  text-align: justify;
}

.chatbot-message.user .chatbot-bubble {
  background: #29ace9;
  color: white;
  border-bottom-right-radius: 4px;
}

.chatbot-message.bot .chatbot-bubble {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  color: #333;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-bottom-left-radius: 4px;
}

/* Bot Avatar */
.chatbot-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}

.chatbot-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Input Area */
.chatbot-input-area {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0 0 12px 12px;
}

.chatbot-input {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.15);
  color: #333;
}

.chatbot-input::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

.chatbot-input:focus {
  border-color: #29ace9;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chatbot-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #29ace9 0%, #082a44 100%);
  border: none;
  color: white;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chatbot-send-btn:hover {
  transform: scale(1.05);
}

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

/* Loading Animation */
.chatbot-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 14px;
}

.chatbot-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #29ace9;
  animation: typing 1.4s infinite;
}

.chatbot-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.chatbot-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    opacity: 0.5;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-10px);
  }
}

/* Responsive */
@media (max-width: 480px) {
  .chatbot-window {
    width: calc(100vw - 20px);
    height: 60vh;
    bottom: 70px;
  }
  
  .chatbot-bubble {
    max-width: 80%;
  }
}

/* Scrollbar Style */
.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

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

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

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