/* Global Styles */
body {
  height: 100%;
  font-family: Arial, sans-serif;
  background-color: #ede6f6;
  margin: 0;
  padding: 20px;
  display: flex;
  justify-content: center;
}
/*
.all-content{
  height : calc(100% -60px);
}
*/
.chat-container {
  display: flex;
  width: 100%; /* Adjust based on your preference for overall app width */
  justify-content: space-between;
  height: calc(100% - 60px);
  /* Optional: sets a max width for larger screens */
}

.right-container {
  flex-grow: 2;
  width: 50%; /* Adjust based on your preference */
  height: 100%;
  margin-left: 10px;
  display: flexbox;
  flex-direction: column;
}

/* Top Bar for User Info and Connection Status */
.top-bar {
  background-color: #f8f9fa;
  align-items: right;
  padding: 10px;
  text-align: right;
  border-bottom: 1px solid #ccc;
  width: 100%;
  height: 60px;
  display: flexbox;
}

.profile-section {
  display: flex;
  padding: 10px;
  align-items: right;
  justify-content: flex-end;
}

.user-icon {
  padding: 10px;
  width: 24px;
  margin-right: 8px;
}

.status-dot {
  height: 10px;
  width: 10px;
  border-radius: 50%;
  background-color: #4CAF50; /* Default green for connected */
  margin-left: 5px;
}

/* Chat Container Layout */
.chat-container {
  margin-top: 60px; 
  display: flex;
  width: 100%;
  max-width: 1200px;
  height: 80vh;
}

/* Chat List (Left Panel) */
.chat-list {
  
  width: 35%;
  background-color: #8eb9cd9b;
  border-right: 1px solid #ccc;
  padding: 10px;
  overflow-y: auto;
  height: 100%;
}

.chat-item {
  padding: 10px;
  border-bottom: 1px solid #ccc;
  cursor: pointer;
  transition: background-color 0.3s;
}

.chat-item.active {
  background-color: #a749ff;
  color: #ffffff;
  font-weight: bold;
}
.chat-item:hover {
  background-color: #a9ffec;
}


.new-conversation-btn {
  width: 100%;
  padding: 10px;
  background-color: #f8f8f8;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.new-conversation-btn:hover {
  background-color: #e0e0e0;
}

/* Chat Box (Right Panel) */
.right-container {
  
  width: 50%; /* Takes 50% of the full page width */
  margin-left: 10px; /* Spacing from chat-container */
  height: calc(100% - 60px); /* Full height minus the top bar */
  display: flex;
  flex-direction: column; /* Stack children vertically */
}

.chat-box {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background-color: white;
  padding: 20px;
  border: 1px solid #ccc;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  height: 100%;
  overflow: hidden;
  height: 100%;
}


#messages {
  flex-grow: 1;
  height: 100%;
  flex-direction: column;
  align-items: flex-start;
  overflow-y: auto;
  padding: 10px;
  right: 10px;
  border: 1px solid #ccc;
  width: 100%;
  margin-bottom: 10px;
}

.messages img {
  max-width: 100%; /* Adjust based on your specific layout */
  height: auto;
  cursor: pointer; /* Indicates the image is clickable */
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000; /* Ensure it's above all other content */
  visibility: hidden; /* Hidden by default */
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(238, 4, 211, 0.539); /* Semi-transparent background */
}

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 100%;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  background: #fff;
}

.modal-content img {
  width: 500px; /* Adjust based on your preference */
  height: 500px;
  object-fit: contain; /* Ensures the image fits within the container */
}

.modal-show {
  visibility: visible;
}

/* Style for the container that holds file links and previews */
.message-files {
  margin-top: 10px;  /* Space between the text content and the image previews */
  display: flex;  /* Using flex to manage the layout of multiple files */
  flex-wrap: wrap;  /* Allows multiple items to wrap in a grid-like fashion */
  gap: 10px;  /* Space between images */
}

/* Style for each file link, which contains an image */
.message-files .gallery-item {
  flex: 0 1 auto;  /* Flex item that can grow and shrink but respects its content size */
  width: 100px;  /* Fixed width for each image/link for consistency */
  height: 100px;  /* Fixed height to maintain aspect ratio */
  overflow: hidden;  /* Hides parts of the img that might overflow */
  position: relative;  /* Needed if you want to absolutely position elements inside like buttons */
  border-radius: 8px;  /* Optional: adds rounded corners to each image container */
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);  /* Optional: adds subtle shadow for depth */
}

/* Style for images within gallery items to ensure they cover the space well */
.message-files .gallery-item img {
  width: 100%;  /* Ensures the image covers the assigned width */
  height: 100%;  /* Ensures the image covers the assigned height */
  object-fit: cover;  /* Ensures the image covers the space without distorting aspect ratio */
  cursor: pointer;  /* Indicates the image can be interacted with */
}

/* Optional: Style for hover effects on images to indicate interactiveness */
.message-files .gallery-item:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);  /* Darker shadow on hover for visual feedback */
}

.attachBtn{
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 8px;
  margin-right: 4px;
}

.date-separator {
  font-size: 12px;
  stroke-dasharray: 5, 5;
  color: #666;
  margin: 30px 30px;
  text-align: relative;
  position: center;
}

/* Chat Bubble Styles */
.chat-bubble {
  justify-content: left;
  max-width: 300px;
  word-wrap: break-word;
  padding: 10px;
  margin: 5px 0;
  border-radius: 10px;
  width: fit-content;
}

.bubble-sender {
  background-color: #d3c3ec;
  align-self: flex-end;
  text-align: right;
  margin-left: auto;
  margin-right: 10px;
  box-shadow: #666;    
}

.bubble-receiver {
  background-color: #d1f4d9;
  align-self: flex-start;
  text-align: left;
  margin-right: auto;
  margin-left: 10px;
}

.timestamp {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
}

/* Message Input and Attach Button */
.message-input-area {
  min-height: 50px;
  display: flex;
  height: auto;
  align-items: center;
  padding: 8px;
}

#messageContent {
  flex-grow: 1;
  padding: 10px;
  border: 1px solid #ccc;
  margin-right: 0px;
}

#sendBtn {
  padding: 10px 20px;
  font-size: 16px;
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  margin-left: 8px;
  background-color: #007427; /* Default green */
}

#attachBtn {
  padding: 10px 20px;
  font-size: 16px;
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  margin-left: 8px;
  background-color: #007427; /* Default green */
}

#attachBtn:hover {
  background-color: #0ef3b2;
}

#callBtn {
  padding: 10px 10px;
  font-size: 16px;
  text-align: center;
  color: rgb(3, 47, 22);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-left: 8px;
  background-color: rgba(86, 20, 252, 0); /* Default blue */
}

#callBtn img {
  height: 45px;
  vertical-align: middle;
}

#sendBtn:hover {
  background-color: #0ef353;
}

#callBtn:hover {
  background-color: #68dcf3;
}

.attach-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 8px;
  margin-right: 4px;
}

.attach-btn img {
  height: 20px;
  vertical-align: middle;
}


/* Video Call Styles */
.video-call-container {
  display: flex;
  margin-top: 60px; 
  position: relative;
  flex-grow: 2;
  width: 70%;
  padding: 10px;
  height: 100%;
  background-color: #000;
  display: flex-box;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-left: 10px; /* Spacing from right-container */
}

video#remoteVideo {
  width: 100%;
  height: 100%;
  border: none;
}

video#localVideo {
  width: 20%;
  height: auto;
  position: absolute;
  right: 10px;
  bottom: 10px;
  border: 2px solid white;
}
.video-Button-Container{
  display: flex;
  justify-content: center; /* Centers the buttons horizontally */
  align-items: center;
  position: absolute;
  bottom: 2%; /* Adjust as needed to position away from the very bottom */
  left: 50%; /* Center the div on the page horizontally */
  transform: translateX(-50%); /* Shifts the div back by half its width to truly center it */
  padding: 1vw;
  background: rgba(78, 75, 75, 0.6); /* Semi-transparent white background */
  border-radius: 10px; /* Optional: adds rounded corners to the controls background */
  z-index: 100;
}
.control-btn {
  display: flexbox;
  padding: 1vw; /* Padding scales with window width */
  background-color: transparent;
  border: none;
  width: 3vw; /* Button width as a percentage of the viewport width */
  height: 3vw; /* Button height as a percentage of the viewport width */
  border-radius: 50%; /* Circular buttons */
  cursor: pointer;
  background-size: 50%; /* Background image size as a percentage of button size */
  background-position: center; /* Center the background image */
  background-repeat: no-repeat; /* Do not repeat the background image */
  margin: 0 1vw; /* Margin scales with window width */
  transition: background-color 0.3s, transform 0.3s; /* Smooth transition for hover effects */
  object-fit: cover;
}




/* Make sure the z-index is appropriate if layers are overlapping */
/*.video-container, .local-video {
/*    z-index: 100; /* Adjust as necessary to bring video to front */
/*}

/* Offline Notification */
.offline-notification {
  color: #350a0a;
  font-style: italic;
  padding: 5px;
  background-color: #cb0505;
  border-left: 3px solid #f55a5a;
  text-align: center;
  position: relative;
  display: inline;
}

.close-notification-btn {
  position: absolute;
  top: 0;
  right: 0;
  border: none;
  background-color: transparent;
  color: black;
  cursor: pointer;
}
.top-bar {
  position: absolute;
  right: 0;
  top: 0;
  background-color: #ffffff03;
  padding: 10px;
  border-bottom-left-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.profile-section {
  display: flex;
  align-items: center;
  font-size: 14px;
}

.user-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: red; /* default to red */
  margin-left: 10px;
}
.right-container {
  display: flex;
  flex-grow: 1;
  flex-direction: row; /* Align children horizontally */
}

#logoutBtn {
  
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0px 0px;
  margin-right: 4px;
}
#logoutBtn:hover {
  background-color: #e80101;
}
.notification-area {
  position: fixed;
  bottom: 10px; /* Space from bottom */
  left: 50%; /* Center horizontally */
  transform: translateX(-50%); /* Ensure it's centered regardless of the width */
  width: auto;
  padding: 10px;
  background-color: #ffdddd; /* Light red background for visibility */
  border: 1px solid #ffaaaa;
  border-radius: 5px;
  display: none; /* Hide by default */
  z-index: 1000; /* Ensure it's on top of other elements */
}

#muteBtn {
  background-image: url('../assets/mic.png'); /* Path to the mic icon */
}
#muteBtn:hover {
  background-color: rgb(137, 122, 122);
}

#muteBtn.muted {
  background-image: url('../assets/mute.png'); /* Path to the muted mic icon */
}


#hangupBtn {
  background-image: url('../assets/hangup.png'); /* Path to the hangup icon */
  background-color: semitransparent; /* Optional: add a semi-transparent background */
}

#hangupBtn:hover {
  
  background-color: rgb(137, 122, 122); /* Optional: change the background color on hover */
}


#cameraBtn {
  background-image: url('../assets/video.png'); /* Path to the camera icon */
}
#cameraBtn:hover {
  background-color: rgb(137, 122, 122);
}


#cameraBtn.disabled {
  background-image: url('../assets/noVideo.png'); /* Path to the disabled camera icon */
}

.file-previews {
  display: flex;
  flex-wrap: wrap;
  margin-top: 10px;
  gap: 10px; /* Adds space between each preview for better visual separation */
  justify-content: start; /* Aligns items to the start of the container */
  align-items: center; /* Vertically centers items in their container */
  padding: 10px; /* Padding inside the previews container */
  border: 1px dashed #ccc; /* Optional: Adds a dashed border to indicate the area */
  background-color: #f9f9f9; /* Optional: Sets a background color for the preview area */
  min-height: 100px; /* Optional: Sets a minimum height for the preview area */
}

.file-preview {
  position: relative;
  width: 150px;
  height: 150px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.file-preview img {
  max-width: 100px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.file-preview video {
  max-width: 100px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.file-preview button {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  background: #f00;
  border: none;
  color: white;
  cursor: pointer;
  border-radius: 5px;
}