/**
 * Clean Messaging Styles for Imployii
 * Modern chat interface styling with no conflicts
 */

/* Main messaging container */
.messaging-container {
  display: flex;
  height: calc(100vh - 150px);
  min-height: 500px;
  background-color: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* User list sidebar */
.users-list {
  width: 300px;
  background: #fff;
  border-right: 1px solid #e0e0e0;
  overflow-y: auto;
}

/* User list header */
.users-list-header {
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
  background-color: #f8f9fa;
}

.users-list-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

/* User search bar */
.user-search {
  padding: 10px 15px;
  position: relative;
}

.user-search input {
  width: 100%;
  padding: 8px 12px;
  padding-left: 30px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  font-size: 0.9rem;
}

.user-search i {
  position: absolute;
  left: 25px;
  top: 19px;
  color: #aaa;
}

/* User list items */
.user-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  cursor: pointer;
  transition: background-color 0.3s;
  position: relative;
}

.user-item:hover {
  background-color: #f5f5f5;
}

.user-item.active {
  background-color: #ebf7ff;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 12px;
  object-fit: cover;
}

.user-info {
  flex: 1;
}

.user-name {
  font-weight: 600;
  margin-bottom: 3px;
  color: #333;
}

.last-message {
  font-size: 0.8rem;
  color: #777;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.message-time {
  font-size: 0.75rem;
  color: #999;
}

/* Chat area */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #f5f5f5;
}

/* Chat header */
.chat-header {
  display: flex;
  align-items: center;
  padding: 15px;
  background-color: #fff;
  border-bottom: 1px solid #e0e0e0;
}

.chat-header .user-avatar {
  margin-right: 12px;
}

.chat-user-info {
  flex: 1;
}

.chat-user-name {
  font-weight: 600;
  margin-bottom: 3px;
}

.user-status {
  font-size: 0.8rem;
  color: #43a047;
}

.chat-header .actions {
  display: flex;
}

.chat-header .actions button {
  background: none;
  border: none;
  color: #666;
  padding: 5px 8px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.chat-header .actions button:hover {
  background-color: #f0f0f0;
}

/* Message area */
.messages-container {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.message {
  max-width: 70%;
  margin-bottom: 15px;
  clear: both;
  position: relative;
}

.message.sent {
  align-self: flex-end;
}

.message.received {
  align-self: flex-start;
}

.message-content {
  padding: 10px 15px;
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  word-wrap: break-word;
}

.message.sent .message-content {
  background-color: #3498db;
  color: white;
  border-bottom-right-radius: 4px;
}

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

.message-time {
  font-size: 0.7rem;
  color: #999;
  margin-top: 5px;
  text-align: right;
}

.message.received .message-time {
  text-align: left;
}

/* Message input area */
.message-input {
  display: flex;
  align-items: center;
  padding: 15px;
  background-color: #fff;
  border-top: 1px solid #e0e0e0;
}

.message-input textarea {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 10px 15px;
  resize: none;
  max-height: 100px;
  font-family: inherit;
}

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

.message-actions button {
  background: none;
  border: none;
  color: #3498db;
  font-size: 1.2rem;
  padding: 8px;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.3s;
}

.message-actions button:hover {
  background-color: #f0f0f0;
}

.send-button {
  background-color: #3498db !important;
  color: white !important;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-button:hover {
  background-color: #2980b9 !important;
}

/* Empty state */
.empty-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #999;
  text-align: center;
  padding: 20px;
}

.empty-chat i {
  font-size: 3rem;
  margin-bottom: 15px;
  color: #ddd;
}

.empty-chat p {
  max-width: 300px;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .messaging-container {
    flex-direction: column;
    height: calc(100vh - 100px);
  }
  
  .users-list {
    width: 100%;
    max-height: 300px;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
  }
  
  .message {
    max-width: 85%;
  }
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  padding: 5px 15px;
  font-size: 0.8rem;
  color: #999;
  font-style: italic;
}

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

.typing-dot {
  width: 5px;
  height: 5px;
  background-color: #999;
  border-radius: 50%;
  margin-right: 3px;
  animation: typing-dot 1.4s infinite;
}

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

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

@keyframes typing-dot {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-5px);
  }
}

/* Emoji picker styling */
.emoji-picker {
  position: absolute;
  bottom: 70px;
  right: 20px;
  z-index: 1000;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  overflow: hidden;
}

/* New message notification */
.new-message-notification {
  position: sticky;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #3498db;
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s;
}

.new-message-notification.visible {
  opacity: 1;
}

/* Message status indicators */
.message-status {
  font-size: 0.7rem;
  margin-top: 2px;
  text-align: right;
}

.message-status.sent {
  color: #999;
}

.message-status.delivered {
  color: #777;
}

.message-status.read {
  color: #3498db;
}