


#chat-sidebar {
  display: none;
  position: fixed;
  right: 0px;
  top: 51.5px;
  width: 350px;
  height: 100%;
  background: var(--color-main-bg);
  color: #fff;
  z-index: 99;
  border-left: 2px solid rgb(35, 40, 44);
  /* Add these: */
  display: flex;
  flex-direction: column;
}


.chat-sidebar-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  height: 100%;
  padding: 10px;
}

.chat-sidebar-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
}

.chat-sidebar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50px;
  background: #ffffff0f;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: background 0.18s;
}

.chat-sidebar-btn:hover {
  background: #ffffff22;
}

.chat-sidebar-search {
  flex: 1;
  font-size: 16px;
  border-radius: 50px;
  border: 1px solid #444850;
  background: transparent;
  color: white;
  padding: 8px 14px;
  display: none;
  transition: background 0.18s;
}

.chat-sidebar-search-results {
  margin-bottom: 0px;
}

.chat-sidebar-user-list {
  max-height: 180px;
  overflow: auto;
  margin-bottom: 10px;
  padding-right: 2px;
}

.chat-sidebar-user {
  padding: 6px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  transition: background 0.15s;
}
.chat-sidebar-user:hover {
  background: #1b232a;
}

.chat-sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #2a2b2e;
}

.chat-sidebar-window {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0; /* prevents overflow issue */
}

.chat-sidebar-window-header {
  font-weight: 500;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}

.chat-sidebar-messages {
  flex: 1 1 0;
  min-height: 0; /* Important for proper scroll shrink! */
  overflow-y: auto;
  scrollbar-color: #444750 var(--color-main-bg, #232428);
  scrollbar-width: thin;
  padding: 8px;
  margin-bottom: 6px;
  border-radius: 8px;
}

.chat-sidebar-form {
  display: flex;
  gap: 6px;
  margin-bottom: 80px;
}

.chat-sidebar-input {
  flex: 1;
  border-radius: 50px;
  border: 1px solid #444850;
  font-size: 16px;
  background: #ffffff00;
  padding: 10px;
  color: white;
}

.chat-sidebar-btn-send {
  padding: 5px 5px;
  border-radius: 20px;
  border: none;
  background: transparent;
  fill: #9ba3a3;
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  transition: fill 0.16s, background 0.16s;
}

.chat-sidebar-btn-send.active {
  fill: #6074f7;
}


.chat-sidebar-btn-send:hover {
  fill: #3f59ff;
}

.chat-sidebar-msg {
  margin-bottom: 6px;
  font-size: 15px;
  text-align: left;
}
.chat-sidebar-msg-me {
  text-align: right;
}
.chat-sidebar-msg-user {
  color: #8e93a0;
  font-size: 11px;
}
.chat-sidebar-msg-text {
  margin: 0 4px;
  font-size: 15px;
  display: inline-block;
}
.chat-sidebar-msg-time {
  color: #8e93a0;
  font-size: 10px;
  margin-left: 4px;
}






/* Message Group Container */
.chat-msg-group {
  display: flex;
  align-items: flex-start;
  margin-bottom: 12px;
  /* left align by default */
}

.chat-msg-group.chat-sidebar-msg-me {
  flex-direction: row-reverse;
  text-align: right;
}

/* Avatar + Name header */
.chat-msg-group-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 36px;
  margin-right: 8px;
  margin-left: 2px;
}
.chat-msg-group.chat-sidebar-msg-me .chat-msg-group-header {
  margin-right: 2px;
  margin-left: 8px;
}

/* Avatar inside group */
.chat-sidebar-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 2px;
  border: 2px solid #36394b;
  background: #232428;
}

/* Name (if you ever want to show it) */
.chat-sidebar-msg-name {
  color: #a3a5ae;
  font-size: 11px;
  margin-top: 2px;
  text-align: center;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: none;
}

/* Message group body (all bubbles) */
.chat-msg-group-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Individual message bubble/line */
.chat-msg-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 2px 0;
}

.chat-msg-group.chat-sidebar-msg-me .chat-msg-line {
  justify-content: flex-end;
}

.chat-msg-text {
  background: #28292e;
  border-radius: 16px;
  padding: 7px 13px;
  color: #e4e7ef;
  font-size: 15px;
  display: inline-block;
  max-width: 210px;
  word-break: break-word;
  box-shadow: 0 1px 1.5px #10111d18;
}

.chat-msg-group.chat-sidebar-msg-me .chat-msg-text {
  background: #4153f4;
  color: #fff;
  text-align: left;
}

.chat-msg-time {
  color: #8e93a0;
  font-size: 10px;
  margin-left: 2px;
  margin-right: 0;
  align-self: flex-end;
}

.chat-msg-group.chat-sidebar-msg-me .chat-msg-time {
  margin-left: 0;
  margin-right: 2px;
}


@media (max-width: 720px) {


#chat-sidebar {
    width: 100%;
	top: 50px;
    border: 0;

}


}