.communication-col .nav-tabs {
  border-bottom: 1px solid #e0e0e0;
}

.communication-col .nav-link {
  background-color: transparent;
  font-size: 1.25rem;
  line-height: 30px;
  font-weight: 500;
  padding: 0px;
  color: #b0b0b0;
  border: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s, color 0.3s;
}

.communication-col .nav-link:hover,
.communication-col .nav-link:focus {
  color: #999999;
  border-bottom: 2px solid transparent;
  text-decoration: none;
}

.communication-col .nav-tabs .nav-link.active {
  border: none;
  border-bottom: 2px solid #fea327;
  color: #fea327;
  background-color: transparent;
}

#messages {
  height: calc(100vh - 120px);
}

/* Css start for communication
 direct message tab */

.content-container {
  overflow: hidden !important;
}

.new-message-col {
  position: absolute;
  bottom: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  background-color: #fff;
  border-bottom-left-radius: 1rem;
}

.participants-list {
  height: calc(100vh - 200px);
  overflow: auto;
}

.un-read {
  width: 31px;
  height: 24px;
  border-radius: 99px;
  background-color: #eeeeee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-container {
  height: 100%;
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
}

.chat-container .search-input {
  .input-group-text {
    border-left: 0px;
    border-color: #e0e0e0;
    border-radius: 8px;
    background-color: #f7f7f7;
  }
  input {
    border-right: 0px;
    border-color: #e0e0e0;
    border-radius: 8px;
    background-color: #f7f7f7;
  }

  input:focus {
    box-shadow: none;
  }
}

.user-list .filter-btn {
  height: 40px;
  width: 40px;
  background-color: #FFF;
}

.user-list .filter-btn:hover,
.user-list .filter-btn:active,
.user-list .filter-btn:focus,
.user-list .filter-btn.show {
  background-color: #fea327;
}

.contact-wrapper {
  display: flex;
  background-color: #ffffff;
  border-radius: 1rem;
  border: 1px solid #e0e0e0;
  height: 97%;
}

.user-list {
  /* width: 320px; */
  border-right: 1px solid #f2f2f2;
  overflow-y: auto;
  padding: 0;
  position: relative;
}

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 15px;
  position: relative;
  height: calc(100% - 30px);
}

.user-item {
  padding: 11px 16px;
  border-bottom: 1px solid #f2f2f2;
  cursor: pointer;
  transition: background-color 0.2s;
}

.text-muted {
  font-size: 10px;
  color: #b0b0b0 !important;
}

.user-item:hover {
  background-color: #f59e0b14;
}

.user-item.active {
  background-color: #f59e0b14;
}

.start-conversation {
  font-size: 18px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 15px;
  border: 0.5px solid #f7f7f7;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  position: absolute;
  bottom: 0;
  right: 15px;
}

.online {
  background-color: #22c55e;
}

.btn-chat {
  background: linear-gradient(135deg, #FEA327 0%, #FF8C42 100%);
  border: none;
  border-radius: 50%;
  padding: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(254, 163, 39, 0.25);
}

.message-header {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  border-bottom: 1px solid #f2f2f2;
  padding-bottom: 10px;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 10px;
}

.message-header .status-dot {
  right: 10px;
}

.message-sender {
  font-weight: 600;
  font-size: 0.9rem;
  margin-right: 8px;
}

.date-separator {
  text-align: center;
  margin: 15px 0;
  position: relative;
}

.date-separator span {
  background: #FFFFFF;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: #B0B0B0;
  position: relative;
  z-index: 1;
  box-shadow: 0px 1px 2px 0px #0000000D;
}

.message-role {
  font-size: 0.75rem;
  margin-top: 2px;
  color: #b0b0b0;
}

.online-status {
  color: #28a745;
}

.message-status {
  font-size: 0.75rem;
  margin-left: 8px;
}

.offline {
  background-color: #6c757d;
}
.sent .message-header {
  border-color: #b0b0b081;
}
.chat-header {
  padding: 15px;
  border-bottom: 1px solid #f0f0f0;
}

.send-message-col {
  display: flex;
  align-items: center;
  width: 40px;
  height: 40px;
}

.messages-container {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  border-radius: 0;
  background-color: #f8f9fa;
  min-height: 0; /* Allow flex child to shrink */
}

.message {
  display: flex;
  margin-bottom: 8px;
  width: 100%;
  position: relative;
  clear: both;
}

.sent {
  justify-content: flex-end;
}

.received {
  justify-content: flex-start;
}

.message-container {
  max-width: 75%;
  position: relative;
}

.received-inner {
  background-color: #e9ecef;
  color: #000000;
  border-radius: 18px;
  padding: 12px 16px;
  font-size: 16px;
  line-height: 1.4;
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  position: relative;
  margin-left: 0;
}

.sent-inner {
  background: linear-gradient(135deg, #fea327 0%, #ff9500 100%);
  color: #ffffff;
  border-radius: 18px;
  padding: 12px 16px;
  font-size: 16px;
  line-height: 1.4;
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  position: relative;
  margin-right: 0;
}

/* Remove old tails - iOS uses simple bubbles */
.sent-inner::after,
.received-inner::before {
  display: none;
}

/* iOS-style Message Time */
.message-time {
  font-size: 12px;
  color: #8e8e93;
  margin-top: 4px;
  font-weight: 400;
  opacity: 0.8;
}

/* iOS-style Date Separator */
.date-separator {
  text-align: center;
  margin: 16px 0;
}

.date-separator .badge {
  background-color: rgba(142, 142, 147, 0.12);
  color: #8e8e93;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 12px;
  border: none;
}

/* iOS-style Message Grouping */
.message + .message.sent .sent-inner {
  margin-top: 2px;
}

.message + .message.received .received-inner {
  margin-top: 2px;
}

/* Tighter spacing for grouped messages */
.message[data-grouped="true"] {
  margin-bottom: 2px;
}

.message[data-grouped="false"], 
.message:last-child {
  margin-bottom: 12px;
}

/* Last message in group gets full border radius */
.message:last-child .sent-inner,
.message:last-child .received-inner {
  margin-bottom: 8px;
}

/* iOS-style Chat Header */
.chat-header {
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  border-bottom: 1px solid #e5e5ea;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.participant-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.participant-info h6 {
  font-size: 16px;
  font-weight: 600;
  color: #000000;
  margin: 0 0 4px 0;
}

.participant-info small {
  font-size: 13px;
  color: #8e8e93;
  font-weight: 400;
}

.tenant-details small {
  font-size: 12px;
  color: #8e8e93;
  line-height: 1.3;
  margin-bottom: 1px;
}

.tenant-details small:last-child {
  margin-bottom: 0;
}

/* File type icons for messages */
.file-message-content {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background-color: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  max-width: 300px;
}

.file-message-content .file-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.file-message-content .file-details {
  flex-grow: 1;
  min-width: 0;
}

.file-message-content .file-name {
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-message-content .file-size {
  font-size: 12px;
  color: #666;
}

/* Force attachment styling to always match Owner Portal exactly */
.sent-inner div[style*="background: #ffffff"],
.received-inner div[style*="background: #ffffff"],
.sent-inner div[style*="background:#ffffff"],
.received-inner div[style*="background:#ffffff"] {
  background: #ffffff !important;
  border: 1px solid #e0e0e0 !important;
}

.sent-inner div[style*="color: #dc3545"],
.received-inner div[style*="color: #dc3545"],
.sent-inner div[style*="color:#dc3545"],
.received-inner div[style*="color:#dc3545"] {
  color: #dc3545 !important;
}

.sent-inner div[style*="color: #2c3e50"],
.received-inner div[style*="color: #2c3e50"],
.sent-inner div[style*="color:#2c3e50"],
.received-inner div[style*="color:#2c3e50"] {
  color: #2c3e50 !important;
}

.sent-inner div[style*="color: #666"],
.received-inner div[style*="color: #666"],
.sent-inner div[style*="color:#666"],
.received-inner div[style*="color:#666"] {
  color: #666 !important;
}

.sent-inner button[style*="background: #fea327"],
.received-inner button[style*="background: #fea327"],
.sent-inner button[style*="background:#fea327"],
.received-inner button[style*="background:#fea327"] {
  background: #fea327 !important;
  color: white !important;
}

/* Ensure message attachments wrapper doesn't interfere */
.message-attachments {
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}