/* Chat specific styles */
#chat-container {
  margin-top: 25px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  height: 350px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(74, 110, 255, 0.2);
  overflow: hidden;
}

#chat-header {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(to right, #f9faff, #f0f3ff);
}

#chat-header h3 {
  margin: 0;
  color: #4a6eff;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

#chat-header .chat-status {
  margin-left: auto;
  font-size: 0.8rem;
  color: #2ecc71;
  display: flex;
  align-items: center;
  gap: 5px;
}

#chat-header .chat-status i {
  font-size: 10px;
}

#chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 15px;
  background-color: rgba(249, 250, 255, 0.7);
}

.chat-message {
  display: flex;
  margin-bottom: 15px;
  max-width: 85%;
  word-wrap: break-word;
  animation: fadeIn 0.3s ease;
  position: relative;
}

.chat-message.sent {
  margin-left: auto;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 10px;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  border: 2px solid white;
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-content {
  display: flex;
  flex-direction: column;
  background: white;
  padding: 12px 15px;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
}

.message-bubble-tail {
  position: absolute;
  bottom: 5px;
  width: 10px;
  height: 10px;
  background: white;
  transform: rotate(45deg);
  box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.02);
}

.chat-message.received .message-bubble-tail {
  left: -5px;
}

.chat-message.sent .message-bubble-tail {
  right: -5px;
}

.chat-message.sent .message-content {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-bottom-right-radius: 4px;
}

.chat-message.received .message-content {
  background: white;
  border-bottom-left-radius: 4px;
}

.message-author {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: #444;
}

.message-text {
  font-size: 1rem;
  line-height: 1.4;
}

.message-time {
  text-align: right;
  font-size: 0.75rem;
  margin-top: 6px;
  color: rgba(0, 0, 0, 0.5);
  font-style: italic;
}

.system-message {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  font-size: 0.85rem;
  margin: 15px auto;
  padding: 8px 16px;
  background-color: rgba(0, 0, 0, 0.03);
  border-radius: 20px;
  max-width: 80%;
  border: 1px dashed rgba(0, 0, 0, 0.1);
}

#chat-input-container {
  padding: 15px;
  background: rgba(249, 250, 255, 0.9);
  border-top: 1px solid rgba(74, 110, 255, 0.15);
  display: flex;
  gap: 10px;
  align-items: center;
}

#chat-input {
  flex-grow: 1;
  padding: 12px 16px;
  border: 1px solid rgba(74, 110, 255, 0.3);
  border-radius: 20px;
  font-size: 14px;
  transition: all 0.3s ease;
  background-color: white;
}

#chat-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 110, 255, 0.2);
  border-color: rgba(74, 110, 255, 0.5);
}

#send-message-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, #4a6eff 0%, #5e81ff 100%);
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(74, 110, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 5px;
}

#send-message-btn:hover {
  background: linear-gradient(135deg, #3a5eff 0%, #4e71ff 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(74, 110, 255, 0.4);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  margin: 0 15px 15px;
  font-size: 0.8rem;
  color: #666;
}

.typing-dots {
  display: flex;
  margin-left: 5px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #666;
  margin: 0 1px;
  animation: typingAnimation 1.5s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
  animation-delay: 0s;
}

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

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

@keyframes typingAnimation {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.emoji-selector {
  position: relative;
  display: inline-block;
}

.emoji-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 5px;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.emoji-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.emoji-popup {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: white;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
  padding: 10px;
  width: 250px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 10px;
  z-index: 100;
  display: none;
}

.emoji-popup.active {
  display: grid;
}

.emoji-item {
  font-size: 20px;
  padding: 5px;
  text-align: center;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.2s ease;
}

.emoji-item:hover {
  background: #f0f3ff;
  transform: scale(1.2);
}