/* ChatWindow.css */

/* 整体布局 */
.chat-window {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 800px;
  width: 100%;
  margin: 0 auto;
  background-color: #f0f2f5;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 顶部标题栏 */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background-color: #128c7e;
  color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
}

.room-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.message-count {
  font-size: 14px;
  opacity: 0.85;
  background-color: rgba(255, 255, 255, 0.2);
  padding: 4px 8px;
  border-radius: 12px;
}

/* 消息区域 */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background-image: linear-gradient(rgba(240, 242, 245, 0.95), rgba(240, 242, 245, 0.95)), 
                    url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHZpZXdCb3g9IjAgMCA2MCA2MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxnIGZpbGw9IiNlNWU1ZTUiPjxwYXRoIGQ9Ik00MCAxMGgxMHYxMEg0MHpNMTAgNDBoMTB2MTBIMTB6TTQwIDQwaDEwdjEwSDQwek0xMCAxMGgxMHYxMEgxMHoiLz48L2c+PC9nPjwvc3ZnPg==');
  background-size: 30px 30px;
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 10px;
}

/* 消息行 */
.message-row {
  display: flex;
  gap: 10px;
}

/* 头像 */
.avatar-container {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
}

.user-avatar {
  margin-top: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-weight: bold;
  font-size: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 消息内容包装器 */
.message-content-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

.sender-name {
  font-size: 12px;
  color: #6c757d;
  font-weight: 600;
  margin-bottom: 4px;
  margin-left: 6px;
}

/* 气泡和时间容器 */
.bubble-time-container {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

/* 消息气泡 */
.message-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  background-color: white;
  font-size: 15px;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  word-wrap: break-word;
  white-space: pre-wrap;
  color: #3b4a54;
  max-width: 100%;
  border-bottom-left-radius: 4px;
}

/* 消息时间 */
.message-time {
  font-size: 10px;
  color: #a0a0a0;
  margin-bottom: 4px;
  flex-shrink: 0;
}

/* 输入区域 */
.input-container {
  padding: 16px 20px;
  background-color: #f0f2f5;
  border-top: 1px solid #e6e6e6;
}

.input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.message-input {
  flex: 1;
  height: 46px;
  padding: 12px 12px;
  border: none;
  border-radius: 24px;
  background-color: white;
  resize: none;
  font-size: 15px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s;
  box-sizing: border-box;
}

.message-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px #128c7e;
}

/* 发送按钮 */
.send-button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 600;
  box-sizing: border-box;
}

.send-button-active {
  background-color: #128c7e;
  color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.send-button-disabled {
  background-color: #e6e6e6;
  color: #a6a6a6;
  cursor: not-allowed;
}

.send-button-active:hover {
  background-color: #0a7d71;
  transform: scale(1.05);
}

.send-button-active:active {
  transform: scale(0.98);
}

/* 滚动条样式 */
.messages-container::-webkit-scrollbar {
  width: 6px;
}

.messages-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.messages-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}