/* Classic Alert Styles */
.classic-alert-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.1);
  z-index: 300000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.classic-alert-box {
  background: #e4e4e4;
  border: 1px solid #000;
  min-width: 320px;
  width: max-content;
  max-width: min(450px, 92vw);
  text-align: center;
  direction: rtl;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
  position: relative;
  padding: 30px 20px 18px 20px;
  border-radius: 3px;
  animation: popIn 0.15s ease-out;
  box-sizing: border-box;
}
.classic-alert-header {
  background: #2b3b4e;
  color: #fff;
  font-weight: bold;
  font-size: 15px;
  border: 1px solid #000;
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 25px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  white-space: nowrap;
  text-shadow: none !important;
  z-index: 10;
}
.classic-alert-header-error {
  background: #dc3545 !important;
}
.classic-alert-header-success {
  background: #28a745 !important;
}
.classic-alert-header-warning {
  background: #ffc107 !important;
  color: #000 !important;
}
.classic-alert-header-question {
  background: #17a2b8 !important;
}
.classic-alert-body {
  font-family: inherit;
  font-size: 15px;
  font-weight: normal;
  color: #000;
  line-height: 1.6;
  margin-bottom: 12px;
  text-shadow: none !important;
  word-break: break-word;
  overflow-wrap: break-word;
  font-weight: 700;
  word-wrap: break-word;
}
.classic-alert-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.classic-alert-buttons button {
  font-family: inherit;
  font-weight: bold;
  border-radius: 3px;
  padding: 5px 16px;
  border: 1px solid #000;
  background: #2b3b4e;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 80px;
  transition: opacity 0.15s ease;
}
.classic-alert-buttons button:hover {
  background: #1a252f;
  opacity: 0.9;
}
.classic-alert-buttons .btn-danger,
.classic-alert-buttons #classic-btn-deny {
  background: #dc3545 !important;
  color: #fff !important;
  border: 1px solid #000 !important;
}
.classic-alert-buttons .btn-danger:hover,
.classic-alert-buttons #classic-btn-deny:hover {
  background: #bb2d3b !important;
}
.classic-alert-buttons .btn-secondary,
.classic-alert-buttons #classic-btn-cancel {
  background: #6c757d !important;
  color: #fff !important;
  border: 1px solid #000 !important;
}
.classic-alert-buttons .btn-secondary:hover,
.classic-alert-buttons #classic-btn-cancel:hover {
  background: #5a6268 !important;
}
@keyframes popIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Hide original SweetAlert when classic alert is active */
body.classic-alert-active .swal2-container:not(.swal2-toast-container) {
  display: none !important;
}

/* Recipient Private Notification Popup Styles matching image.png */
.classic-alert-box.classic-recipient-alert-popup {
  background: #e4e4e4 !important;
  border: 1px solid #000 !important;
  border-radius: 4px !important;
  padding: 24px 20px 16px 20px !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
  width: 360px !important;
  min-width: 0 !important;
  max-width: min(360px, 92vw) !important;
  box-sizing: border-box !important;
  direction: rtl !important;
  position: relative !important;
}

.classic-recipient-alert-popup .classic-alert-header {
  background: #2b3b4e !important;
  color: #ffffff !important;
  font-weight: bold !important;
  font-size: 14.5px !important;
  border: 1px solid #000 !important;
  position: absolute !important;
  top: -14px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  padding: 3px 25px !important;
  border-radius: 5px !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3) !important;
  white-space: nowrap !important;
  z-index: 10 !important;
  display: block !important;
}

.recipient-alert-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  direction: rtl;
  text-align: center;
  font-family: inherit;
}

.recipient-alert-sender-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  direction: rtl;
  margin-top: 4px;
  margin-bottom: 8px;
}

.recipient-alert-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #2b3b4e;
  flex-shrink: 0;
  background: #ffffff;
}

.recipient-alert-user-identity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  overflow: hidden;
  white-space: nowrap;
}

.recipient-alert-user-identity .user-identity {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

.recipient-alert-user-identity .user-identity-name {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 150px !important;
  display: inline-block !important;
}

.recipient-alert-user-identity img,
.recipient-alert-user-identity .user-identity img {
  max-height: 20px !important;
  max-width: 40px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
}

.recipient-alert-user-identity .user-identity.user-identity-super-wide .user-identity-super {
  max-width: 140px !important;
  max-height: 22px !important;
  height: 22px !important;
  width: auto !important;
}

.recipient-alert-offline-tag {
  font-size: 10px;
  background: #6c757d;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  margin-left: 4px;
}

.recipient-alert-divider {
  width: 100%;
  height: 1px;
  background: #d0d0d0;
  border-bottom: 1px solid #ffffff;
  margin: 8px 0 14px 0;
}

.recipient-alert-message {
  font-size: 16px;
  color: #000000;
  line-height: 1.6;
  text-align: center;
  direction: rtl;
  word-break: break-word;
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-height: 180px;
  overflow-y: auto;
  padding: 0 6px;
  margin-bottom: 14px;
  box-sizing: border-box;
}

.recipient-alert-message img {
  max-width: 80px;
  max-height: 80px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
  margin: 2px;
}

.recipient-alert-message img.smiley,
.recipient-alert-message img[src*="smileys"],
.recipient-alert-message img[src*="emojis"],
.recipient-alert-message img[data-shortcut-type="smiley"] {
  max-width: 28px !important;
  max-height: 28px !important;
}

.recipient-alert-message img.sticker,
.recipient-alert-message img[src*="stickers"],
.recipient-alert-message img[data-shortcut-type="sticker"] {
  max-width: 75px !important;
  max-height: 75px !important;
}

.recipient-alert-message::-webkit-scrollbar {
  width: 5px;
}
.recipient-alert-message::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}
.recipient-alert-message::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.classic-recipient-alert-popup .classic-alert-buttons {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  direction: rtl;
}

.classic-recipient-alert-popup .classic-alert-buttons button {
  font-family: inherit;
  font-weight: bold;
  border-radius: 4px;
  padding: 6px 18px;
  border: 1px solid #000 !important;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  min-width: 105px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.classic-recipient-alert-popup .classic-alert-buttons #classic-btn-confirm {
  background: #2b3b4e !important;
  color: #ffffff !important;
}

.classic-recipient-alert-popup .classic-alert-buttons #classic-btn-confirm:hover {
  background: #1a252f !important;
  opacity: 0.95;
}

.classic-recipient-alert-popup .classic-alert-buttons #classic-btn-cancel {
  background: #5c6670 !important;
  color: #ffffff !important;
}

.classic-recipient-alert-popup .classic-alert-buttons #classic-btn-cancel:hover {
  background: #4a525a !important;
  opacity: 0.95;
}

.classic-recipient-alert-popup .classic-alert-buttons #classic-btn-ok {
  background: #2b3b4e !important;
  color: #ffffff !important;
}

/* Private Alert Popup Styles */
.classic-alert-box.classic-private-alert-popup {
  background: #e4e4e4 !important;
  border: 1px solid #000 !important;
  border-radius: 4px !important;
  padding: 16px 14px 12px 14px !important;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.25) !important;
  width: 310px !important;
  max-width: min(310px, 92vw) !important;
}

.private-alert-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
}

.private-alert-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  background: #2b3b4e;
  padding: 8px 14px;
  border-radius: 4px;
  border: 1px solid #000;
  direction: rtl;
  text-align: right;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.private-alert-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  flex-shrink: 0;
  background: #1a252f;
}

.private-alert-name {
  color: #fff !important;
  font-weight: bold;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

.private-alert-textarea-wrapper {
  position: relative;
  width: 100%;
  direction: rtl;
}

.private-alert-textarea {
  width: 100%;
  height: 105px;
  resize: none !important;
  border: 1px solid #000;
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: bold;
  direction: rtl;
  text-align: right;
  outline: none;
  background: #fff;
  color: #111;
  box-sizing: border-box;
}

.private-alert-textarea:focus {
  border-color: #2b3b4e;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.private-alert-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  margin-bottom: 6px;
  direction: rtl;
  padding: 0 2px;
}

.private-alert-char-counter {
  font-size: 12px;
  color: #555;
  font-weight: bold;
  direction: ltr;
}

.private-alert-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 4px;
  direction: rtl;
}

.private-alert-btn-emoji {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #aaa;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  padding: 0;
  outline: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.private-alert-btn-emoji:hover {
  background: #f8f8f8;
  transform: scale(1.06);
}

.private-alert-btn-emoji img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.private-alert-btn-emoji svg {
  display: block;
}

/* Custom Emoji/Sticker Picker Box */
.private-alert-picker {
  display: none;
  flex-direction: column;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fdfdfd;
  margin-top: 8px;
  height: 240px;
  overflow: hidden;
  box-sizing: border-box;
}

.private-alert-picker.is-open {
  display: flex;
}

.private-alert-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #eee;
  padding: 4px 8px;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
  direction: rtl;
}

.private-alert-picker-tabs {
  display: flex;
  gap: 8px;
}

.private-alert-tab-btn {
  background: none;
  border: none;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  color: #555;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.private-alert-tab-btn.active {
  background: #2b3b4e;
  color: #fff;
}

.private-alert-picker-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: #888;
  cursor: pointer;
  padding: 2px 6px;
}

.private-alert-picker-close:hover {
  color: #333;
}

.private-alert-picker-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 8px;
  direction: rtl;
}

/* Scrollbar inside the custom picker content */
.private-alert-picker-content::-webkit-scrollbar {
  width: 6px;
}
.private-alert-picker-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}
.private-alert-picker-content::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}
.private-alert-picker-content::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* Grids for smileys and stickers */
.private-alert-smileys-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.private-alert-stickers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.private-alert-picker-item {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.1s;
  padding: 4px;
  border: 1px solid transparent;
}

.private-alert-picker-item:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.private-alert-picker-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.private-alert-picker-item.smiley img {
  width: 28px;
  height: 28px;
}

.private-alert-picker-item.sticker img {
  width: 48px;
  height: 48px;
}
