.chat-container {
  display: flex;
  width: 100%;
  height: 70vh;
  background-color: white;
  border-radius: 5px;
}

.chat-sidebar {
  width: 23%;
  padding: 20px 10px;
  overflow-y: auto;
  border-right: 2px solid #e0e0e0;
}

.chat-sidebar h5 {
  margin-top: 0;
}

#group-list {
  list-style: none;
  padding: 0;
  margin-top: 15px;
}

#group-list li {
  padding: 10px;
  cursor: pointer;
  /* border-bottom: 1px solid #ced4da; */
  display: flex;
  align-items: center;
  border-radius: 4px;
}

#group-list li.selected-group {
  background-color: #e0e0e0;
}

#group-list li img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 10px;
  border: 1px solid #e0e0e0;
}

/* #group-list li:hover {
  background-color: #f1f1f1;
} */

.chat-main {
  display: flex;
  flex: 1;
}

#chat-area {
  flex: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.selected-group-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 2px dotted #e0e0e0;
}

.group-info {
  display: flex;
  align-items: center;
}

.group-picture img {
  width: 50px;
  height: 50px;
  border-radius: 100%;
  object-fit: cover;
  border: 1px solid #e0e0e0;
}

.group-name {
  padding-left: 10px;
}

.group-name p {
  margin: 0;
  font-weight: 600;
}

#message-list {
  flex: 1;
  overflow-y: auto;
  /* padding: 10px; */
  /* border: 1px solid #ced4da; */
  border-radius: 5px;
  margin-bottom: 10px;
}

.message {
  display: flex;
  align-items: flex-start;
  margin: 10px;
  padding: 10px;
  border-radius: 10px;
}

.message img {
  width: 40px;
  height: 40px;
  border-radius: 100%;
  object-fit: cover;
  border: 1px solid #e0e0e0;
}

.current-user-message {
  justify-content: flex-end;
  padding-left: 15%;
}

.other-user-message {
  justify-content: flex-start;
  padding-right: 15%;
}

.message img {
  border-radius: 50%;
  margin-right: 10px;
  border: 1px solid #e0e0e0;
}

.current-user-message span {
  color: white;
  font-weight: 700;
  margin-bottom: 8px;
}

.current-user-message p {
  color: #e0e0e0;
  margin: 0px;
}

.current-user-message .created-at {
  color: white;
  margin: 0;
  font-size: 10px;
  margin-top: 10px;
  text-align: right;
}

.current-user-message .message-wrapper {
  background-color: #4a506e;
  padding: 10px;
  border-radius: 6px;
  width: 100%;
  margin: 0;
  word-break: break-word;
}

.other-user-message span {
  color: rgb(34, 34, 34);
  font-weight: 700;
  margin-bottom: 8px;
}

.other-user-message p {
  color: #3d3d3d;
  margin: 0px;
}

.other-user-message .created-at {
  color: #3d3d3d;
  margin: 0;
  font-size: 10px;
  margin-top: 10px;
  text-align: right;
}

.other-user-message .message-wrapper {
  background-color: #e0e0e0;
  padding: 10px;
  border-radius: 6px;
  width: 100%;
  margin: 0;
  word-break: break-word;
}

.message-input-wrapper {
  padding: 0px 10px;
  margin-bottom: 10px;
}

#message-input {
  display: flex;
}

#message-input input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ced4da;
  border-radius: 5px 0 0 5px;
  outline: none;
}

#message-input button {
  padding: 10px;
  border: 1px solid #d38c3e;
  border-left: 0;
  border-radius: 0 5px 5px 0;
  background-color: #d38c3e;
  color: white;
  cursor: pointer;
  outline: none;
}

#message-input button:hover {
  background-color: #a36624;
  border-color: #a36624;
}

#user-list-container {
  width: 25%;
  padding: 10px;
  overflow-y: auto;
  border-left: 2px solid #e0e0e0;
}

.user-title,
.group-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#user-list-container h5 {
  margin-top: 0;
}

#user-list {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-top: 15px;
}

#user-list li {
  padding: 10px;
  display: flex;
  align-items: center;
}

#user-list li img {
  width: 30px;
  height: 30px;
  border-radius: 100%;
  object-fit: cover;
  margin-right: 10px;
  border: 1px solid #e0e0e0;
}

/*
 Group section
*/
.create-group-form {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 20px;
  border: 1px solid #ced4da;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1001;
}

#create-group-form h5 {
  margin-top: 0;
}

#create-group-form form {
  display: flex;
  flex-direction: column;
}

#create-group-form form input,
#create-group-form form textarea,
#create-group-form form button {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #ced4da;
  border-radius: 5px;
}

#create-group-form form button {
  background-color: #d38c3e;
  color: white;
  cursor: pointer;
  border: 1px solid #d38c3e;
}

#create-group-form form button:hover {
  background-color: #a36624;
  border-color: #a36624;
}

#create-group-form form button[type="button"] {
  background-color: #6c757d;
  border-color: #6c757d;
}

#create-group-form form button[type="button"]:hover {
  background-color: #5a6268;
  border-color: #5a6268;
}

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
}

#create-group-form #category-id {
  width: 100%;
  padding: 10px;
  border: 1px solid #ced4da;
  border-radius: 5px;
  outline: none;
  background-color: white;
  font-size: 14px;
  color: #495057;
  appearance: none; /* Remove default dropdown arrow */
  -webkit-appearance: none; /* Remove default dropdown arrow for Safari */
  -moz-appearance: none; /* Remove default dropdown arrow for Firefox */
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="gray" class="bi bi-chevron-down" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
}

#create-group-form #category-id:focus {
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/*
  Assign users to the group
*/
/* Add User Form */
.add-user-form {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 20px;
  border: 1px solid #ced4da;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  max-height: 70vh;
  overflow-y: auto;
}

.add-user-form h5 {
  margin-top: 0;
}

.add-user-form ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.add-user-form li {
  padding: 10px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #ced4da;
}

.add-user-form li input[type="checkbox"] {
  margin-right: 10px;
}

.add-user-form button {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #d38c3e;
  border-radius: 5px;
  background-color: #d38c3e;
  color: white;
  cursor: pointer;
  outline: none;
}

.add-user-form button:hover {
  background-color: #a36624;
  border-color: #a36624;
}

.add-user-form button[type="button"] {
  background-color: #6c757d;
  border-color: #6c757d;
}

.add-user-form button[type="button"]:hover {
  background-color: #5a6268;
  border-color: #5a6268;
}

.error-messages {
  margin-bottom: 15px;
  color: #711a1a;
  background: #f87f7f;
  padding: 10px;
  border-radius: 6px;
}

.error-message {
  margin-bottom: 5px;
}

#add-user-btn,
#add-group-btn {
  background-color: #e0e0e0;
  border: none;
  outline: none;
  color: #707070;
  padding: 6px 10px;
  border-radius: 5px;
}

ul#add-user-list {
  list-style: none;
  padding: 12px 0px;
  margin: 0;
  max-width: 600px;
  margin: auto;
}

li.user-item {
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-radius: 5px;
  margin-bottom: 10px;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  transition: background-color 0.3s, box-shadow 0.3s;
}

li.user-item:hover {
  background-color: #f9f9f9;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-checkbox {
  margin-right: 10px;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

label {
  cursor: pointer;
  font-size: 16px;
  color: #333;
  transition: color 0.3s;
  margin-bottom: 0;
}

li.user-item:hover label {
  color: #000;
}
