:root {
  --chat-border-color: #e0e0e0;
  --chat-bg-light: #fff;
  --chat-bg-active: #e9ecef;
  --chat-bg-unread: #f0f8ff;
  --chat-text-muted: #6c757d;
  --chat-text-disabled: #9e9e9e;
  --chat-user-message-bg: #e9ecef;
  --chat-operator-message-bg: #e6f0ff;
  --chat-button-bg: #4a86e8;
  --chat-button-hover-bg: #3a76d8;
  --chat-button-disabled-bg: #6c757d;
  --chat-input-border: #ced4da; }

.chat-container {
  display: flex;
  height: calc(100vh - 150px);
  border: 1px solid var(--chat-border-color);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 20px; }

.chat-sidebar {
  width: 300px;
  border-right: 1px solid var(--chat-border-color);
  display: flex;
  flex-direction: column; }

.chat-sidebar-header {
  padding: 15px;
  border-bottom: 1px solid var(--chat-border-color);
  background-color: var(--chat-bg-light); }

.chat-search-container {
  position: relative;
  width: 100%; }

.chat-search-input {
  width: 100%;
  padding: 8px 30px 8px 10px;
  border: 1px solid var(--chat-input-border);
  border-radius: 4px;
  font-size: 14px; }

.chat-search-input:focus {
  outline: none;
  border-color: var(--chat-button-bg);
  box-shadow: 0 0 0 2px rgba(74, 134, 232, 0.2); }

.chat-search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none; }

.chat-sidebar-content {
  flex: 1;
  overflow-y: auto; }

.chat-users-list {
  list-style: none;
  padding: 0;
  margin: 0; }

.chat-user-item {
  padding: 15px;
  border-bottom: 1px solid var(--chat-border-color);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center; }

.chat-user-item:hover {
  background-color: var(--chat-bg-light); }

.chat-user-item.active {
  background-color: var(--chat-bg-active); }

.chat-user-item.has-unread {
  background-color: var(--chat-bg-unread); }

.chat-user-item.no-messages {
  color: var(--chat-text-disabled); }

.chat-user-item.no-messages .chat-user-name {
  color: var(--chat-text-disabled); }

.chat-user-info {
  flex: 1; }

.chat-user-name {
  font-weight: bold;
  margin-bottom: 5px; }

.chat-user-last-message {
  font-size: 13px;
  color: var(--chat-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; }

.chat-message-author {
  font-weight: bold; }

.chat-user-unread-count {
  background-color: var(--chat-button-bg);
  color: white;
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  padding: 0 5px; }
/* Badge for header chat icon */
.header-icon__badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #ff4d4f;
  color: white;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  padding: 0 4px; }
/* Make sure the chat icon has relative positioning for the badge */
.header-icon__item-chat {
  position: relative; }

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

.chat-header {
  padding: 15px;
  border-bottom: 1px solid var(--chat-border-color);
  background-color: var(--chat-bg-light); }

.chat-header h3 {
  margin: 0;
  font-size: 18px; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  background-color: var(--chat-bg-light);
  position: relative;
  /* Needed for proper scrollbar positioning */ }
/* Chat-specific NiceScroll styling */
.chat-messages .nicescroll-rails {
  z-index: 10 !important;
  /* Ensure scrollbar is above content */ }

.chat-messages .nicescroll-cursors {
  border: none !important;
  /* Remove default border */
  background-color: var(--chat-button-bg) !important;
  /* Use theme color */
  opacity: 0.7 !important;
  /* Semi-transparent */
  transition: opacity 0.3s ease; }

.chat-messages .nicescroll-cursors:hover {
  opacity: 1 !important;
  /* Full opacity on hover */ }

.chat-messages-content {
  display: flex;
  flex-direction: column; }

.chat-message {
  max-width: 70%;
  padding: 10px 15px;
  border-radius: 18px;
  margin-bottom: 10px;
  position: relative; }

.chat-message-time {
  font-size: 11px;
  color: var(--chat-text-muted);
  margin-top: 5px;
  text-align: right; }

.chat-date-separator {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0; }
  .chat-date-separator:before, .chat-date-separator:after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--chat-border-color); }
  .chat-date-separator:before {
    margin-right: 10px; }
  .chat-date-separator:after {
    margin-left: 10px; }

.chat-date-label {
  padding: 0 10px;
  background-color: var(--chat-bg-light);
  color: var(--chat-text-muted);
  font-size: 14px;
  font-weight: 500; }

.chat-message-user {
  align-self: flex-start;
  background-color: var(--chat-user-message-bg);
  border-bottom-left-radius: 5px; }

.chat-message-operator {
  align-self: flex-end;
  background-color: var(--chat-operator-message-bg);
  border-bottom-right-radius: 5px;
  color: inherit;
  /* Use default text color instead of white */ }

.chat-input-container {
  padding: 15px;
  border-top: 1px solid var(--chat-border-color); }

.chat-reservation-select-container {
  margin-bottom: 10px; }

.chat-reservation-select {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--chat-input-border);
  border-radius: 4px;
  font-size: 14px; }
/* Select2 custom styles for chat component */
.chat-reservation-select-container .select2-container--default .select2-selection--single {
  border: 1px solid var(--chat-input-border);
  border-radius: 4px;
  height: 38px; }

.chat-reservation-select-container .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 38px;
  padding-left: 12px;
  color: #333; }

.chat-reservation-select-container .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px; }

.chat-container .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--chat-button-bg); }

.chat-container .select2-dropdown {
  border: 1px solid var(--chat-input-border);
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); }

.chat-container .select2-results__option {
  padding: 8px 12px; }

.chat-form {
  display: flex;
  gap: 10px; }

.chat-input {
  flex: 1;
  border: 1px solid var(--chat-input-border);
  border-radius: 4px;
  padding: 10px;
  resize: none;
  height: 60px; }

.chat-send-button {
  background-color: var(--chat-button-bg);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0 20px;
  cursor: pointer; }

.chat-send-button:hover {
  background-color: var(--chat-button-hover-bg); }

.chat-send-button:disabled {
  background-color: var(--chat-button-disabled-bg);
  cursor: not-allowed; }
/* Preloader styles */
.chat-preloader {
  display: none;
  z-index: 10;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); }

.chat-preloader .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(74, 134, 232, 0.2);
  border-radius: 50%;
  border-top-color: var(--chat-button-bg);
  animation: spin 1s linear infinite; }
/* Sending preloader styles */
.chat-sending-preloader {
  display: none;
  z-index: 10;
  position: absolute;
  bottom: 34px;
  right: 156px; }

.chat-sending-preloader .spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(74, 134, 232, 0.2);
  border-radius: 50%;
  border-top-color: var(--chat-button-bg);
  animation: spin 1s linear infinite; }
/* New message notification styles */
.new-messages-notification {
  display: none;
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #007bff;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); }

@keyframes spin {
  0% {
    transform: rotate(0deg); }

  100% {
    transform: rotate(360deg); } }
/* Error message styles */
.chat-error-message {
  background-color: #ffebee;
  color: #d32f2f;
  padding: 10px 15px;
  border-radius: 4px;
  margin: 10px 0;
  text-align: center;
  border-left: 4px solid #d32f2f;
  font-size: 14px;
  align-self: center;
  max-width: 90%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
/* Hide scrollbar styles */
.chat-messages.hide-scrollbar::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important; }

.chat-messages.hide-scrollbar {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
  overflow: hidden !important; }
/* Chat message text styles */
.chat-message-text {
  white-space: pre-wrap; }
/* Reservation button styles */
.reservation-button {
  display: inline-block;
  background-color: #f0f5ff;
  color: #36c;
  border: 1px solid #d0e0ff;
  border-radius: 4px;
  padding: 2px 8px;
  margin: 0 4px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.2s ease; }

.reservation-button:hover {
  background-color: #d0e0ff;
  border-color: #36c; }
/* Position styles for containers */
.chat-messages {
  position: relative; }

.chat-main {
  position: relative; }
