/* ���� 小��小孝������ ��������鞋�������� �������������� 效��孝�� */

/* === ��小��������蝎�� 小孝������ === */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 600px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* === ������������������ 效��孝�� === */
.chat-header {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.chat-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.chat-user-details h6 {
  margin: 0;
  font-weight: 600;
}

.chat-user-status {
  font-size: 12px;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 5px;
}

.online-indicator {
  width: 8px;
  height: 8px;
  background: #28a745;
  border-radius: 50%;
  animation: pulse-online 2s infinite;
}

@keyframes pulse-online {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.chat-actions {
  display: flex;
  gap: 10px;
}

.chat-action-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.chat-action-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* === ��������小孝鞋 小������些�������� === */
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #5a6fd8;
}

/* === 小������些������携 === */
.message {
  display: flex;
  gap: 12px;
  animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.own {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.message-content {
  max-width: 70%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.message.own .message-content {
  align-items: flex-end;
}

.message-bubble {
  background: white;
  padding: 12px 16px;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  word-wrap: break-word;
  line-height: 1.4;
}

.message.own .message-bubble {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.message-bubble::before {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border: 8px solid transparent;
}

.message:not(.own) .message-bubble::before {
  left: -8px;
  top: 15px;
  border-right-color: white;
}

.message.own .message-bubble::before {
  right: -8px;
  top: 15px;
  border-left-color: #667eea;
}

.message-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #666;
}

.message.own .message-info {
  flex-direction: row-reverse;
}

.message-time {
  white-space: nowrap;
}

.message-status {
  display: flex;
  align-items: center;
  gap: 3px;
}

.message-status.sent {
  color: #6c757d;
}

.message-status.delivered {
  color: #28a745;
}

.message-status.read {
  color: #007bff;
}

/* === ������������孝���� ����效��孝�� === */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 0;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.typing-indicator.show {
  opacity: 1;
  transform: translateY(0);
}

.typing-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
}

.typing-bubble {
  background: white;
  padding: 12px 16px;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 5px;
}

.typing-dots {
  display: flex;
  gap: 3px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #667eea;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* === 肖�������� ���������� === */
.chat-input-form {
  padding: 20px;
  background: white;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 15px;
  align-items: flex-end;
}

.chat-input-wrapper {
  flex: 1;
  position: relative;
}

.chat-input {
  width: 100%;
  border: 2px solid #e9ecef;
  border-radius: 25px;
  padding: 12px 50px 12px 20px;
  resize: none;
  max-height: 100px;
  min-height: 45px;
  font-size: 14px;
  line-height: 1.4;
  transition: all 0.3s ease;
}

.chat-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-input-actions {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 5px;
}

.chat-input-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  color: #6c757d;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.chat-input-btn:hover {
  background: #f8f9fa;
  color: #667eea;
  transform: scale(1.1);
}

.chat-send-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.chat-send-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* === 肖������蝎 �� ���������� === */
.message-file {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 12px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-icon {
  width: 40px;
  height: 40px;
  background: #667eea;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
}

.file-info {
  flex: 1;
}

.file-name {
  font-weight: 500;
  margin-bottom: 2px;
  font-size: 13px;
}

.file-size {
  font-size: 11px;
  color: #6c757d;
}

.file-download {
  background: none;
  border: none;
  color: #667eea;
  cursor: pointer;
  padding: 5px;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.file-download:hover {
  background: #f8f9fa;
  transform: scale(1.1);
}

.message-image {
  max-width: 250px;
  border-radius: 10px;
  margin-top: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.message-image:hover {
  transform: scale(1.02);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* === ��������孝��������小孝鞋 === */
@media (max-width: 768px) {
  .chat-container {
    height: 500px;
  }

  .chat-header {
    padding: 15px;
  }

  .chat-avatar {
    width: 40px;
    height: 40px;
  }

  .chat-messages {
    padding: 15px;
    gap: 12px;
  }

  .message-content {
    max-width: 85%;
  }

  .message-bubble {
    padding: 10px 14px;
    border-radius: 15px;
  }

  .chat-input-form {
    padding: 15px;
    gap: 10px;
  }

  .chat-input {
    padding: 10px 45px 10px 15px;
    min-height: 40px;
  }

  .chat-send-btn {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 576px) {
  .chat-container {
    height: 450px;
    border-radius: 10px;
  }

  .chat-header {
    padding: 12px;
  }

  .chat-user-info {
    gap: 10px;
  }

  .chat-avatar {
    width: 35px;
    height: 35px;
  }

  .chat-user-details h6 {
    font-size: 14px;
  }

  .chat-user-status {
    font-size: 11px;
  }

  .chat-messages {
    padding: 12px;
    gap: 10px;
  }

  .message-avatar {
    width: 30px;
    height: 30px;
  }

  .message-bubble {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
  }

  .message-info {
    font-size: 10px;
  }

  .chat-input-form {
    padding: 12px;
  }

  .chat-input {
    font-size: 13px;
    padding: 8px 40px 8px 12px;
  }

  .chat-send-btn {
    width: 35px;
    height: 35px;
  }

  .message-image {
    max-width: 200px;
  }
}

/* === 孝��������携 孝������ === */
@media (prefers-color-scheme: dark) {
  .chat-container {
    background: #2d2d2d;
  }

  .chat-messages {
    background: #1a1a1a;
  }

  .message-bubble {
    background: #3d3d3d;
    color: #f8f9fa;
  }

  .message.own .message-bubble {
    background: linear-gradient(135deg, #667eea, #764ba2);
  }

  .message:not(.own) .message-bubble::before {
    border-right-color: #3d3d3d;
  }

  .typing-bubble {
    background: #3d3d3d;
  }

  .chat-input-form {
    background: #2d2d2d;
    border-top-color: #404040;
  }

  .chat-input {
    background: #3d3d3d;
    border-color: #404040;
    color: #f8f9fa;
  }

  .chat-input:focus {
    border-color: #667eea;
  }

  .chat-input-btn {
    color: #ccc;
  }

  .chat-input-btn:hover {
    background: #404040;
    color: #667eea;
  }

  .message-file {
    background: #3d3d3d;
    border-color: #404040;
  }

  .file-download:hover {
    background: #404040;
  }
}
