/* css/chat-popup.css */
#toggle-icon-container {
  position: fixed;
  bottom: 10px;
  right: 20px;
  border-radius: 100px;
  background-color: lightgray;
  padding: 15px;
  width: 70px;
  height: 70px;
}

#toggle-icon-container:hover {
  cursor: pointer;
}

#chat-popup {
  position: fixed;
  bottom: 90px;
  right: 20px;
  border: 1px solid #ccc;
  border-radius: 8px;
  max-width: 350px;
  max-height: 400px;
  height: 100%;
  width: 100%;
  display: none;
  background-color: white;
  z-index: 99999;
  justify-content: space-between;
}

#chat-popup.open {
  display: flex;
  flex-direction: column;
}

#chat-header {
  background-color: #0073e6;
  color: #fff;
  padding: 10px;
  text-align: center;
  border-top-left-radius: 7px;
  border-top-right-radius: 7px;
}

#chat-footer {
  margin-top: auto;
}

#toggle-icon {
  width: 40px;
  height: 40px;
}

#chat-messages {
  height: 268px;
  overflow-y: scroll;
  scroll-behavior: smooth;
  padding: 10px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

#chat-messages::-webkit-scrollbar {
  width: 5px;
  background-color: #F5F5F5;
}

#chat-messages::-webkit-scrollbar-thumb {
  background-color: #77E;
}

#chat-input {
  width: 70%;
  padding: 8px;
  border-bottom-left-radius: 8px;
  border: none;
  background-color: #eee;
}

#chat-input:focus {
  outline: none;
}

#send-btn {
  width: 28%;
  padding: 5px;
  background-color: #0073e6;
  color: #fff;
  border: none;
  cursor: pointer;
  border-bottom-right-radius: 8px;
}

.user-message,
.admin-message {
  background-color: grey;
  color: white;
  border-radius: 8px;
  border-bottom-right-radius: 0;
  padding: 4px 10px;
  width: 80%;
  float: left;
  align-self: end;
  margin: 5px 0;
}

.admin-message {
  background-color: darkmagenta;
  align-self: start;
  border-bottom-right-radius: 8px;
  border-bottom-left-radius: 0;
}

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 8px 0;
  border: 2px solid #ccc;
  border-top: 2px solid #333;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}