*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 24px;
  background-color: #FFFAFA;
  color: #202020;
  height: 100vh;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

.progress-bar-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgb(241, 241, 241);
  z-index: 1000;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: #e0edff;
  transition: width 0.5s ease;
}

.chat-container {
  max-width: 800px;
  margin: 0 auto;
  height: 100vh;
  overflow-y: auto;
  padding: 16px 20px 50vh 20px;
  scroll-behavior: smooth;
}

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

.chat-container::-webkit-scrollbar-track {
  background: transparent;
}

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

.chat-messages {
  display: flex;
  flex-direction: column;
}

/* Bot message group */
.bot-group {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}

.bot-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
}

.bot-avatar-placeholder {
  width: 40px;
  min-width: 40px;
  flex-shrink: 0;
}

.bot-bubbles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100% - 52px);
}

/* Bot bubble */
.bot-bubble {
  background: rgb(247, 248, 255);
  color: #202020;
  padding: 8px 16px;
  border-radius: 6px;
  width: fit-content;
  max-width: 100%;
  word-wrap: break-word;
  animation: fadeInUp 0.3s ease forwards;
  opacity: 0;
}

.bot-bubble img {
  max-width: 100%;
  border-radius: 6px;
  display: block;
}

/* Guest bubble */
.guest-bubble {
  background: #303235;
  color: #FFFFFF;
  padding: 8px 16px;
  border-radius: 6px;
  width: fit-content;
  max-width: 80%;
  margin-left: auto;
  margin-bottom: 8px;
  word-wrap: break-word;
  animation: fadeInUp 0.3s ease forwards;
  opacity: 0;
}

/* Typing indicator */
.typing-bubble {
  background: rgb(247, 248, 255);
  padding: 8px 16px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b7280;
  animation: typingPulse 1.4s infinite;
}

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

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

@keyframes typingPulse {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* Choice buttons */
.choices-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  margin-bottom: 12px;
  padding-left: 48px;
  animation: fadeIn 0.3s ease forwards;
}

.choice-btn {
  background: #303235;
  color: #FFFFFF;
  padding: 12px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 24px;
  transition: opacity 0.2s ease;
  opacity: 0;
  animation: fadeInBtn 0.3s ease forwards;
  width: 100%;
  text-align: left;
}

.choice-btn:hover {
  opacity: 0.85;
}

/* Number input */
.number-input-container {
  display: flex;
  gap: 8px;
  max-width: 300px;
  margin-top: 12px;
  margin-bottom: 8px;
  animation: fadeIn 0.3s ease forwards;
}

.number-input-container input {
  flex: 1;
  background: #FFFFFF;
  color: #202020;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 24px;
  outline: none;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.number-input-container input::placeholder {
  color: #9095A0;
}

.number-input-container button {
  background: #303235;
  color: #FFFFFF;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 24px;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.number-input-container button:hover {
  opacity: 0.85;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Responsive */
@media (max-width: 640px) {
  .chat-container {
    padding: 12px 12px 50vh 12px;
  }

  .choices-container {
    padding-left: 0;
  }

  .number-input-container {
    max-width: 100%;
    width: 100%;
  }

  .bot-bubbles {
    max-width: calc(100% - 52px);
  }
}
