@font-face {
  font-family: 'icomoon';
  src: url('fonts/icomoon.eot?yj2tpx');
  src: url('fonts/icomoon.eot?yj2tpx#iefix') format('embedded-opentype'),
    url('fonts/icomoon.ttf?yj2tpx') format('truetype'),
    url('fonts/icomoon.woff?yj2tpx') format('woff'),
    url('fonts/icomoon.svg?yj2tpx#icomoon') format('svg');
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

[class^="icon-"],
[class*=" icon-"] {
  /* use !important to prevent issues with browser extensions that change fonts */
  font-family: 'icomoon' !important;
  speak: never;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;

  /* Better Font Rendering =========== */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.icon-mapicon:before {
  content: "\e90e";
  color: #33be87;
}

.icon-filter-icon_button-sm:before {
  content: "\e913";
  color: #33be87;
}

.icon-myListing:before {
  content: "\e912";
  color: #767e93;
}

.icon-heart .path1:before {
  content: "\e90f";
  color: rgb(118, 126, 147);
}

.icon-heart .path2:before {
  content: "\e910";
  margin-left: -1em;
  color: rgb(255, 255, 255);
}

.icon-mapicon1:before {
  content: "\e911";
  color: #33be87;
}

.icon-calndar:before {
  content: "\e900";
  color: #767e93;
}

.icon-changepw-icon:before {
  content: "\e901";
  color: #767e93;
}

.icon-contactus:before {
  content: "\e902";
  color: #767e93;
}

.icon-heart-icon .path1:before {
  content: "\e903";
  color: rgb(118, 126, 147);
}

.icon-heart-icon .path2:before {
  content: "\e904";
  margin-left: -1em;
  color: rgb(255, 255, 255);
}

.icon-icon-helpfaq:before {
  content: "\e905";
  color: #767e93;
}

.icon-icon-logout:before {
  content: "\e906";
  color: #767e93;
}

.icon-icon-user:before {
  content: "\e907";
  color: #767e93;
}

.icon-location-icon:before {
  content: "\e908";
  color: #767e93;
}

.icon-msg-Icon .path1:before {
  content: "\e909";
  color: rgb(118, 126, 147);
}

.icon-msg-Icon .path2:before {
  content: "\e90a";
  margin-left: -1em;
  color: rgb(255, 255, 255);
}

.icon-myViewings-icon:before {
  content: "\e90b";
  color: #767e93;
}

.icon-notification-icon:before {
  content: "\e90c";
}

.icon-refer-icon:before {
  content: "\e90d";
  color: #767e93;
}


/* Chat page */
.chat-container {
  max-width: 100%;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  border: 1px solid #d9d9d9;
  height: 691px;
  overflow: hidden;
  margin-bottom: 78px;
}

.chat-header {
  padding: 24px;
  border-bottom: 1px solid var(--chat-border);
}

.chat-title {
  font-size: 28px;
  font-weight: 700;
  color: #000000;
  margin: 0 0 8px 0;
}

.chat-subtitle {
  font-size: 14px;
  color: rgba(118, 126, 147, 1);
  margin: 0;
}

.chat-sidebar {
  width: 424px;
  background: white;
  border-right: 1px solid #f3f3f3;
  height: 100%;
  overflow-y: auto;
}

.chat-main {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.chat-list {
  flex: 1;
  overflow-y: auto;
}

.chat-list .chat-item:last-child {
  border-bottom: 0;
}

.chat-item {
  padding: 12px;
  border-bottom: 1px solid rgba(118, 126, 147, 0.3);
  cursor: pointer;
  transition: background-color 0.2s;
}

.chat-item:hover {
  background-color: #f8f9fa;
}

/* .chat-item.active {
  background-color: var(--chat-light-gray);
} */

.chat-item.active {
  background-color: var(--chat-light-gray);
  background-color: #f8f9fa;
}

.chat-item-content {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.chat-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  overflow: hidden;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
}

.chat-info {
  flex: 1;
  min-width: 0;
}

.chat-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.chat-name {
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  color: #000000;
  margin: 0;
}

.chat-time {
  font-size: 14px;
  color: rgba(51, 190, 135, 1);
  font-weight: 500;
}

.chat-preview {
  font-size: 14px;
  line-height: 20px;
  color: rgba(118, 126, 147, 1);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-header {
  padding: 24px;
  border-bottom: 1px solid #f3f3f3;
  display: flex;
  align-items: center;
  gap: 12px;
}

.conversation-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
}

.conversation-name {
  font-size: 20px;
  font-weight: 500;
  color: #000000;
  margin: 0;
}

.messages-container {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 267px;
  position: relative;
}

.message::after {
  content: '';
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  position: absolute;
  bottom: 30px;
  width: 17px;
  height: 20px;
  z-index: 99;
}

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

.message.sent::after {
  background-image: url("/assets/images/svg/chatSend-icon.svg");
  right: -5px;
}

.message.received::after {
  background-image: url("/assets/images/svg/chatReceived-icon.svg");
  left: -5px;
}

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

.message-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.5;
  position: relative;
  margin-bottom: 8px;
}

.message.sent .message-bubble {
  background-color: rgba(51, 190, 135, 1);
  color: white;
}

.message.received .message-bubble {
  background-color: #e9e9eb;
  color: #000000;
}

.message-time {
  font-size: 11px;
  color: rgba(118, 126, 147, 1);
  margin-top: 4px;
}

.message-image {
  width: 100%;
  height: 119px;
  background-size: cover;
  background-position: center;
  margin-bottom: 8px;
  border-radius: 4px;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  -ms-border-radius: 4px;
  -o-border-radius: 4px;
  overflow: hidden;
}

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

.input-container {
  padding: 24px;
}

.input-wrapper {
  background-color: rgba(118, 126, 147, 0.1);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.message-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: rgba(118, 126, 147, 1);
}

.message-input::placeholder {
  color: rgba(118, 126, 147, 1);
}

.attachment-btn,
.send-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.attachment-icon {
  width: 18px;
  height: 18px;
  color: rgba(118, 126, 147, 1);
}

.attachment-icon path {
  color: rgba(118, 126, 147, 1);
}

.send-icon {
  width: 24px;
  height: 24px;
  color: rgba(51, 190, 135, 1);
}

.send-icon path {
  color: rgba(51, 190, 135, 1);
}

/* Chat image preview (lightbox) */
.chat-img-clickable {
  transition: opacity 0.15s ease;
}
.chat-img-clickable:hover {
  opacity: 0.88;
}

.chat-img-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: chatOverlayIn 0.2s ease;
}

@keyframes chatOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.chat-img-preview-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: chatImgIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chatImgIn {
  from { transform: scale(0.88); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.chat-img-preview-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  display: block;
}

.chat-img-preview-close,
.chat-img-preview-download {
  position: absolute;
  top: -16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  z-index: 10;
  text-decoration: none;
}

.chat-img-preview-close {
  right: -16px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  color: #111;
}

.chat-img-preview-close:hover {
  background: #fff;
  transform: scale(1.1);
}

.chat-img-preview-download {
  right: 36px;
  background: rgba(51, 190, 135, 0.92);
  color: #fff;
}

.chat-img-preview-download:hover {
  background: rgba(51, 190, 135, 1);
  transform: scale(1.1);
}

@media (max-width: 768px) {
  body {
    padding: 20px;
  }

  .chat-container {
    height: auto;
    flex-direction: column;
  }

  .chat-list {
    flex: 1;
    overflow-y: auto;
    flex-wrap: nowrap;
    display: flex;
  }

  .chat-sidebar {
    width: 100%;
    overflow-y: auto;
  }

  .chat-item {
    width: 350px;
  }
}

@media (max-width: 375px) {
  .chat-item {
    width: 78%;
  }

  .chat-name {
    font-size: 15px;
    line-height: 18px;
  }
}