/* ARUN Shared Messenger Component Stylesheet */

/* Floating Messenger Dialog Modal */
.communications-modal, #communications-modal, #message-modal {
  width: min(90vw, 720px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgb(15 23 42 / 30%);
  overflow: hidden;
}

.communications-modal::backdrop, #communications-modal::backdrop, #message-modal::backdrop {
  background: rgb(15 23 42 / 45%);
  backdrop-filter: blur(2px);
}

.communications-modal header, #communications-modal header, #message-modal header {
  display: flex;
  height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid #dbe2ea;
  background: #fff;
}
.communications-modal header h2, #communications-modal header h2, #message-modal header h2 {
  margin: 0;
  color: #172033;
  font-size: 14px;
  letter-spacing: -.2px;
}
.communications-modal header h2 .modal-channel-name,
#communications-modal header h2 .modal-channel-name,
#message-modal header h2 .modal-channel-name {
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}

.modal-channel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid #dbe2ea;
  background: #f8fafc;
}
.modal-channel-tabs .channel-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: 1px solid #dbe2ea;
  border-radius: 99px;
  background: #fff;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.modal-channel-tabs .channel-tab:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}
.modal-channel-tabs .channel-tab.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}
.modal-channel-tabs .channel-tab-unread {
  display: inline-flex;
  min-width: 15px;
  height: 15px;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border-radius: 99px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}
.modal-channel-tabs .channel-tab.active .channel-tab-unread {
  background: rgb(255 255 255 / 30%);
}
.communications-modal header button, #communications-modal header button, #message-modal header button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #64748b;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.communications-modal header button:hover, #communications-modal header button:hover, #message-modal header button:hover {
  color: #0f172a;
  background: #eef2f7;
}

.modal-messenger form[data-modal-composer] {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #dbe2ea;
  background: #fff;
}
.modal-messenger form[data-modal-composer] textarea {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  font: inherit;
  font-size: 12px;
  resize: none;
}
.modal-messenger form[data-modal-composer] textarea:disabled {
  background: #f8fafc;
  color: #94a3b8;
}
.modal-messenger form[data-modal-composer] button[type="submit"] {
  display: grid;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  border: 0;
  border-radius: 50%;
  background: #2563eb;
  cursor: pointer;
}
.modal-messenger form[data-modal-composer] button[type="submit"] svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.modal-messenger form[data-modal-composer] button[type="submit"]:hover:not(:disabled) {
  background: #1d4ed8;
}
.modal-messenger form[data-modal-composer] button[type="submit"]:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.modal-message-container, [data-modal-messages], .message-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 380px;
  padding: 16px;
  overflow-y: auto;
  background: #f8fafc;
}

.modal-message, .portal-message {
  display: flex;
  gap: 10px;
  max-width: 85%;
  align-self: flex-start;
}

.modal-message.mine, .portal-message.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
  font-weight: 750;
  flex-shrink: 0;
}

.modal-message > div, .portal-message > div {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--message-border, #cbd5e1);
  background: var(--message-bg, #fff);
  box-shadow: 0 1px 3px rgb(15 23 42 / 4%);
}

.modal-message.mine > div, .portal-message.mine > div {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.modal-message small, .portal-message small {
  display: block;
  margin-bottom: 2px;
  font-size: 10px;
  font-weight: 700;
  color: var(--message-accent, #64748b);
}

.modal-message.mine small, .portal-message.mine small {
  color: #bfdbfe;
}

.modal-message p, .portal-message p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.modal-message footer, .portal-message footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.modal-message time, .portal-message time {
  font-size: 9px;
  color: #94a3b8;
}

.modal-message.mine time, .portal-message.mine time {
  color: #93c5fd;
}

.mention-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  background: #dbeafe;
  color: #1e40af;
  font-weight: 700;
  font-size: 11px;
}

.message-approve {
  padding: 2px 8px;
  border: 0;
  border-radius: 4px;
  background: #166534;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.message-approved {
  color: #166534;
  font-size: 10px;
  font-weight: 700;
}

.modal-empty {
  display: grid;
  place-items: center;
  height: 100%;
  margin: 0;
  color: #64748b;
  font-size: 12px;
}

/* Inline dashboard message list (opt-in via ArunMessenger.init listId) */
.full-row-card {
  grid-column: 1/-1;
}
.message-card-icon {
  display: grid;
  place-items: center;
  color: #2563eb;
}
.message-card-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Matched 1:1 to webdrive_django/static/styles.css .dashboard-message-list / .dashboard-message-item / .request-message / .request-user (webdrive is the reference) */
.dashboard-message-list {
  margin-top: 10px;
  border-top: 1px solid var(--line, #dfe3e8);
}
.dashboard-message-list > .muted {
  margin: 5px 0;
}
.dashboard-message-item {
  display: grid;
  width: 100%;
  min-height: 36px;
  grid-template-columns: 90px minmax(0, 1fr) 55px;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  color: #334155;
  border: 0;
  border-bottom: 1px solid var(--line, #dfe3e8);
  border-radius: 0;
  background: transparent;
  text-align: left;
}
.dashboard-message-item:hover {
  background: #f8fafc;
}
.dashboard-message-sender {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-message-body {
  overflow: hidden;
  padding: 3px 0;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-message-channel {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 99px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 9px;
  font-weight: 800;
  font-style: normal;
  vertical-align: middle;
}
.dashboard-message-item time {
  flex: 0 0 auto;
  color: #94a3b8;
  font-size: 9px;
}