/* ═══════════════════════════════════════════════════════════
   CHAT THREAD — messages.css
   Base styles for .im-container. The .gv-chat-outer scope
   in gv.css layers additional overrides for the application
   context (heights, backgrounds, etc.).
═══════════════════════════════════════════════════════════ */

/* ── Core wrapper ── */
.im-container {
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}
.im-container .im-rhs {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Scroll area ── */
.im-container .im-rhs .im-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}
.im-container .im-rhs .im-messages #im-scroller {
  overflow-y: auto;
  padding: 20px 20px 6px;
  max-height: 460px;
  scroll-behavior: smooth;
}

/* ── Date divider ── */
.im-container .text-center.my-4 {
  margin-top: 18px !important;
  margin-bottom: 10px !important;
}
.im-container .text-center.my-4 span {
  display: inline-block;
  background: #f0f2f5 !important;
  color: #bbb !important;
  font-size: 11px !important;
  letter-spacing: .04em;
  padding: 4px 14px !important;
  border-radius: 20px !important;
  border: none !important;
  font-style: normal !important;
}

/* ── Message row ── */
.im-container .im-message {
  margin-bottom: 2px;
  padding: 0;
  text-align: left;
  position: relative;
}
.im-container .im-message.sent { text-align: right; }

/* ── Bubble ── */
.im-container .im-message .im-message-content {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 18px;
  border-bottom-left-radius: 5px;
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
  max-width: 66%;
  min-width: 60px;
  text-align: left;
  background: #fff;
  border: 1px solid #ebebeb;
  /* box-shadow: 0 1px 3px rgba(0,0,0,.05); */
  color: #1a1a1a;
}
.im-container .im-message.sent .im-message-content {
  background: var(--pry-color, #09415c);
  color: #fff;
  border: none;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 5px;
  /* box-shadow: 0 2px 8px rgba(9,65,92,.18); */
  margin-left: auto;
}

/* deleted / removed */
.im-container .im-message .im-message-content.text-secondary {
  background: #f5f5f5 !important;
  color: #c0c0c0 !important;
  border: 1px solid #eeeeee !important;
  font-style: italic;
  box-shadow: none;
}

/* ── Sender / time row ── */
.im-container .im-message .im-message-sender {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
  position: relative;
}
.im-container .im-message.sent .im-message-sender {
  justify-content: flex-end;
}
.im-container .im-message .im-message-sender small {
  font-size: 11px;
  color: #c0c0c0;
  letter-spacing: .02em;
  text-transform: none !important;
}
.im-container .im-message .im-message-sender .text-secondary {
  font-size: 12px;
  color: #999;
  font-style: normal;
}
.im-container .im-message .im-message-sender .unread-message {
  margin-bottom: -5px;
  margin-top: -5px;
}

/* ── Avatar ── */
.circle-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #09415c, #287ea7);
  color: #fff;
  font-size: 12px;
  font-family: 'SofiaMedium', sans-serif;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.circle-icon.op {
  opacity: 0;
  height: 10px;
  overflow: hidden;
}

/* ── Input bar ── */
.im-container .im-rhs .im-input {
  padding: 12px 16px 14px;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.msg-input {
  background: #f5f6f8;
  border: 1.5px solid transparent;
  border-radius: 26px;
  padding: 7px 8px 7px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.msg-input:focus-within {
  border-color: var(--pry-color, #09415c);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(9,65,92,.06);
}
.msg-input textarea,
.msg-input textarea:focus {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  resize: none;
  font-size: 14px;
  min-height: 22px;
  max-height: 120px;
  line-height: 1.5;
  padding: 3px 0;
  color: #111;
  font-family: inherit;
}
.msg-input textarea::placeholder { color: #c0c0c0; }

/* send button */
.btn-input,
.btn-input:hover,
.btn-input:focus {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: var(--pry-color, #09415c);
  color: #fff;
  border: none;
  display: grid;
  place-items: center;
  font-size: 13px;
  flex-shrink: 0;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.btn-input:hover { background: #072e42; transform: scale(1.06); }
.btn-input i { margin-left: -1px; }

/* action buttons (video, attach) */
.fabs {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.fabs .btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #f0f2f5;
  color: #777;
  border: none;
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: background .15s, color .15s;
  margin: 0 !important;
  padding: 0 !important;
}
.fabs .btn:hover { background: #e4e6eb; color: #333; }

/* selected file chips */
.im-container .im-rhs .im-input #selected-files .selected-file {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #eef1f5;
  border: 1px solid #dde1e8;
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  margin-top: 6px;
  margin-right: 5px;
  font-size: 12px;
  color: #555;
  transition: background .15s;
  position: relative;
}
.im-container .im-rhs .im-input #selected-files .selected-file:hover {
  background: #fce8e8;
  color: #c00;
  border-color: #f5c6c6;
}
.im-container .im-rhs .im-input #selected-files .selected-file::after {
  content: '✕';
  font-size: 10px;
  color: currentColor;
  margin-left: 2px;
}

/* ── Video ── */
.im-container .im-rhs .im-video-container {
  max-width: 340px;
  display: inline-block;
  margin-top: 4px;
}
.im-container .im-rhs .im-video-container video {
  max-width: 100%;
  border-radius: 14px;
  display: block;
}

/* ── Hover actions (edit / delete) ── */
.im-container .hidden { display: none; }
.im-container .im-message .delete,
.im-container .im-message .edit {
  position: absolute;
  right: -14px;
  top: 0;
}
.im-container .im-message .edit { right: -9px; top: 3px; }
.im-container .im-message:hover .edit,
.im-container .im-message:hover .delete { display: block; }

.im-container .im-message.sent .header-item  { margin-left: .75rem; }
.im-container .im-message.received .header-item { margin-right: .75rem; }

/* ── Attachment row ── */
.attachments-container span.text-primary {
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ── Pagination ── */
.im-container .px-3.pb-2 .pagination {
  font-size: 12px;
  justify-content: center;
  margin: 0;
}

/* ── Empty state ── */
.im-container .py-5.text-center {
  padding: 60px 20px !important;
}
.im-container .py-5.text-center h3 {
  font-size: 40px;
  opacity: .15;
  margin-bottom: 10px !important;
  color: #09415c;
}
.im-container .py-5.text-center p {
  font-size: 14px;
  color: #ccc !important;
}
