/* Floating Chat Button */
/* Floating Chat Button (Draggable) */
/* Floating Chat Button */
.chat-button {
  position: fixed;
  bottom: 45px;
  right: 45px;
  background-color: var(--primary-color);
  color: var(--primary-color-transparent-white);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
  cursor: grab;
  z-index: 1000;
  transition: 0.3s ease-in-out;
  font-size: 24px;
  position: fixed;
  z-index: 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999; /* Overlay all content */
  
}

/* Notification Badge */
.chat-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color:orange;
  color: white;
  font-size: 12px;
  font-weight: bold;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3);
}

 
.chat-button:active {
  cursor: grabbing;
}


.chat-icon {
  font-size: 1.5em;
}

/* Chat Window (Desktop) */
.chat-window {
  position: fixed;
  bottom: 100px;
  right: 50px;
  width: 380px;
  height: 500px;
  background: var(--primary-color-transparent-white);
  box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  overflow: hidden;
  transform: scale(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease-in-out;
  z-index: 9999;
}

/* Chat Header */
.chat-header {
  background: var(--primary-color);
  color: white;
  padding: 5px;
  font-size: 1.2em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-chat {
  background: none;
  border: none;
  color: white;
  font-size: 1.3em;
  cursor: pointer; 
}
 

.chat-title {
  color: white;
  font-size:0.8em;
  cursor: pointer;
  display: flex;
  align-items: center; /* Centers items vertically */
  gap: 5px; /* Space between image and text */
  overflow: hidden; /* Prevents content overflow */
  position: absolute; /* Keeps it positioned at the left */
  left: 35px; /* Ensures it stays at the left */
  top: 50%; /* Moves it downward */
  transform: translateY(-50%); /* Centers it vertically */
}
.chat-user-details {
  display: flex;
  flex-direction: column; /* Stack elements vertically */
  align-items: flex-start; /* Align items to the left */
  gap: 0px; /* Add spacing between the elements */
}

.chat-user-names {
  display: inline-block;
  max-width: 150px; /* Adjust width as needed */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  margin-top:20px;
  font-weight: 400;
  font-size: 0.7em;
}
.chat-user-status {
  font-size: 0.7em; /* Slightly smaller font size for status */
  color:#eee; /* Different color for status */
  margin-top:-3px;
}
/* Chat Body */
.chat-body {
  flex-grow: 1;
  padding: 10px;
  overflow-y: auto; 
  color: black;
  display: none;
  height: calc(100% - 120px);
  padding: 5px;
  background-color:#f1f1f1;
}
.chat-contacts-div{
  flex-grow: 1;
  padding:5px;
  height: calc(100% - 100px);
  overflow-y: auto;
  background-color:rgba(255, 255, 255, 1);
  color: gray; 
  display: none;
}
.chat-contacts-div-avatar{height:50px;width:50px;border-radius:50%;margin-top:5px;}

.chat-contacts-div-avatar.user-is-online{
  height:50px;
  width:50px;
  border-radius:50%;
  margin-top:5px;
  border: 3px solid rgb(17, 205, 17);
}
.contact_last_message {
  float:left;padding-left:10px;
  color:gray;font-size:0.8em;
}
 
/* Chat Footer */
.chat-footer {
  display: flex;
  padding: 10px;
  background: #f1f1f1;
  align-items: center;
  justify-content: space-between;
  bottom: 0;
}

.input-container {
  position: relative;
  flex-grow: 1;
  display: flex;
  align-items: center;
  width: 100%;
}

.chat-footer input {
  flex-grow: 1;
  padding: 8px 40px 8px 80px; /* Adjust padding for icons (extra space on the left) */
  border: none;
  border-radius: 20px;
  outline: none;
  background: #fff;
  position: relative;
}

.icon-button {
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

#attachFile {
  left: 10px; /* Position the attach file icon inside the input field */
}

#emojiButton {
  left: 45px; /* Position the emoji button inside the input field */
}

#voiceButton {
  right: 10px; /* Position the voice button inside the input field */
}

.send-message {
  background:var(--primary-color);
  color: white;
  border: none;
  padding: 8px;
  margin-left: 10px;
  cursor: pointer;
  border-radius: 5px;
  height: 37px;
  width: 40px;
  border-radius: 50%;
}


/* Mobile Fullscreen Chat */
@media (max-width: 768px) {
  .chat-window {
    width: 100%;
    height: 100%;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    border-radius: 0;
    transform-origin: center;
    z-index: 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999; /* Overlay all content */
  }

  .chat-footer {
    padding: 15px;
  }

  .chat-footer {
    width: 100vw;
    max-width: 100vw;
    left: 0;
    right: 0;
    box-sizing: border-box;
    overflow-x: auto;
  }
  .input-container {
    width: 100%;
    min-width: 0;
  }
  #chatInput {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }
  .send-message {
    margin-left: 5px;
    width: 40px;
    min-width: 40px;
    max-width: 40px;
  }
}


/* Search container with smooth transition */ 
/* Chat header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background:var(--primary-color);
  color: white;
  padding: 5px;
  position: relative;
  gap: 10px; /* Adds spacing between items */
}
#chatClosingDiv {
  display: flex;
  align-items: center;
}
.chatVoiceCallIcon,
.chatVideoIcon,
.search-container,
.chatDropDown {
  display: flex;
  align-items: center;
}



.chatVoiceCallIcon{
  float:right;
  font-size: 1.3em; 
  right:80px;
  display: flex;
  align-items: center;
  position: absolute;
  width: 60px;
  overflow: hidden;
  transition: width 0.3s ease-in-out;
  height: 100%; 
  cursor:pointer;
}
.chatVideoIcon{
float:right;
font-size: 1.3em; 
right:40px;
display: flex;
align-items: center;
position: absolute;
width: 60px;
overflow: hidden;
transition: width 0.3s ease-in-out;
height: 100%;
cursor:pointer;
}

/* Search container */
.search-container {
  display: flex;
  align-items: center;
  position: absolute;
  right: 20px;
  width: 40px;
  overflow: hidden;
  transition: width 0.3s ease-in-out;
  height: 90%;
  cursor:pointer;
}

/* Expand search bar */
.search-container.expanded {
  width: calc(100% - 100px); /* Fills most of the header width */
}

/* Search input */
.search-input {
  width: 0;
  padding: 8px;
  border: none;
  outline: none;
  background: white;
  border-radius: 4px;
  transition: width 0.3s ease-in-out, opacity 0.3s ease-in-out;
  opacity: 0;
  height: 100%;
}

.search-container.expanded .search-input {
  width: 100%;
  opacity: 1;
}

/* Hide search icon when expanded */
.search-container.expanded .search-icon {
  display: none;
}

/* Close search icon */
.close-search {
  font-size: 1.3em;
  cursor: pointer;
  display: none;
}

.search-container.expanded .close-search {
  display: inline;
}

/* Hide closeChat when search is active */
.search-container.expanded ~ .close-chat {
  display: none;
}

 



/* Unique Chat Dropdown */
.chatDropDown {
  position: relative;
  cursor: pointer;
}

.chat-menu-icon {
  font-size: 1.5em;
  padding: 5px;
  width: 2px;
}

.chat-dropdown-menu {
  position: absolute;
  right: 0;
  top: 25px;
  background: white;
  list-style: none;
  padding: 5px;
  display: none;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  z-index: 10;
  min-width: 125px;
}

.chat-dropdown-menu li {
  font-size:0.8em;
  cursor: pointer;
  font-weight: 100;
  color: black;
}

.chat-dropdown-menu li:hover {
  background: #f0f0f0;
}

/* Show dropdown */
.chatDropDown.chatDropdownActive .chat-dropdown-menu {
  display: block;
}


.contactLisItem{
  float:left;
  transition: all 1s;
  margin-top:0px;
text-align:left;
font-size:0.8em;
font-weight:400;
padding-left:12px;
color:gray;
background-color:transparent;
padding:0px;
line-height:25px;
  } 
  .contactLisItem:nth-child(odd) {
    background-color:rgba(0, 0, 0,0.05);
  }
.contactLisItem:hover{
  transition: all 1s;
  box-shadow: 0 0 0.5px 0.5px var(--primary-color);
 background-color:var(--primary-color-transparent);
 transition: all 1s;
transform: scale(1.01);
 /*  transform : translateY(-10px);*/
}
 

/* tablist styles */

.chatTabsList {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none; /* Hide scrollbar */
  -ms-overflow-style: none;
  background-color: #fff;
}
.chatTabsList::-webkit-scrollbar {
  display: none;
}
.chatTab {
  padding: 3px; 
  margin: 5px;
  cursor: pointer;
  background: transparent;
  border-radius: 12px;
  height:25px;
  border:1px solid gray;
  color: gray;
  font-size: 1em;
  line-height: 15px;
}
.chatTab:hover {
  background-color:transparent;
  color:var(--primary-color);
  border:2px solid var(--primary-color);
}
.chatTab.activeTab {
  background-color:var(--primary-color);
  color: #fff;
  border:2px solid var(--primary-color);
}
 

/* Chat Bubble Styles */ 

/* Chat Bubble Styles */
.chat-bubble-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px;
}

.sent-message,
.received-message {
  display: flex;
  align-items: center;
  max-width: 80%;
  min-width: 40%;
  padding: 10px;
  border-radius: 20px;
  position: relative;
  margin-top:20px;
}

.sent-message {
  background-color: var(--primary-color-transparent2);
  align-self: flex-end; /* Align sent message to the right */
}

.received-message {
  background-color: rgba(119, 117, 117, 0.2);
  align-self: flex-start; /* Align received message to the left */
}

.message-text {
  font-size: 14px;
  max-width: 100%;
  word-wrap: break-word;
  padding-right: 30px;
}

/* Status Indicators (Ticks) */
.message-status {
  position: absolute;
  bottom: 5px;
  right: 10px;
  display: flex;
  gap: 5px;
}
.message-status-sent{
  font-size:0.7em;
  color:gray;
}
.message-status-delivered{
  font-size:0.7em;
  color:gray;
}

/* Timestamp Styling */
.chatSenderTimeStamp {
  font-size:0.6em;
  color: #aaa;
  position: absolute;
  bottom: -18px;
  right: 10px; 
}
.chatReceiverTimeStamp{
  font-size:0.6em;
  color: #aaa;
  position: absolute;
  bottom: -18px;
  left: 10px;
}

/* Sharp end / triangle for sent and received messages */
.message-tail {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 7px solid transparent;
  z-index: 1;
}

.sent-message .message-tail {
  bottom: -1.2px;
  right:-7px;
  border-top: 10px solid var(--primary-color-transparent2); /* Triangle color for sent message */
  transform: rotate(-46deg); /* Tilting the tail for sent message */
}

.received-message .message-tail {
  top: -2px;
  left: -5px;
  border-bottom: 10px solid rgba(119, 117, 117, 0.2); /* Triangle color for received message */
  transform: rotate(-46deg); /* Tilting the tail for received message */
}
