/* Chatbot Container */
#chatbot-widget {
  position: fixed;
  display: flex;
  bottom: 30px;
  left: 30px;
  z-index: 10000;
}

/* Chatbot Icon with animated text bubble */
.chatbot-icon-container {
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  animation: slideInRight 0.6s ease-out;
}

/* Animated Text Bubble */
.chat-bubble {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 12px 18px;
  border-radius: 20px 20px 20px 5px;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: fadeInScale 0.4s ease-out;
  transition: all 0.3s ease;
}

.chat-bubble:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.chat-bubble::after {
  content: "";
  position: absolute;
  left: -8px;
  bottom: 12px;
  width: 0;
  height: 0;
  border-right: 10px solid rgba(255, 255, 255, 0.1);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

/* Chatbot Icon */
.chatbot-icon {
  width: 65px;
  height: 65px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  animation: pulse 2s infinite;
}

.chatbot-icon:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 15px 50px rgba(102, 126, 234, 0.6);
}

.chatbot-icon svg {
  width: 35px;
  height: 35px;
  fill: white;
}

/* Notification Badge */
.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ff4757;
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  animation: bounce 1s infinite;
  box-shadow: 0 3px 10px rgba(255, 71, 87, 0.5);
}

/* Chat Window */
.chat-window {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 400px;
  height: 600px;
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideInUp 0.4s ease-out;
}

.chat-window.active {
  display: flex;
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.chat-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.chat-avatar svg {
  width: 25px;
  height: 25px;
  fill: white;
}

.chat-header-text h3 {
  font-size: 18px;
  margin-bottom: 3px;
}

.chat-header-text p {
  font-size: 12px;
  opacity: 0.9;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #2ecc71;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.close-chat {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.close-chat:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: rgba(22, 33, 62, 0.5);
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.5);
  border-radius: 10px;
}

.message {
  margin-bottom: 15px;
  animation: fadeInUp 0.3s ease-out;
  display: flex;
  flex-direction: column;
}

.message-content {
  padding: 12px 16px;
  border-radius: 15px;
  max-width: 75%;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.5;
}

.bot-message .message-content {
  background: rgba(102, 126, 234, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(102, 126, 234, 0.3);
  color: #e0e0e0;
  border-radius: 15px 15px 15px 5px;
  align-self: flex-start;
}

.user-message .message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 15px 15px 5px 15px;
  align-self: flex-end;
  margin-left: auto;
}

.message-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 5px;
  padding: 0 5px;
}

/* Typing Indicator */
.typing-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(102, 126, 234, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 15px 15px 15px 5px;
  max-width: 75px;
  margin-bottom: 15px;
}

.typing-indicator.active {
  display: flex;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: #667eea;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* Chat Input */
.chat-input-container {
  padding: 20px;
  background: rgba(26, 26, 46, 0.8);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  padding: 12px 20px;
  color: white;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.chat-input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.send-btn {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.send-btn:active {
  transform: scale(0.95);
}

.send-btn svg {
  width: 20px;
  height: 20px;
  fill: white;
}

/* Animations */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
  }
  50% {
    box-shadow: 0 10px 50px rgba(102, 126, 234, 0.6);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes typingBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

/* Responsive */
@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 40px);
    height: calc(100vh - 50px);
    bottom: 10px;
    left: 10px;
    border-radius: 15px;
  }

  #chatbot-widget {
    bottom: 20px;
    left: 20px;
  }

  .chat-bubble {
    display: none;
  }

  .chatbot-icon {
    width: 60px;
    height: 60px;
  }
}
