/* ==========================================================================
   INBOX / LIVE CHAT CSS
   Consolidated from multiple Blade files into a single stylesheet.
   ========================================================================== */

/* ========================================
   FROM: index.blade.php
   ======================================== */
.search-left-menu {
  height: calc(100vh) !important;
  overflow: visible !important;
  display: flex;
  flex-direction: column;
  padding-bottom: 20px;
}

.search-left-menu::-webkit-scrollbar {
  display: none;
}

/* Prevents parent level scrolling on the Live Chat page */
.inbox-page-container {
  display: flex !important;
  flex-direction: column !important;
  height: calc(100vh - 100px) !important; /* Adjusted to standard header height */
  min-height: 0 !important;
  padding: 16px 24px;
  box-sizing: border-box;
  overflow: hidden !important;
}

.inbox-content.row {
  display: flex;
  flex-direction: row;
  height: 100%;
  overflow: hidden;
  margin: 0;
  background: white;
}

.inbox-content {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.inbox-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 16px;
}

.inbox-content .col-3 {
  width: 25% !important;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-right: 8px !important;
}

.inbox-content .col-9 {
  width: 75% !important;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-left: 8px !important;
}

.inbox-empty-state {
  padding: 12vh 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.header-loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 12px;
}

.small-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--primary-600);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Conversation card base styles - ensure fake conversations have same styling */
.inbox-conversation-card {
  display: flex;
  align-items: center;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  background: white;
}

.inbox-conversation-card:hover {
  background: #f8f9fa;
}

.inbox-conversation-card.active {
  background: var(--black-color04);
  border-radius: 12px;
}

.conversation-avatar {
  position: relative;
  margin-right: 12px;
  flex-shrink: 0;
}

.conversation-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.conversation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.conversation-name {
  font-size: 14px;
  color: var(--black-color1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
  display: flex;
  align-items: center;
  line-height: 2;
}

.conversation-time {
  font-size: 10px;
  color: var(--black-color4);
  white-space: nowrap;
  line-height: 1.6;
}

.conversation-message {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-preview {
  font-size: 12px;
  color: var(--neutral-500);
  line-height: 1.32;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.no-message {
  color: #a0aec0;
  font-style: italic;
}

/* ========================================
   FROM: unified-chat-panel.blade.php
   ======================================== */
.unified-chat-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--black-color01);
  border-radius: 20px;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--black-color01);
}

.chat-user-info {
  display: flex;
  align-items: start;
  gap: 8px;
}

.chat-header-notice {
  text-align: right;
  flex: 1;
  min-width: 0;
  max-width: 520px;
  margin-left: 16px;
}

.chat-header-notice-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--black-color1);
  margin: 0 0 2px 0;
  line-height: 1.4;
}

.chat-header-notice-desc {
  font-size: 11px;
  color: var(--black-color4);
  margin: 0;
  line-height: 1.5;
  text-wrap: pretty;
}

.chat-header-notice-desc-last {
  white-space: nowrap;
}

.chat-header-notice-content {
  font-size: 11px;
  color: var(--black-color4);
  line-height: 1.5;
  text-wrap: pretty;
}

.chat-header-notice-content h1,
.chat-header-notice-content h2,
.chat-header-notice-content h3,
.chat-header-notice-content h4,
.chat-header-notice-content h5,
.chat-header-notice-content h6 {
  font-size: 12px;
  font-weight: 600;
  color: var(--black-color1);
  margin: 0 0 2px 0;
  line-height: 1.4;
}

.chat-header-notice-content p {
  font-size: 11px;
  color: var(--black-color4);
  margin: 0;
  line-height: 1.5;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 14px;
  color: var(--black-color1);
  line-height: 2;
}

.user-status {
  font-size: 12px;
  color: var(--black-color4);
  line-height: 1.6;
  display: flex;
  align-items: center;
  gap: 4px;
}

.user-status.online {
  color: #4caf50;
}

.status-separator {
  margin: 0 2px;
}

.online-count {
  color: #4caf50;
  font-weight: 500;
}

.group-avatar-container {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.group-avatar-item {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
}

.group-avatar-item.first {
  top: 12px;
  left: 0;
  z-index: 2;
}

.group-avatar-item.second {
  top: 0;
  left: 12px;
  z-index: 1;
}

.group-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.group-avatar-text {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1;
}

.avatar-wrapper {
  position: relative;
  display: inline-block;
}

.avatar-wrapper.clickable-avatar {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.avatar-wrapper.clickable-avatar:hover {
  opacity: 0.8;
}

.online-indicator {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background-color: #4caf50;
  border: 1px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.chat-messages {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.messages-list-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.messages-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 24px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.chat-input {
  flex-shrink: 0;
}

.chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  height: 100%;
  color: #6c757d;
}

.chat-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  flex: 1;
  color: #6c757d;
  min-height: 200px;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
  position: relative;
  z-index: 50;
  background: white;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-600);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.loading-text {
  font-size: 14px;
  color: #6c757d;
  font-weight: 500;
}

.chat-warning-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 63px;
  background: var(--cinnabar-50);
  border-bottom: 2px solid var(--neutral-300);
}

.warning-text {
  font-size: 12px;
  color: var(--cinnabar-500);
  font-weight: 400;
  line-height: 1.32;
  margin: 0;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.scroll-to-bottom-btn {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: 20px;
  height: 20px;
  background: transparent;
  border: 1px solid var(--black-color4);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
}

.scroll-to-bottom-btn.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  background: var(--black-color4);
}

.scroll-to-bottom-btn:hover {
  background: var(--black-color2);
  transform: translateX(-50%) translateY(-2px);
}

.scroll-to-bottom-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.scroll-to-bottom-btn svg:hover {
  fill: white;
}

/* ========================================
   FROM: messages-list.blade.php
   ======================================== */
.icon-wrapper {
  width: 212px;
  height: 212px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background: var(--primary-50);
  border-radius: 50%;
  padding: 16px;
}

/* Lock scroll when reply menu is open - prevent scroll but keep scrollbar visible */
.messages-list.scroll-locked {
  overflow-y: scroll !important;
  position: relative;
}

.messages-list::-webkit-scrollbar {
  width: 6px;
}

.messages-list::-webkit-scrollbar-track {
  background: transparent;
}

.messages-list::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}

.messages-list::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

.messages-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  height: 100%;
  color: #6c757d;
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: #495057;
  margin: 16px 0 8px 0;
}

.empty-description {
  font-size: 14px;
  color: #6c757d;
  line-height: 1.5;
}

/* ========================================
   DATE SEPARATOR STYLES
======================================== */
.date-separator {
  text-align: center;
  margin: 16px 0;
  position: relative;
  width: 100%;
  display: block;
  clear: both;
}

.date-separator::before,
.date-separator::after {
  content: '';
  position: absolute;
  top: 50%;
  height: 1px;
  background-color: var(--neutral-300);
}

.date-separator::before {
  left: 0;
  right: 50%;
  margin-right: 8px;
}

.date-separator::after {
  right: 0;
  left: 50%;
  margin-left: 8px;
}

.date-separator-text {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid var(--neutral-300);
  background-color: var(--neutral-0, #ffffff);
  color: var(--neutral-500);
  font-size: 10px;
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

/* ========================================
   GLOBAL MESSAGE BUBBLE STYLES
======================================== */
.message-bubble {
  margin-bottom: 16px;
  max-width: 50%;
  width: fit-content;
  transition:
    transform 0.2s ease,
    opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: context-menu;
}

.message-bubble.own-message {
  margin-left: auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.4;
}

.message-bubble.other-message {
  margin-right: auto;
  text-align: left;
  line-height: 1.4;
}

.message-bubble.group-chat .sender-name {
  font-weight: 600;
  color: var(--neutral-800);
}

/* ========================================
   SENDER INFO & HEADER STYLES
======================================== */
.sender-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sender-details {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.sender-name {
  font-weight: 500;
  font-size: 12px;
}

.message-time {
  font-size: 12px;
  color: var(--neutral-500);
}

/* ========================================
   COMMON MESSAGE CONTENT STYLES
======================================== */
.message-content {
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  width: fit-content;
  overflow: hidden;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.message-text {
  font-size: 14px;
  line-height: 2;
  width: fit-content;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  color: var(--black-color1);
}

/* File Attachment Styles */
.message-files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}

.message-file-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--neutral-200);
  border-radius: 12px;
  text-decoration: none !important;
  color: var(--neutral-800) !important;
  transition: all 0.2s ease;
  min-width: 250px;
  max-width: 100%;
}

.own-message .message-file-item {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: white !important;
}

.message-file-item:hover {
  border-color: var(--neutral-300);
  transform: translateY(-1px);
}

.own-message .message-file-item:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.file-icon-wrapper {
  width: 36px;
  height: 36px;
  background: var(--primary-100);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
  color: var(--primary-600);
}

.own-message .file-icon-wrapper {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.file-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-right: 12px;
  flex: 1;
}

.file-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.file-size {
  font-size: 11px;
  opacity: 0.7;
  line-height: 1.2;
  margin-top: 2px;
}

.download-icon-wrapper {
  margin-left: auto;
  opacity: 0.6;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-file-item:hover .download-icon-wrapper {
  opacity: 1;
}

.message-images {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  margin-bottom: 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.message-text img,
.message-with-image img,
.message-images img {
  width: auto !important;
  max-width: 100% !important;
  max-height: 300px !important;
  height: auto !important;
  display: block !important;
  background: transparent;
  border-radius: inherit;
}

/* ========================================
   1. TIN NHáº®N THÃ”NG THÆ¯á»œNG (NORMAL MESSAGES)
======================================== */

/* 1.1 Báº¢N THÃ‚N MÃŒNH Gá»¬I (OWN MESSAGES) */

/* 1.1.1 Tin nháº¯n text - Báº£n thÃ¢n */
.message-bubble.own-message .message-content:not(.has-reply):not(.image-only):not(.message-with-image) {
  background: var(--background-color5);
  border-radius: 16px 24px 4px 16px;
  padding: 8px 12px;
}

.message-bubble.own-message .message-text:not(.has-reply):not(.image-only):not(.message-with-image) {
  background: var(--background-color5);
  border-radius: 16px 24px 4px 16px;
}

/* 1.1.2 Tin nháº¯n áº£nh - Báº£n thÃ¢n */
.message-bubble.own-message .message-content.image-only:not(.has-reply),
.message-bubble.own-message .message-text.image-only:not(.has-reply) {
  background: transparent;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.message-bubble.own-message .message-text.image-only:not(.has-reply) img {
  width: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 16px 24px 4px 16px !important;
}

/* 1.1.3 Tin nháº¯n cÃ³ text vÃ  áº£nh - Báº£n thÃ¢n */
.message-bubble.own-message .message-text.message-with-image:not(.has-reply) {
  background: transparent;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.message-bubble.own-message .message-with-image:not(.has-reply) .message-images {
  padding: 0 !important;
  margin: 0 !important;
  margin-bottom: 0;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  position: relative !important;
  border-radius: 16px 24px 4px 16px !important;
  z-index: 0;
  overflow: hidden;
}

.message-bubble.own-message .message-with-image:not(.has-reply) .message-images::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--bg-image);
  background-size: var(--bg-size, cover);
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(10px);
  z-index: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.message-bubble.own-message .message-with-image:not(.has-reply) .message-images img {
  width: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 16px 24px 4px 16px !important;
  position: relative;
  z-index: 1;
  display: block;
}

.message-bubble.own-message .message-text-content:not(.has-reply) {
  background: var(--background-color5);
  border-radius: 0px 0px 16px 16px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
  padding: 8px 12px !important;
  margin: 0 !important;
}

/* 1.2 TIN NHáº®N NHáº¬N (OTHER MESSAGES) */

/* 1.2.1 Tin nháº¯n text - NgÆ°á»i khÃ¡c */
.message-bubble.other-message .message-content:not(.has-reply):not(.image-only):not(.message-with-image) {
  color: var(--black-color1);
  background: var(--background-color4);
  border-radius: 24px 16px 16px 4px;
  padding: 8px 12px;
}

.message-bubble.other-message .message-text:not(.has-reply):not(.image-only):not(.message-with-image) {
  border-radius: 24px 16px 16px 4px;
}

/* 1.2.2 Tin nháº¯n áº£nh - NgÆ°á»i khÃ¡c */
.message-bubble.other-message .message-content.image-only:not(.has-reply) {
  background: transparent;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.message-bubble.other-message .message-text.image-only:not(.has-reply) {
  background: transparent;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.message-bubble.other-message .message-text.image-only:not(.has-reply) img {
  width: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 24px 16px 16px 4px !important;
}

/* 1.2.3 Tin nháº¯n cÃ³ text vÃ  áº£nh - NgÆ°á»i khÃ¡c */
.message-bubble.other-message .message-text.message-with-image:not(.has-reply) {
  background: transparent;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.message-bubble.other-message .message-with-image:not(.has-reply) .message-images {
  padding: 0 !important;
  margin: 0 !important;
  margin-bottom: 0;
  border-radius: 24px 16px 16px 4px !important;
}

.message-bubble.other-message .message-with-image:not(.has-reply) .message-images {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  position: relative !important;
  z-index: 0;
  overflow: hidden;
}

.message-bubble.other-message .message-with-image:not(.has-reply) .message-images::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(10px);
  z-index: 0;
  transform: scale(1.05);
}

.message-bubble.other-message .message-with-image:not(.has-reply) .message-images img {
  width: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 24px 16px 16px 4px !important;
  display: block;
  position: relative;
  z-index: 1;
}

.message-bubble.other-message .message-text-content:not(.has-reply) {
  background: var(--background-color4);
  border-radius: 0px 0px 16px 16px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
  padding: 8px 14px !important;
  margin: 0 !important;
}

/* ========================================
   2. TIN NHáº®N CÃ“ REPLY (MESSAGES WITH REPLY)
======================================== */

/* 2.1 Báº¢N THÃ‚N MÃŒNH Gá»¬I CÃ“ REPLY (OWN MESSAGES WITH REPLY) */

/* 2.1.1 Tin nháº¯n text cÃ³ reply - Báº£n thÃ¢n */
.message-bubble.own-message .message-content.has-reply:not(.image-only):not(.message-with-image) {
  background: transparent;
  padding: 0;
}

.message-bubble.own-message .message-text.has-reply:not(.image-only):not(.message-with-image) {
  background: var(--background-color5);
  border-radius: 0 0 10px 10px;
  padding: 8px 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* 2.1.2 Tin nháº¯n áº£nh cÃ³ reply - Báº£n thÃ¢n */
.message-bubble.own-message .message-content.has-reply.image-only,
.message-bubble.own-message .message-text.has-reply.image-only {
  background: transparent;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.message-bubble.own-message .message-text.has-reply.image-only {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

.message-bubble.own-message .message-text.has-reply.image-only::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--bg-image);
  background-size: var(--bg-size, cover);
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(10px);
  z-index: 0;
  pointer-events: none;
}

.message-bubble.own-message .message-text.has-reply.image-only img {
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0px 0px 10px 10px !important;
  position: relative;
  z-index: 1;
  display: block;
  flex-shrink: 0;
}

/* 2.1.3 Tin nháº¯n cÃ³ text vÃ  áº£nh cÃ³ reply - Báº£n thÃ¢n */
.message-bubble.own-message .message-text.has-reply.message-with-image {
  background: transparent;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 0 0 10px 10px;
}

.message-bubble.own-message .message-text.has-reply.message-with-image .message-images {
  padding: 0 !important;
  margin: 0 !important;
  margin-bottom: 0;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  position: relative !important;
  z-index: 0;
  overflow: hidden;
}

.message-bubble.own-message .message-text.has-reply.message-with-image .message-images::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--bg-image);
  background-size: var(--bg-size, cover);
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(10px);
  z-index: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.message-bubble.own-message .message-text.has-reply.message-with-image .message-images img {
  width: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 10px 0px 0px 0px !important;
  display: block;
  position: relative;
  z-index: 1;
}

.message-bubble.own-message .message-text.has-reply.message-with-image .message-text-content {
  background: var(--background-color5);
  border-radius: 0 0 10px 10px;
  padding: 8px 14px;
  margin: 0;
}

.message-bubble.own-message .message-content.has-reply {
  border-radius: 0 0 10px 10px;
  margin-top: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-left: 0;
  margin-right: 0;
  min-width: 0;
}

/* 2.2 TIN NHáº®N NHáº¬N CÃ“ REPLY (OTHER MESSAGES WITH REPLY) */

/* 2.2.1 Tin nháº¯n text cÃ³ reply - NgÆ°á»i khÃ¡c (same as own messages) */
.message-bubble.other-message .message-content.has-reply:not(.image-only):not(.message-with-image) {
  background: transparent;
  padding: 0;
  margin-right: 0;
}

.message-bubble.other-message .message-text.has-reply:not(.image-only):not(.message-with-image) {
  background: #f1f3f4;
  color: var(--neutral-800);
  border-radius: 0 0 10px 10px;
  padding: 8px 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* 2.2.2 Tin nháº¯n áº£nh cÃ³ reply - NgÆ°á»i khÃ¡c (same as own messages) */
.message-bubble.other-message .message-content.has-reply.image-only {
  background: transparent;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  margin-left: 0;
  margin-right: 0;
}

.message-bubble.other-message .message-text.has-reply.image-only {
  background: transparent;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

.message-bubble.other-message .message-text.has-reply.image-only::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--bg-image);
  background-size: var(--bg-size, cover);
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(10px);
  z-index: 0;
  pointer-events: none;
}

.message-bubble.other-message .message-text.has-reply.image-only img {
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 10px 0px 0px 0px !important;
  position: relative;
  z-index: 1;
  display: block;
  flex-shrink: 0;
}

/* 2.2.3 Tin nháº¯n cÃ³ text vÃ  áº£nh cÃ³ reply - NgÆ°á»i khÃ¡c (same as own messages) */
.message-bubble.other-message .message-content.has-reply.message-with-image {
  background: transparent;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  margin-left: 0;
  margin-right: 0;
}

.message-bubble.other-message .message-text.has-reply.message-with-image {
  background: transparent;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.message-bubble.other-message .message-text.has-reply.message-with-image .message-images {
  padding: 0 !important;
  margin: 0 !important;
  margin-bottom: 0;
}

.message-bubble.other-message .message-text.has-reply.message-with-image .message-images {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  position: relative !important;
  min-height: 200px;
  z-index: 0;
}

.message-bubble.other-message .message-text.has-reply.message-with-image .message-images {
  overflow: hidden;
}

.message-bubble.other-message .message-text.has-reply.message-with-image .message-images::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(10px);
  z-index: 0;
  transform: scale(1.05);
}

.message-bubble.other-message .message-text.has-reply.message-with-image .message-images img {
  width: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 10px 0px 0px 0px !important;
  display: block;
  position: relative;
  z-index: 1;
}

.message-bubble.other-message .message-text.has-reply.message-with-image .message-text-content {
  background: #f1f3f4;
  color: var(--neutral-800);
  border-radius: 0 0 10px 10px;
  padding: 8px 14px;
  margin: 0;
}

.message-bubble.other-message .message-content.has-reply {
  border-radius: 0 0 10px 10px;
  margin-top: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-left: 0;
  margin-right: 0;
  min-width: 0;
}

/* ========================================
   REPLY PREVIEW STYLES
======================================== */

/* Container for reply preview and message content to ensure same width */
.message-reply-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.message-bubble.own-message .message-reply-container {
  margin-left: auto;
  margin-right: 0;
}

.message-bubble.other-message .message-reply-container {
  margin-right: 0;
}

.message-reply-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  flex-shrink: 0;
  margin: 0;
  margin-bottom: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.message-reply-preview.reply-preview-clickable {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.message-reply-preview.reply-preview-clickable:hover {
  filter: brightness(0.97);
}

.message-reply-preview.reply-preview-loading {
  opacity: 0.65;
  pointer-events: none;
}

.message-bubble.message-highlight {
  animation: message-highlight-pulse 2.2s ease-out;
  border-radius: 12px;
  transition: box-shadow 0.3s ease;
}

@keyframes message-highlight-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
  }
  15% {
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.35);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
  }
}

/* Reply preview - Other messages (same as own messages) */
.message-bubble.other-message .message-reply-preview {
  background: var(--neutral-300);
  border-radius: 0px 10px 0 0;
  color: var(--neutral-700);
  margin-left: 0;
  margin-right: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

/* Reply preview - Own messages */
.message-bubble.own-message .message-reply-preview {
  background: var(--neutral-300);
  border-radius: 10px 0px 0 0;
  margin-left: 0;
  margin-right: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

/* Reply preview chá»‰ cÃ³ áº£nh */
.message-reply-preview.reply-image-only {
  min-height: 60px;
}

.reply-preview-indicator {
  width: 3px;
  height: 100%;
  background: var(--primary-500);
  border-radius: 1px;
  flex-shrink: 0;
  min-height: 20px;
}

.reply-preview-image {
  width: 37px;
  height: 37px;
  object-fit: cover;
  border-radius: 0;
  flex-shrink: 0;
}

.reply-preview-content {
  flex: 1;
  min-width: 0;
  overflow: visible;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

.reply-preview-sender {
  font-weight: 500;
  font-size: 12px;
  color: var(--primary-600);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  max-width: 100%;
}

.reply-preview-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  font-size: 13px;
  color: var(--neutral-600);
  min-width: 0;
  flex: 1;
}

.message-reply-preview .reply-preview-content {
  flex: 1;
  min-width: 0;
}

/* ========================================
   3. TIN NHáº®N SYSTEM (SYSTEM MESSAGES)
======================================== */
.system-message {
  text-align: center;
  color: var(--neutral-500);
  font-size: 12px;
  margin: 8px 0;
  padding: 4px 0;
  width: 100%;
  max-width: 100%;
}

/* ========================================
   CONTEXT MENU STYLES
======================================== */
.message-context-menu {
  position: fixed;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10001;
  padding: 4px;
  min-width: 120px;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--neutral-800);
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.context-menu-item:hover {
  background: var(--neutral-100);
}

.context-menu-item svg {
  flex-shrink: 0;
}

.context-menu-item.reply-btn:hover {
  background: var(--primary-50);
}

/* ========================================
   ADDITIONAL HELPER STYLES
======================================== */
.message-content.image-only {
  padding: 0;
  width: 100%;
  max-width: 100%;
}

/* Message with image - Own messages */
.message-bubble.own-message .message-content.message-with-image {
  padding: 0;
  width: 100%;
  max-width: 100%;
}

/* Message with image - Other messages */
.message-bubble.other-message .message-content.message-with-image {
  padding: 0;
  width: 100%;
  max-width: 100%;
}

.message-with-image {
  padding: 0;
  background: transparent;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.message-with-image .message-text-content {
  width: 100% !important;
  max-width: 100% !important;
}

/* Temporary message styles */
.message-bubble.temporary-message {
  opacity: 1;
  transition: opacity 0.3s ease;
  visibility: visible !important;
  display: block !important;
}

.message-bubble.temporary-message .message-text,
.message-bubble.temporary-message .message-content {
  position: relative;
}

.message-bubble.temporary-message .message-text::after,
.message-bubble.temporary-message .message-content::after,
.message-bubble.temporary-message .message-text-content::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
  animation: shimmer 2.5s infinite;
  border-radius: inherit;
  pointer-events: none !important;
  z-index: 1;
  overflow: hidden;
}

/* Ensure shimmer works for all message content types */
.message-bubble.temporary-message .message-text,
.message-bubble.temporary-message .message-content,
.message-bubble.temporary-message .message-text-content {
  position: relative;
  overflow: hidden;
}

/* Shimmer for own messages */
.message-bubble.temporary-message.own-message .message-text::after,
.message-bubble.temporary-message.own-message .message-content::after {
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
}

/* Shimmer for other messages */
.message-bubble.temporary-message.other-message .message-text::after,
.message-bubble.temporary-message.other-message .message-content::after {
  background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.1) 50%, transparent 100%);
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Failed message styles */
.message-bubble.message-failed {
  opacity: 0.6;
  border: 1px solid var(--cinnabar-300);
}

.message-bubble.message-failed .message-text,
.message-bubble.message-failed .message-content {
  position: relative;
}

/* ========================================
   FROM: message-input.blade.php
   ======================================== */
/* ========================================
       MESSAGE INPUT CONTAINER
       ======================================== */
.message-input-container {
  padding: 0 16px; /* Optimized: no bottom padding */
  position: relative;
}

.message-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ========================================
       INPUT FIELD CONTAINER
       ======================================== */
.input-field-container {
  position: relative;
  display: flex;
  flex-direction: column;
}

.message-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--black-color01);
  border-radius: 16px;
  background: #fff;
  transition: all 0.2s ease;
}

.message-input {
  flex: 1;
  min-height: 24px;
  max-height: 120px;
  padding: 6px 8px;
  border: none !important;
  border-radius: 0 !important;
  font-size: 14px;
  line-height: 1.4;
  resize: none;
  outline: none !important;
  background: transparent;
  margin: 0;
  font-family: inherit;
}

.message-input::placeholder {
  color: var(--black-color4);
}

/* State-based border adjustments */
.input-field-container.has-reply-context .message-input-bar,
.input-field-container.has-image-preview .message-input-bar {
  border-radius: 0 0 16px 16px;
  border-top: none;
}

.input-field-container.has-reply-context.has-image-preview .reply-context {
  border-radius: 16px 16px 0 0;
}

.input-field-container.has-reply-context.has-image-preview .image-preview-container {
  border-radius: 0;
  border-top: none;
}

/* ========================================
       INPUT ACTIONS (Integrated)
       ======================================== */
.action-buttons {
  display: flex;
  gap: 4px;
  align-items: center;
  padding-bottom: 2px;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent !important;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--black-color1);
}

.action-btn:hover {
  background-color: var(--black-color01) !important;
  color: var(--black-color02) !important;
}

.send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent !important;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--black-color1);
  padding: 0;
  margin-bottom: 2px;
}

/* ========================================
       IMAGE PREVIEW
       ======================================== */
.image-preview-container {
  padding: 16px 16px 0px;
  border-radius: 16px 16px 0 0;
  border: 1px solid var(--black-color01);
  border-bottom: none;
}

.input-field-container.has-image-preview .image-preview-container {
  display: block;
}

.image-preview-wrapper {
  position: relative;
  display: inline-block;
}

.preview-image {
  width: 80px;
  height: 80px;
  border-radius: 4px;
  display: block;
  object-fit: cover;
}

.remove-image-btn {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--neutral-700);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  transition: all 0.2s ease;
}

.remove-image-btn:hover {
  background: var(--neutral-600);
  transform: scale(1.1);
}

/* ========================================
       REPLY CONTEXT
       ======================================== */
.reply-context {
  padding: 10px 14px;
  background: #f8f9fa;
  border-radius: 8px 8px 0 0;
  border: 1px solid #e9ecef;
  position: relative;
  z-index: 10;
  width: 100%;
  box-sizing: border-box;
}

/* Ensure reply-context is visible when has-reply-context class is added */
.input-field-container.has-reply-context .reply-context {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.reply-context-content {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.reply-context-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.reply-indicator {
  width: 2px;
  height: 40px;
  background: var(--primary-500);
  border-radius: 2px;
  flex-shrink: 0;
}

.reply-image-thumbnail {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #e9ecef;
}

.reply-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 4px;
}

.reply-sender {
  font-size: 12px;
  font-weight: 500;
  color: var(--primary-600);
  line-height: 1.4;
}

.reply-preview {
  font-size: 12px;
  color: var(--neutral-600);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  flex-wrap: wrap;
}

.reply-text-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--neutral-600);
  line-height: 1.32;
}

.reply-close-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--neutral-500);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.reply-close-btn:hover {
  background: var(--neutral-200);
  color: var(--neutral-700);
}

/* ========================================
       EMOJI PICKER CONTAINER
       ======================================== */
.emoji-picker-container {
  position: absolute;
  bottom: 100%;
  left: 0;
  z-index: 1000;
  width: 350px;
  transform: translateX(0);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid #e9ecef;
  border-radius: 12px;
}

.emoji-picker-container.position-below {
  bottom: auto;
  top: 100%;
  margin-top: 8px;
  margin-bottom: 0;
}

.emoji-picker-wrapper {
  background: white;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
}

.emoji-picker-content {
  padding: 8px;
}

/* ========================================
       MESSAGE IMAGE CONTENT
       ======================================== */
.message-image-content {
  min-width: 200px !important;
  max-width: 100% !important;
  max-height: 300px !important;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  background: transparent;
}

/* ========================================
       EMOJI PICKER CUSTOM PROPERTIES
       ======================================== */
emoji-picker {
  --border-radius: 8px;
  --border-color: transparent;
  --background: transparent;
  --input-border-radius: 8px;
  --input-padding: 8px 12px;
  --input-font-size: 14px;
  --input-font-color: #170f49;
  --input-color: #374151;
  --input-placeholder-color: #9ca3af;
  --input-border-size: 1px;
  --input-border-color: #e5e7eb;
  --input-line-height: 1.4;
  --category-emoji-padding: 4px;
  --category-emoji-size: 24px;
  --emoji-size: 24px;
  --emoji-hover-background: #f0f0f0;
  --emoji-selected-background: #e3f2fd;
  --indicator-color: var(--primary-500);
  --indicator-size: 3px;
  --num-columns: 8;
  --emoji-font-size: 16px;
  --category-font-size: 12px;
  --category-font-weight: 600;
  --category-font-color: var(--neutral-600);
  --search-no-results-color: var(--neutral-500);
  --search-no-results-font-size: 14px;
  --search-no-results-font-weight: 500;
}

/* ========================================
   FROM: inbox-search.blade.php
   ======================================== */
.inbox-search-container {
  width: 100%;
  margin-bottom: 16px;
}

.inbox-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 8px 12px;
  transition: all 0.2s ease;
}

.inbox-search-input-wrapper:focus-within {
  border-color: var(--primary-500, #007bff);
  background: white;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-icon {
  color: #6c757d;
  margin-right: 8px;
  flex-shrink: 0;
}

.inbox-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: #495057;
  padding: 0;
}

.inbox-search-input::placeholder {
  color: #adb5bd;
}

.clear-search-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #6c757d;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: 8px;
}

.clear-search-btn:hover {
  background: #e9ecef;
  color: #495057;
}

/* ========================================
   FROM: emoji-picker.blade.php
   ======================================== */
.emoji-picker-container {
  position: absolute;
  bottom: 100%;
  left: 0;
  z-index: 1000;
  width: 350px;
  transform: translateX(0);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid #e9ecef;
  border-radius: 12px;
}

.emoji-picker-container.position-below {
  bottom: auto;
  top: 100%;
  margin-top: 8px;
  margin-bottom: 0;
}

.emoji-picker-wrapper {
  background: white;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
}

.emoji-picker-content {
  padding: 8px;
}

.emoji-picker-content::-webkit-scrollbar {
  width: 6px;
}

.emoji-picker-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
  margin: 4px 0;
}

.emoji-picker-content::-webkit-scrollbar-thumb {
  border-radius: 3px;
  transition: all 0.2s ease;
  border: 1px solid #f1f1f1;
}

.emoji-picker-content::-webkit-scrollbar-thumb:hover {
  transform: scaleX(1.2);
}

.emoji-picker-content {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 transparent;
}

.emoji-picker-container {
  pointer-events: auto;
}

.emoji-picker-container[style*='display: none'] {
  pointer-events: none;
}

emoji-picker {
  --border-radius: 8px;
  --border-color: transparent;
  --background: transparent;
  --input-border-radius: 8px;
  --input-padding: 8px 12px;
  --input-font-size: 14px;
  --input-font-color: #170f49;
  --input-color: #374151;
  --input-placeholder-color: #9ca3af;
  --input-border-size: 1px;
  --input-border-color: #e5e7eb;
  --input-line-height: 1.4;
  --category-emoji-padding: 4px;
  --category-emoji-size: 24px;
  --emoji-size: 24px;
  --emoji-hover-background: #f0f0f0;
  --emoji-selected-background: #e3f2fd;
  --indicator-color: var(--primary-500);
  --indicator-size: 3px;
  --num-columns: 8;
  --emoji-font-size: 16px;
  --category-font-size: 12px;
  --category-font-weight: 600;
  --category-font-color: var(--neutral-600);
  --search-no-results-color: var(--neutral-500);
  --search-no-results-font-size: 14px;
  --search-no-results-font-weight: 500;
}

emoji-picker .emoji {
  transition: all 0.2s ease;
}

emoji-picker .emoji:hover {
  background-color: #f0f0f0 !important;
  border-radius: 4px;
  transform: scale(1.1);
}

emoji-picker .emoji:active {
  background-color: #e3f2fd !important;
  transform: scale(1.05);
}

emoji-picker input[type='text'] {
  color: #374151 !important;
}

.dark emoji-picker input[type='text'] {
  color: #e2e8f0 !important;
}

emoji-picker input[type='text']::placeholder {
  color: #9ca3af !important;
}

.dark emoji-picker input[type='text']::placeholder {
  color: #a0aec0 !important;
}

.dark emoji-picker {
  --emoji-hover-background: #4a5568;
  --emoji-selected-background: #2b6cb0;
  --input-color: #e2e8f0;
  --input-font-color: #e2e8f0;
  --input-placeholder-color: #a0aec0;
  --input-border-color: #4a5568;
  --background: #2d3748;
  --border-color: #4a5568;
}

.dark emoji-picker .emoji:hover {
  background-color: #4a5568 !important;
  border-radius: 4px;
  transform: scale(1.1);
}

.dark emoji-picker .emoji:active {
  background-color: #2b6cb0 !important;
  transform: scale(1.05);
}

emoji-picker .category {
  display: block !important;
}

@media (max-width: 480px) {
  .emoji-picker-container {
    left: 8px;
    right: 8px;
    width: auto;
    max-width: calc(100vw - 16px);
  }

  .emoji-picker-wrapper {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .emoji-picker-container {
    left: 8px;
    right: 8px;
    width: calc(100vw - 16px);
  }
}

@media (max-height: 600px) {
  .emoji-picker-container {
    max-height: 250px;
  }

  .emoji-picker-content {
    max-height: 200px;
  }
}

.emoji-picker-container.position-below {
  bottom: auto;
  top: 100%;
  margin-top: 8px;
  margin-bottom: 0;
}

/* Animation for smooth positioning */
.emoji-picker-container {
  transition: all 0.2s ease;
}

/* Ensure emoji picker doesn't interfere with chat content */
.emoji-picker-container {
  pointer-events: auto;
}

.emoji-picker-container[style*='display: none'] {
  pointer-events: none;
}

/* Ensure emoji picker is properly positioned relative to input */
.input-actions {
  position: relative;
}

/* Ensure emoji picker is positioned on the left side */
.emoji-picker-container {
  left: 0;
  right: auto;
  min-width: 300px;
}

/* ========================================
   FROM: chat-image-handler.blade.php
   ======================================== */

.chat-image-clickable {
  cursor: pointer;
}

/* ========================================
   FROM: image-modal.blade.php
   ======================================== */

.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  pointer-events: none;
}

.image-modal[style*='display: flex'] {
  pointer-events: all;
}

.image-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(24, 24, 24, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.image-modal-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: transparent;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.image-modal-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  padding: 20px;
}

.image-modal-close,
.image-modal-download {
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.image-modal-close:hover,
.image-modal-download:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.image-modal-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 120px);
  padding: 20px;
}

.image-modal-content {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image {
  max-width: 100%;
  max-height: calc(100vh - 200px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.image-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.image-modal-prev {
  left: 20px;
}

.image-modal-next {
  right: 20px;
}

.image-modal-thumbnails {
  display: flex;
  gap: 11px;
  overflow-y: hidden;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 rgba(255, 255, 255, 0.3);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  align-items: center;
  padding: 20px;
  padding-left: 80px;
  padding-right: 80px;
  min-height: 160px;
  max-height: 180px;
}

.image-modal-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.image-modal-thumbnails::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.image-modal-thumbnails::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 3px;
}

.image-modal-thumbnails::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.7);
}

.thumbnail-item {
  flex-shrink: 0;
  width: 174px;
  height: 120px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.thumbnail-item.active {
  border: 1px solid #fff;
  padding: 4px;
  width: 182px;
  height: 128px;
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

/* Responsive design */
@media (max-width: 768px) {
  .image-modal-container {
    width: 100vw;
    height: 100vh;
  }

  .image-modal-header {
    padding: 15px;
  }

  .image-modal-close,
  .image-modal-download {
    width: 40px;
    height: 40px;
  }

  .image-modal-nav {
    width: 40px;
    height: 40px;
  }

  .image-modal-prev {
    left: 10px;
  }

  .image-modal-next {
    right: 10px;
  }

  .thumbnail-item {
    width: 60px;
    height: 60px;
  }

  .modal-image {
    max-height: calc(100vh - 160px);
  }
}

/* Animation */
.image-modal {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-image {
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Loading styles */
.image-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
}

.loading-spinner .image-loading {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.loading-text .image-loading {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* ========================================
   FROM: conversation-list.blade.php
   ======================================== */

.inbox-conversation-list {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.conversation-list-content {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 transparent;
}

.conversation-list-content::-webkit-scrollbar {
  width: 6px;
}

.conversation-list-content::-webkit-scrollbar-track {
  background: transparent;
}

.conversation-list-content::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}

.conversation-list-content::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

.conversation-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  height: 100%;
  color: #6c757d;
}

.dark .inbox-conversation-card.highlighted {
  background-color: #1a237e !important;
  box-shadow: 0 4px 12px rgba(100, 181, 246, 0.3);
}

/* ========================================
       UNREAD BADGE
       ======================================== */
.unread-badge {
  background: var(--secondary-indigo);
  color: white;
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 12px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.6;
}

/* ========================================
   FROM: index.blade.php (END BLOCK)
   ======================================== */

.top-loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px 20px;
  gap: 12px;
  color: #6c757d;
  font-size: 14px;
  margin: 15px auto;
  position: sticky;
  top: 10px;
  z-index: 10;
  width: fit-content;
  max-width: 100%;
}

.top-loading-indicator .loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e9ecef;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.top-loading-indicator .loading-text {
  font-size: 14px;
  color: #6c757d;
  font-weight: 500;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Message sent animation */
.message-bubble.message-sent {
  animation: messageSent 0.3s ease-out;
}

@keyframes messageSent {
  0% {
    transform: scale(0.95);
    opacity: 0.7;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.emoji-picker-container[style*='display: none'] {
  display: none !important;
  pointer-events: none !important;
}

/* ========================================
   MOBILE RESPONSIVE INBOX
   ======================================== */
@media (max-width: 768px) {
  .inbox-page-container {
    padding: 0 !important;
  }

  .inbox-content .col-3,
  .inbox-content .col-9 {
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* When list is active on mobile, hide the chat panel */
  .inbox-list-active .col-9 {
    display: none !important;
  }
  .inbox-list-active .col-3 {
    display: flex !important;
  }

  /* When chat is active on mobile, hide the list */
  .inbox-chat-active .col-3 {
    display: none !important;
  }
  .inbox-chat-active .col-9 {
    display: flex !important;
  }

  /* Remove border on chat panel for full-screen mobile feel */
  .unified-chat-panel {
    border: none !important;
    border-radius: 0 !important;
  }

  .chat-header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
  }

  .chat-header-notice {
    flex: 1 1 100%;
    max-width: none;
    margin-left: 0;
    text-align: left;
    padding-top: 8px;
    border-top: 1px solid var(--black-color01);
  }

  .chat-header-notice-title {
    font-size: 11px;
  }

  .chat-header-notice-desc {
    font-size: 10px;
  }

  .chat-header-notice-content h1,
  .chat-header-notice-content h2,
  .chat-header-notice-content h3,
  .chat-header-notice-content h4,
  .chat-header-notice-content h5,
  .chat-header-notice-content h6 {
    font-size: 12px;
  }

  .chat-header-notice-content p {
    font-size: 11px;
  }

  .chat-header-notice-desc-last {
    white-space: normal;
  }
}

/* ========================================
   QUILL RICH TEXT STYLES (For Shortcuts)
   ======================================== */
.ql-editor {
  padding: 0 !important;
  height: auto !important;
  overflow-y: visible !important;
}

.ql-editor p {
  margin: 0;
  padding: 0;
}

.ql-editor .ql-align-center {
  text-align: center;
}

.ql-editor .ql-align-right {
  text-align: right;
}

.ql-editor .ql-align-justify {
  text-align: justify;
}

.ql-editor img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 8px auto;
}

/* Ensure images in centered blocks are also centered */
.ql-align-center img {
  margin-left: auto !important;
  margin-right: auto !important;
}

.ql-align-right img {
  margin-left: auto !important;
  margin-right: 0 !important;
}
