.messageCenterAppPanel {
  height: 100%;
  position: fixed;
  z-index: 2500;
  top: 0;
  transition: 0.5s;
}

.messageCenter {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 500px;
  position: fixed;
  z-index: 1401;
  top: 0;
  right: -502px;

  background-color: #fff;
  overflow-x: hidden;
  transition: 0.5s;
  border: 1px solid #dedede;

}

/* Dialog List V2 Styles */

/* Header */
#mc-header {
  padding: 12px 14px;
  background-color: #128C7E;
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  min-height: 33px;
}

.mc-header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mc-header-left {
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.mc-header-back-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
  font-size: 16px;
}

.mc-header-back-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.mc-header-back-btn i {
  font-size: 16px;
}

.mc-header-title {
  flex: 1;
  font-weight: 500;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  padding:0 10px;
}

.mc-header-search {
  flex: 1;
  min-width: 0;
}

.mc-header-search-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.mc-header-search-wrapper .v-select {
  flex: 1;
  font-size: 14px;
  background-color: #fff;
}

.mc-header-search-wrapper .v-select .vs__search, .mc-header-search-wrapper .v-select .vs__selected-options {
  color: #222 !important;
}

.mc-header-search-wrapper .v-select .vs__dropdown-toggle {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: #fff;
  min-height: 32px;
}

.mc-header-search-wrapper .v-select .vs__search::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.mc-header-search-wrapper .v-select .vs__search,
.mc-header-search-wrapper .v-select .vs__selected-options {
  color: #fff;
}

.mc-header-search-wrapper .v-select .vs__open-indicator {
  fill: rgba(255, 255, 255, 0.8);
}

.mc-header-search-wrapper .v-select .vs__clear {
  fill: rgba(255, 255, 255, 0.8);
}

.mc-header-search-wrapper .v-select .vs__dropdown-menu {
  background-color: #fff;
  color: #000;
  border: 1px solid #ddd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mc-header-search-close {
  cursor: pointer;
  font-size: 16px;
  opacity: 0.8;
  transition: opacity 0.2s;
  padding: 4px;
  flex-shrink: 0;
}

.mc-header-search-close:hover {
  opacity: 1;
}

.mc-header-write {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mc-header-write-btn {
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: #fff;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s, border-color 0.2s;
}

.mc-header-write-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.mc-header-write-btn i {
  font-size: 14px;
}

.mc-header-right {
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.mc-header-close {
  cursor: pointer;
  font-size: 16px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.mc-header-close:hover {
  opacity: 1;
}

#mc-content {
  flex: 1;
}

.dialog-list-container {
  height: 100%;
  overflow-y: auto;
}

.dialog-item-wrapper {
  border-bottom: 1px solid #cdcdcd;
}

.dialog-item {
  display: flex;
  align-items: center;
  padding: 10px 10px;
  cursor: pointer;
  transition: background-color 0.2s;
  min-height: 50px;
}

.dialog-item:hover {
  background-color: #f5f5f5;
}

.dialog-item-icon {
  margin-right: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.dialog-item-icon i {
  color: #25D366; /* WhatsApp green */
}

.dialog-item-icon i.fa-telegram {
  color: #0088cc; /* Telegram blue */
}

.dialog-item-icon i.fa-max,
.dialog-item-icon .max-icon {
  color: #6C5CE7; /* MAX purple */
}

/* MAX Messenger SVG Icon */
.max-icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  vertical-align: middle;
}

.max-icon svg {
  width: 100%;
  height: 100%;
}

.dialog-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dialog-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.dialog-item-name {
  font-weight: 500;
  font-size: 14px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.dialog-item-time {
  font-size: 12px;
  color: #999;
  flex-shrink: 0;
}

.dialog-item-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dialog-item-text {
  font-size: 13px;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.dialog-item-unread-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #25D366;
  flex-shrink: 0;
}

/* Current Dialog Styles */
.current-dialog-container {
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: #efe7dd url(../img/4e765036-1639-11e6-9201-67e728e86f39.jpg) repeat;
}

.current-dialog-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #666;
  font-size: 14px;
}

.current-dialog-messages-wrapper {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.current-dialog-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.current-dialog-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: #999;
  font-size: 14px;
}

.current-dialog-input-area {
  flex-shrink: 0;
  padding: 10px 16px;
  background-color: #f0f0f0;
  border-top: 1px solid #ddd;
}

.current-dialog-mark-read {
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
}

.current-dialog-mark-read-btn {
  background-color: #128C7E;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s;
}

.current-dialog-mark-read-btn:hover {
  background-color: #0d6e63;
}

.current-dialog-mark-read-btn i {
  font-size: 12px;
}

.current-dialog-sending-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background-color: rgba(37, 211, 102, 0.1);
  border-radius: 8px;
  font-size: 13px;
  color: #25D366;
}

.current-dialog-sending-indicator i {
  font-size: 14px;
}

.current-dialog-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #fff;
  border-radius: 20px;
  padding: 8px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.current-dialog-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  padding: 0;
  background: transparent;
}

.current-dialog-input::placeholder {
  color: #999;
}

.current-dialog-send-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  background-color: #128C7E;
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.current-dialog-send-btn:hover:not(:disabled) {
  background-color: #0d6e63;
}

.current-dialog-send-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.current-dialog-snippet-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background-color: transparent;
  color: #ccc;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
}

.current-dialog-snippet-btn:hover:not(:disabled) {
  background-color: rgba(18, 140, 126, 0.1);
}

.current-dialog-snippet-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.current-dialog-snippet-btn i {
  font-size: 14px;
}

.snippet-panel-v2 {
  margin-top: 8px;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  max-height: 220px;
  overflow-y: auto;
  padding: 8px 10px;
}

.snippet-panel-v2-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid #eee;
}

.snippet-panel-v2-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.snippet-panel-v2-title {
  font-size: 13px;
  font-weight: 500;
  color: #333;
}

.snippet-panel-v2-add-btn {
  background: #128C7E;
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background-color 0.2s;
  min-width: 24px;
  height: 24px;
}

.snippet-panel-v2-add-btn:hover {
  background: #0d6e62;
}

.snippet-panel-v2-search {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
}

.snippet-panel-v2-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.snippet-panel-v2-item {
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.snippet-panel-v2-item:hover {
  background-color: #f5f5f5;
}

.snippet-panel-v2-item-content {
  flex: 1;
  min-width: 0;
}

.snippet-panel-v2-item-title {
  font-size: 12px;
  font-weight: 500;
  color: #333;
  margin-bottom: 2px;
}

.snippet-panel-v2-item-text {
  font-size: 12px;
  color: #555;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.snippet-panel-v2-item-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.snippet-panel-v2-item:hover .snippet-panel-v2-item-actions {
  opacity: 1;
}

.snippet-panel-v2-item-btn {
  background: transparent;
  border: none;
  border-radius: 3px;
  color: #666;
  cursor: pointer;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: background-color 0.15s, color 0.15s;
  min-width: 20px;
  height: 20px;
}

.snippet-panel-v2-item-btn:hover {
  background-color: #e0e0e0;
  color: #333;
}

.snippet-panel-v2-item-btn-danger:hover {
  background-color: #fee;
  color: #d00;
}

.snippet-panel-v2-empty {
  font-size: 12px;
  color: #999;
  padding: 4px 0;
}

.snippet-panel-v2-loading {
  font-size: 12px;
  color: #666;
  padding: 4px 0;
}

.snippet-panel-v2-form {
  padding: 8px;
  border-bottom: 1px solid #eee;
  background-color: #fafafa;
}

.snippet-panel-v2-form-header {
  font-size: 13px;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
}

.snippet-panel-v2-form-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.snippet-panel-v2-form-title {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
}

.snippet-panel-v2-form-text {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
}

.snippet-panel-v2-form-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.snippet-panel-v2-form-btn {
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.15s;
  font-family: inherit;
}

.snippet-panel-v2-form-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.snippet-panel-v2-form-btn-primary {
  background: #128C7E;
  color: #fff;
}

.snippet-panel-v2-form-btn-primary:hover:not(:disabled) {
  background: #0d6e62;
}

.snippet-panel-v2-form-btn-secondary {
  background: #e0e0e0;
  color: #333;
}

.snippet-panel-v2-form-btn-secondary:hover:not(:disabled) {
  background: #d0d0d0;
}

.snippet-panel-v2-form-btn-danger {
  background: #f44336;
  color: #fff;
}

.snippet-panel-v2-form-btn-danger:hover:not(:disabled) {
  background: #d32f2f;
}

.current-dialog-message {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 8px;
  word-wrap: break-word;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-incoming {
  align-self: flex-start;
  background-color: #fff;
  border-bottom-left-radius: 4px;
}

.message-outgoing {
  align-self: flex-end;
  background-color: #dcf8c6;
  border-bottom-right-radius: 4px;
}

.message-text {
  font-size: 14px;
  line-height: 1.4;
  color: #333;
  white-space: pre-wrap;
}

.message-media {
  margin: -8px -12px 4px -12px;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

.message-media img {
  display: block;
  max-width: 100%;
  height: auto;
}

.message-audio {
  margin: -8px -12px 4px -12px;
  padding: 8px 12px;
}

.message-audio audio {
  width: 100%;
  max-width: 250px;
}

.message-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.message-author {
  font-size: 11px;
  color: rgba(0, 0, 0, 0.6);
  font-weight: 500;
  white-space: nowrap;
}

.message-time {
  font-size: 11px;
  color: rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

/* MAX Messenger SVG Icon */
.max-icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  vertical-align: middle;
}

.max-icon svg {
  width: 100%;
  height: 100%;
  fill: #6C5CE7;
}

/* MAX Messenger SVG Icon as background image (encoded) - на основе оригинального логотипа */
.max-icon-bg {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='maxGrad' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%236C5CE7'/%3E%3Cstop offset='50%25' stop-color='%237A6AE8'/%3E%3Cstop offset='100%25' stop-color='%238B7ED8'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx='12' cy='12' r='10' fill='url(%23maxGrad)'/%3E%3Ctext x='12' y='16.5' font-family='Arial, sans-serif' font-size='9' font-weight='bold' fill='%23FFFFFF' text-anchor='middle' letter-spacing='0.3'%3EMAX%3C/text%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 24px;
  height: 24px;
  display: inline-block;
}

/* MAX Messenger SVG Icon - inline version */
.max-icon-inline {
  width: 24px;
  height: 24px;
  display: inline-block;
  vertical-align: middle;
}

.max-icon-inline svg {
  width: 100%;
  height: 100%;
}

