/* DaisyUI微信风格覆盖 */

/* 覆盖DaisyUI的网格布局，使用flex布局 */
.chat {
  display: flex !important;
  flex-direction: column !important;
}

.chat.chat-end {
  align-items: flex-end;
}

.chat.chat-start {
  align-items: flex-start;
}

/* 消息滑入动画 */
@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 发送消息 - 绿色气泡 */
.chat.chat-end .chat-bubble {
  background-color: #95ec69 !important;
  color: #000000 !important;
  border-radius: 0.5rem 0.5rem 0.5rem 0.5rem !important;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

/* 接收消息 - 白色气泡 */
.chat.chat-start .chat-bubble {
  background-color: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #e5e5e5 !important;
  border-radius: 0.5rem 0.5rem 0.5rem 0.5rem !important;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

/* 发送消息箭头 */
.chat.chat-end .chat-bubble::before {
  content: "";
  position: absolute;
  right: -5px;
  bottom: 10px;
  width: 0;
  height: 0;
  border-left: 5px solid #95ec69;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  z-index: 1;
}

/* 接收消息箭头 */
.chat.chat-start .chat-bubble::before {
  content: "";
  position: absolute;
  left: -5px;
  bottom: 10px;
  width: 0;
  height: 0;
  border-right: 5px solid #ffffff;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  z-index: 1;
}

/* 消息时间样式 */
.chat-time {
  font-size: 0.75rem;
  color: #999999;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 400;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.chat.chat-start .chat-time {
  justify-content: flex-start;
}

/* 文件消息样式 */
.chat-bubble .file-message {
  min-width: 220px;
}

/* 文件消息按钮样式 */
.chat-bubble .file-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-start;
}

.chat-bubble .file-actions .download-btn,
.chat-bubble .file-actions .delete-btn {
  position: static;
  background: #07c160;
  color: white;
  border: none;
  padding: 0.5rem 0.875rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 400;
  transition: background 0.2s ease;
  flex-shrink: 0;
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  overflow: hidden;
}

.chat-bubble .file-actions .download-btn:hover {
  background: #06ad56;
}

.chat-bubble .file-actions .delete-btn {
  background: #07c160;
}

.chat-bubble .file-actions .delete-btn:hover {
  background: #06ad56;
}

.chat.chat-end .chat-bubble .file-actions .download-btn {
  background: rgba(0, 0, 0, 0.1);
  color: #000000;
}

.chat.chat-end .chat-bubble .file-actions .download-btn:hover {
  background: rgba(0, 0, 0, 0.15);
}

.chat.chat-end .chat-bubble .file-actions .delete-btn {
  background: rgba(0, 0, 0, 0.1);
  color: #000000;
}

.chat.chat-end .chat-bubble .file-actions .delete-btn:hover {
  background: rgba(0, 0, 0, 0.15);
}

/* 图片预览样式 */
.chat-bubble .image-preview {
  margin-top: 0.5rem;
  border-radius: 12px;
  overflow: hidden;
  background: #f8f9fa;
  border: 1px solid rgba(0, 0, 0, 0.08);
  max-width: 300px;
  position: relative;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-bubble .image-preview img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 200px;
  object-fit: cover;
  transition: transform 0.2s ease;
  border-radius: 8px;
}

/* 响应式调整 */
@media (max-width: 600px) {
  .chat {
  }
}

/* 文本消息的按钮样式 - 只针对文本消息 */
.chat-bubble .text-message + .copy-btn,
.chat-bubble .text-message + .delete-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  opacity: 0.6;
  transition: all 0.2s;
  pointer-events: auto;
  user-select: none;
  z-index: 2;
  padding: 0;
  width: 18px;
  height: 18px;
}

.chat-bubble .text-message + .copy-btn {
  top: -1px;
  right: -1px;
}

.chat-bubble .text-message + .delete-btn {
  bottom: 2px;
  left: 2px;
}

.chat.chat-end .chat-bubble .text-message + .copy-btn,
.chat.chat-end .chat-bubble .text-message + .delete-btn {
  background: rgba(255, 255, 255, 0.3);
}

.chat-bubble .text-message + .copy-btn:hover,
.chat-bubble .text-message + .delete-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}
