* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.chat-list {
    padding: 1em;
    height: 100vh;
}
.chat-item {
    height: 4em;
    overflow: hidden;
    display: flex;
    align-items: center;
    width: 100%;
}
.chat-item button[data-function=toggleUserProfile] {
    border: none;
    background: transparent;
    height: 10%;
    width: 10%;
    border-radius: 50%;
    overflow: hidden;
    min-height: 4em;
    min-width: 4em;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 1em;
}
.chat-item button img {
    height: 100%;
}
.chat-item .other-user-details {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: .5em 0;
    flex: 1;
    width: 70%;
}
.chat-item .top-details {
    display: flex;
    justify-content: space-between;
}
.chat-item .message-preview {
    display: flex;
    justify-content: space-between;
}
.chat-item .message-preview .chat-indicator {
    background: #fec809;
    color: #fff;
    font-size: .9em;
    height: 1.4em;
    width: 1.4em;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.chat-item .message-preview .message {
    width: 75%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #999;
    font-size: .8em;
}
.unread * {
    font-weight: bold;
}
p.time {
    font-size: .7em;
}
#chat-list {
    overflow-y: scroll;
    max-height: 500px; /* Adjust as needed */
    transition: scroll 0.3s ease-in-out;
  }
  .chat-item:focus, .chat-item:active {
    opacity: 0.8;
    background: #f0f0f0;
}


@keyframes shimmer {
    0% {
      background-position: -200% 0;
    }
    100% {
      background-position: 200% 0;
    }
  }
  
  .skeleton {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
    border-bottom: 1px solid #eee;
  }
  .story-item.skeleton {
    display: inline-block;
}
  
  .skeleton button {
    border: none;
    background: none;
    padding: 0;
  }
  
  .skeleton-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(100deg, #ddd 30%, #f1f1f1 50%, #ddd 70%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite;
    flex-shrink: 0;
  }
  
  .other-user-details {
    flex: 1;
  }
  
  .top-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
  }
  
  .skeleton-bubble {
    height: 14px;
    background: linear-gradient(100deg, #ddd 30%, #f1f1f1 50%, #ddd 70%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite;
    border-radius: 999px;
  }
  
  .name-bubble {
    width: 40%;
  }
  
  .time-bubble {
    width: 20%;
  }
  
  .message-bubble {
    width: 80%;
    height: 12px;
  }
  


  /* chat initiation */
  /* Overlay background */
.new-chat-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Hidden class for toggling visibility */
.hidden {
  display: none;
}

/* Box styling */
.overlay-box {
  background: #fff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 250px;
  width: 100%;
  position: absolute;
  bottom: 0;
  border-radius: 1em 1em 0 0;
}

/* Input field */
.overlay-input {
  padding: 10px;
  font-size: 16px;
  width: 100%;
  box-sizing: border-box;
}

/* Buttons container */
.overlay-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Buttons */
.overlay-btn {
  padding: 8px 12px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* Optional: Different styles for cancel and confirm */
.overlay-btn.cancel {
  background-color: #ccc;
  color: #333;
}

.overlay-btn.confirm {
  background-color: #007bff;
  color: #fff;
}
