.chatbox-container {
  height: 100%;
  /* display: flex;
  gap: 10px; */
  margin-right: 10px;
  background-color: var(--background);
  /* box-shadow: 0 2px 4px var(--secondBackgroundShadow);
    border-radius: 6px; */
  /* overflow: hidden; */
}

.chatbox-lg {
  height: 100%;
  display: flex;
  gap: 10px;
  /* margin-right: 10px; */
  /* background-color: var(--background); */
  overflow: hidden;
}

.chatbox-sm {
  height: 100%;
  display: none;
  overflow: hidden;
}

/* Chat contact list  */
.chat-contact-container {
  width: 500px;
  height: 100%;
  position: relative;
}

.chat-contact-wrapper {
  height: 100%;
  padding: 0px 0px 60px 0px;
  background-color: transparent;
  /* border-right: 1px solid var(--border); */
  overflow-y: auto;
  background-color: var(--secondBackground);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.chat-contact-wrapper {
  overflow: auto;
  scrollbar-width: thin;
  /* Firefox */
  scrollbar-color: transparent transparent;
  /* Firefox */
}

/* For Webkit-based browsers (Chrome, Edge, Safari) */
.chat-contact-wrapper::-webkit-scrollbar {
  width: 8px;
}

.chat-contact-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.chat-contact-wrapper::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 4px;
}

/* On hover - make scrollbar visible */
.chat-contact-wrapper:hover {
  scrollbar-color: var(--primary) transparent;
  /* Firefox */
}

.chat-contact-wrapper:hover::-webkit-scrollbar-thumb {
  background-color: white;
}

.chat-contact-wrapper h1 {
  font-size: 1.3rem;
  margin-bottom: 24px;
  color: var(--onSecondBackground);
}

.chat-contact-wrapper .chat-icon {
  fill: var(--onSecondBackground);
}

.chat-contact-search {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 12px;
  padding: 0 12px 10px 12px;
  border-bottom: 1px solid var(--border);
}

.chat-contact-search input {
  width: 100%;
  padding: 8px 40px 8px 12px;
  border-radius: 40px;
  /* background-color: transparent; */
  border: 1px solid var(--border);
  color: var(--onSecondBackground);
  background-color: transparent;
  font-size: 12px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.chat-contact-search input:focus {
  border-color: var(--border);
}

.chat-contact-search input::placeholder {
  color: var(--placeholder);
  /* Lighter color for placeholder */
  opacity: 1;
}

.chat-contact-search button {
  position: absolute;
  width: 20px;
  height: 20px;
  right: 10px;
  margin: 0px 8px 0px 4px;
  border: none;
  background-color: transparent;
  display: flex;
}

.chat-contact-search .search svg {
  width: 18px;
  height: 18px;
  stroke: var(--placeholder);
  fill: none;
}

.chat-contact-search .close svg {
  width: 18px;
  height: 18px;
  fill: var(--placeholder);
}

.chat-contact-card {
  width: 100%;
  height: 70px;
  display: flex;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  color: var(--onSecondBackground);
  cursor: pointer;
  /* border-bottom: 1px solid var(--border); */
}

.chat-contact-card:hover {
  background-color: color-mix(
    in srgb,
    var(--tertiary),
    var(--secondBackground) 65%
  );
  color: var(--onTertiary);
}

.chat-contact-card.active {
  background: var(--tertiary);
  color: var(--onTertiary);
}

.chat-contact-card .icon {
  width: 50px;
  height: 50px;
  margin: auto 8px auto 0px;
}

.chat-contact-card .icon img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 50%;
}

.chat-contact-details {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.chat-contact-details-sec {
  width: 100%;
  display: flex;
  justify-content: space-between;
}

.chat-contact-details-sec .name {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.chat-contact-details-sec .message {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 200px;
  font-size: 0.75rem;
  color: var(--placeholder);
}

.chat-contact-details-sec .time {
  font-size: 0.75rem;
  color: var(--placeholder);
}

.chat-contact-card:hover .time,
.chat-contact-card.active .time {
  display: none;
}

.chat-contact-card .options-icon {
  display: none;
  color: var(--placeholder);
  cursor: pointer;
  position: relative;
}
.chat-contact-card .options-icon svg {
  height: 18px;
  width: 18px;
}

.chat-contact-card:hover .options-icon,
.chat-contact-card.active .options-icon {
  display: inline-flex;
  align-items: center;
}

.options-icon .list-option-other {
  width: 150px;
  z-index: 1;
  position: absolute;
  right: -11px;
  top: 24px;
  background-color: var(--secondBackground);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 8px;
}

.options-icon .list-option-other .other {
  padding: 6px 8px;
  /* border-top: 1px solid var(--border); */
  font-size: 0.8rem;
  color: var(--onSecondBackground);
  fill: var(--onSecondBackground);
  stroke: var(--onSecondBackground);
  font-weight: 600;
  position: relative;
  display: flex;
  align-items: center;
  -webkit-user-select: none;
  user-select: none;
}
.options-icon .list-option-other .divider {
  border-top: 1px solid var(--border);
  margin: 5px 0;
}

.options-icon .list-option-other .other:hover {
  background-color: var(--tertiary);
  border-radius: 20px;
}

.options-icon .list-option-other .other svg {
  height: 16px;
  width: 16px;
  margin-right: 8px;
}

.chat-contact-details-sec .unread-count {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--onTertiary);
  color: var(--tertiary);
  padding: 4px 8px;
  border-radius: 30px;
  font-size: 10px;
  font-weight: 600;
  min-width: 22px;
  height: 22px;
}

.chat-contact-card.active .chat-contact-details-sec .unread-count {
  background-color: var(--onTertiary);
  color: var(--tertiary);
}

.chat-contact-tab-container {
  width: 100%;
  height: 50px;
  padding: 0 12px;
  /* position: absolute;
    bottom: 0; */
}

.chat-contact-tab {
  height: 100%;
  display: flex;
  background-color: transparent;
  padding: 8px;
  border-radius: 40px;
  border: 1px solid var(--border);
}

.chat-contact-tab .tab {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.4px;
  border: none;
  background-color: transparent;
  color: var(--onTertiary);
  border-radius: 50px;
  transition: background-color 0.2s ease, color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.chat-contact-tab .tab::before {
  content: "";
  position: absolute;
  border-bottom: 1px solid var(--primary);
  color: var(--ontTrtiary);
  width: 0;
  height: 100%;
  z-index: -1;
  animation-duration: 0.5s;
  animation-fill-mode: forwards;
}

.chat-contact-tab .tab:hover::before {
  left: 0;
  animation-name: tabActiveBefore;
}

.chat-contact-tab .tab .tab-number-status {
  font-size: 11px;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 50%;
  background-color: var(--primary);
  color: var(--onPrimary);
}

.chat-contact-tab .tab.active {
  color: var(--onPrimary);
}

.chat-contact-tab .tab.active::after {
  content: "";
  position: absolute;
  background-color: var(--primary);
  color: var(--onPrimary);
  width: 100%;
  height: 100%;
  z-index: -1;
  animation-duration: 0.3s;
  animation-fill-mode: forwards;
}

/* Slide in from left to center */
.chat-contact-tab .tab.active::after {
  left: 0;
  animation-name: tabActiveBefore;
}

/* Keyframes */
@keyframes tabActiveBefore {
  0% {
    left: 0;
    width: 0;
  }

  100% {
    left: 0;
    width: 100%;
  }
}

.chat-contact-tab .tab.active .tab-number-status {
  background-color: var(--onPrimary);
  color: var(--primary);
}

.chat-contact-items {
  padding: 0 12px;
  margin-top: 10px;
}

.chat-contact-items .alphabet-header {
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  -webkit-user-select: none;
  user-select: none;
}

.chat-contact-select {
  position: absolute;
  width: 40px;
  height: 40px;
  bottom: 12px;
  margin-right: 10px;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--primary);
  border-radius: 8px;
  border: none;
}

.chat-contact-select svg {
  stroke: var(--onPrimary);
}

@media (max-width: 950px) {
  .chat-contact-container {
    width: 300px;
  }

  .chat-contact-details-sec .message {
    width: 140px;
    font-size: 0.7rem;
  }

  .chat-contact-details-sec .name {
    font-size: 1rem;
  }

  .chat-contact-tab .tab {
    font-size: 0.6rem;
  }
}

@media (max-width: 768px) {
  .chatbox-lg {
    display: none;
  }

  .chatbox-sm {
    display: flex;
  }

  .chat-contact-container {
    width: 100%;
  }

  .chat-contact-details-sec .message {
    width: 140px;
    font-size: 0.7rem;
  }

  .chat-contact-details-sec .name {
    font-size: 1rem;
  }

  .chat-contact-tab .tab {
    font-size: 0.7rem;
  }
}
