/* Chat Modal */
.chat-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.5);
  z-index: 1000;
}

.chat-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: white;
  border-radius: 20px 20px 0 0;
  height: 90vh;
  max-width: 480px;
  margin: auto;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
  padding: 12px;
  gap: 12px;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.chat-info {
  font-size: 12px;
}

.chat-type {
  color: #666;
}

.chat-body {
  flex: 1;
  display: flex;
  flex-flow: column;
  gap: 10px;
  overflow: auto;
  scrollbar-width: none;
}

.chat-welcome {
  display: grid;
  gap: 4px;
  justify-items: center;
  font-size: 14px;
  text-align: center;
}

.chat-welcome-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin-bottom: 16px;
}

.chat-welcome h2 {
  font-size: 24px;
}

.chat-welcome-actions {
  display: grid;
  gap: 8px;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  margin-top: 24px;
}

.chat-welcome-action {
  flex-flow: column;
  font-size: 12px;
  padding: 0;
}

.chat-welcome-action .icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #E2E6E9;
  padding: 8px;
}

.chat-input-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-icon-button .icon {
  width: 20px;
  height: 20px;
}

.chat-input-wrapper {
  flex: 1;
  background-color: #f3f4f6;
  border-radius: 9em;
  padding: 8px 8px 8px 16px;
  display: flex;
  align-items: center;
}

.chat-input {
  flex: 1;
}

/*--------------------
Messages
--------------------*/
.messages {
  display: flex;
  flex-flow: column;
  gap: 12px;
  flex: 1 1 auto;
  font-size: 14px;
}
.message {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  transform: scale(0);
  transform-origin: 0 0;
  animation: bounce 500ms linear both;
}
.message .content,
.reply-button {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 20px;
  background: #F3F3F3;
  line-height: 1.4;
  white-space: pre-line;
}
.message .avatar {
  border-radius: 30px;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}
.message.user {
  align-self: flex-end;
}
.message.user .content {
  background: var(--accent);
  color: #FFF;
}
.message.loading {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}
.message.loading .content {
  display: flex;
  gap: 4px;
  align-items: flex-end;
}
.message.loading .content::before {
  content: "";
  width: 35px;
  border-top: 5px dotted #888;
  animation: ball 0.45s cubic-bezier(0, 0, 0.15, 1) alternate infinite;
}
.reply-buttons {
  display: flex;
  flex-flow: wrap;
  justify-content: flex-end;
  gap: 2px;
}
.message-img {
  max-height: 40px;
}
/*--------------------
Bounce
--------------------*/
@keyframes bounce {
  0% {
    transform: matrix3d(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  }
  4.7% {
    transform: matrix3d(0.45, 0, 0, 0, 0, 0.45, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  }
  9.41% {
    transform: matrix3d(0.883, 0, 0, 0, 0, 0.883, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  }
  14.11% {
    transform: matrix3d(1.141, 0, 0, 0, 0, 1.141, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  }
  18.72% {
    transform: matrix3d(1.212, 0, 0, 0, 0, 1.212, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  }
  24.32% {
    transform: matrix3d(1.151, 0, 0, 0, 0, 1.151, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  }
  29.93% {
    transform: matrix3d(1.048, 0, 0, 0, 0, 1.048, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  }
  35.54% {
    transform: matrix3d(0.979, 0, 0, 0, 0, 0.979, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  }
  41.04% {
    transform: matrix3d(0.961, 0, 0, 0, 0, 0.961, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  }
  52.15% {
    transform: matrix3d(0.991, 0, 0, 0, 0, 0.991, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  }
  63.26% {
    transform: matrix3d(1.007, 0, 0, 0, 0, 1.007, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  }
  85.49% {
    transform: matrix3d(0.999, 0, 0, 0, 0, 0.999, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  }
  100% {
    transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  }
}
@keyframes ball {
  from {
    transform: translateY(0) scaleY(0.8);
  }
  to {
    transform: translateY(-10px);
  }
}
