/* Chat Styles */
.chat-header {
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.chat-header-content {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  gap: 15px;
}

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

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

.chat-user-details h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--dark-gray);
  display: flex;
  align-items: center;
  gap: 5px;
}

.online-status {
  font-size: 0.8rem;
  color: var(--gray);
}

.online-status.online {
  color: var(--primary-color);
}

.profile-btn {
  color: var(--gray);
  font-size: 1.2rem;
  text-decoration: none;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.profile-btn:hover {
  background: var(--light-gray);
  color: var(--primary-color);
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.no-messages {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--gray);
  text-align: center;
}

.message {
  display: flex;
  margin-bottom: 10px;
}

.message.sent {
  justify-content: flex-end;
}

.message.received {
  justify-content: flex-start;
}

.message-content {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 18px;
  position: relative;
  word-wrap: break-word;
}

.message.sent .message-content {
  background: var(--primary-color);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.message.received .message-content {
  background: var(--light-gray);
  color: var(--dark-gray);
  border-bottom-left-radius: 4px;
}

.message-content p {
  margin: 0;
  line-height: 1.4;
}

.message-time {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-top: 4px;
  display: block;
}

.chat-input-container {
  position: sticky;
  bottom: 0;
  background: var(--white);
  border-top: 1px solid var(--border-color);
  padding: 15px 20px;
}

.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.chat-form textarea {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid var(--border-color);
  border-radius: 25px;
  font-size: 16px;
  font-family: inherit;
  resize: none;
  max-height: 100px;
  min-height: 44px;
  line-height: 1.4;
}

.chat-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.send-btn {
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
}

.send-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.send-btn:disabled {
  background: var(--gray);
  cursor: not-allowed;
  transform: none;
}

/* Message animations */
.message {
  animation: messageSlide 0.3s ease;
}

.message.sent {
  animation: messageSlideSent 0.3s ease;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes messageSlideSent {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive Design */
@media (max-width: 480px) {
  .chat-messages {
    height: calc(100vh - 130px);
    padding: 15px;
  }

  .message-content {
    max-width: 85%;
    padding: 10px 14px;
  }

  .chat-input-container {
    padding: 12px 15px;
  }

  .chat-form textarea {
    font-size: 16px; /* Prevent zoom on iOS */
  }
}
