/* ============================================
   MURAL DE RECADOS — CHAT
   ============================================ */

/* Sino no header */
.mural-bell-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: #5b3aab;
  font-size: 18px;
  padding: 4px 6px;
  border-radius: 8px;
  transition: background 0.15s;
  display: flex;
  align-items: center;
}
.mural-bell-btn:hover { background: #ede9f7; }
.mural-bell-btn.has-unread {
  animation: muralBellRing 1.4s ease infinite;
  transform-origin: top center;
  color: #dc2626;
}
.mural-bell-btn.tem-nao-lidos { color: #dc2626; }
@keyframes muralBellRing {
  0%,100% { transform: rotate(0); }
  10%     { transform: rotate(18deg); }
  20%     { transform: rotate(-16deg); }
  30%     { transform: rotate(12deg); }
  40%     { transform: rotate(-10deg); }
  50%     { transform: rotate(6deg); }
  60%     { transform: rotate(-4deg); }
  70%     { transform: rotate(2deg); }
  80%     { transform: rotate(0); }
}
.mural-badge {
  position: absolute;
  top: -2px; right: -4px;
  background: #dc2626;
  color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

/* Overlay */
.mural-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 1100;
}

/* Painel principal — duas colunas */
.mural-panel {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 1000px; max-width: 96vw;
  height: 75vh; min-height: 560px;
  background: #f4f2fb;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  z-index: 1101;
  display: flex;
  animation: muralFadeIn 0.2s ease;
  overflow: hidden;
}
@keyframes muralFadeIn {
  from { opacity: 0; transform: translate(-50%, -48%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* ---- Sidebar (lista de conversas) ---- */
.mural-sidebar {
  width: 320px;
  min-width: 280px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e8e0f7;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mural-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 12px;
  background: linear-gradient(135deg, #5b3aab, #7c5bbf);
  color: #fff;
  flex-shrink: 0;
}
.mural-title {
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 7px;
}
.mural-close-btn {
  background: rgba(255,255,255,0.15);
  border: none; color: #fff; cursor: pointer;
  width: 26px; height: 26px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s; flex-shrink: 0;
}
.mural-close-btn:hover { background: rgba(255,255,255,0.3); }

.mural-search-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #f0ecfb;
  flex-shrink: 0;
  background: #faf8ff;
}
.mural-search-bar i { color: #a78bde; font-size: 13px; }
.mural-search-bar input {
  border: none; outline: none;
  font-size: 13px; color: #2d1a6b;
  width: 100%; background: transparent;
  padding: 2px 0;
}
.mural-search-bar input::placeholder { color: #bbb; }

.mural-filter-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #ede9f7;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.mural-filter-tabs::-webkit-scrollbar { display: none; }
.mural-tab {
  flex: 1;
  background: none; border: none;
  padding: 7px 4px;
  font-size: 10px; font-weight: 600;
  color: #9ca3af; cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.mural-tab:hover { color: #5b3aab; }
.mural-tab.active { color: #5b3aab; border-bottom-color: #5b3aab; }

.mural-conv-list {
  flex: 1; overflow-y: auto;
  padding: 4px 0;
}
.mural-conv-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}
.mural-conv-item:hover { background: #f5f3fd; }
.mural-conv-item.active { background: #ede9f7; }
.mural-conv-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #5b3aab, #7c5bbf);
  color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.mural-conv-avatar .mural-fav-star {
  position: absolute; top: -3px; right: -3px;
  font-size: 10px; color: #f59e0b;
}
.mural-conv-body { flex: 1; min-width: 0; }
.mural-conv-nome {
  font-size: 12px; font-weight: 700; color: #2d1a6b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mural-conv-preview {
  font-size: 11px; color: #9ca3af;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mural-conv-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
  flex-shrink: 0;
}
.mural-conv-hora { font-size: 10px; color: #bbb; }
.mural-conv-badge {
  background: #5b3aab; color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}
.mural-conv-item.arquivada { opacity: 0.55; }

.mural-nova-btn {
  margin: 10px 12px;
  background: linear-gradient(135deg, #5b3aab, #7c5bbf);
  color: #fff; border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 12px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: opacity 0.15s; flex-shrink: 0;
}
.mural-nova-btn:hover { opacity: 0.88; }

/* ---- Área de chat ---- */
.mural-chat {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  background: #f8f5ff;
  position: relative;
}
.mural-chat-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; color: #bbb;
}
.mural-chat-empty i { font-size: 48px; opacity: 0.3; }
.mural-chat-empty span { font-size: 13px; }

.mural-chat-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #ede9f7;
  flex-shrink: 0;
}
.mural-chat-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #5b3aab, #7c5bbf);
  color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mural-chat-info { flex: 1; min-width: 0; }
.mural-chat-nome { display: block; font-size: 14px; font-weight: 700; color: #2d1a6b; }
.mural-chat-esp  { display: block; font-size: 11px; color: #7c5bbf; }
.mural-chat-header-actions { display: flex; gap: 6px; }
.mural-icon-btn {
  background: none; border: 1px solid #e5e7eb;
  border-radius: 7px; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #6b7280; font-size: 13px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.mural-icon-btn:hover { background: #f3f4f6; }
.mural-icon-btn.ativo { color: #f59e0b; border-color: #f59e0b; }
.mural-icon-btn.ativo-arq { color: #5b3aab; border-color: #5b3aab; background: #ede9f7; }

/* Mensagens */
.mural-messages {
  flex: 1; overflow-y: auto;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.mural-msg-grupo-data {
  text-align: center; font-size: 10px; color: #bbb;
  margin: 6px 0; display: flex; align-items: center; gap: 8px;
}
.mural-msg-grupo-data::before,
.mural-msg-grupo-data::after {
  content: ''; flex: 1; height: 1px; background: #e5e7eb;
}
.mural-bubble-wrap {
  display: flex; flex-direction: column;
}
.mural-bubble-wrap.eu { align-items: flex-end; }
.mural-bubble-wrap.deles { align-items: flex-start; }
.mural-bubble {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px; line-height: 1.45;
  word-break: break-word; white-space: pre-wrap;
  position: relative;
}
.mural-bubble-wrap.eu .mural-bubble {
  background: linear-gradient(135deg, #2563EB, #1d4ed8); color: #fff;
  border-bottom-right-radius: 4px;
}
.mural-bubble-wrap.deles .mural-bubble {
  background: linear-gradient(135deg, #5b3aab, #7c5bbf); color: #fff;
  border-bottom-left-radius: 4px;
}
.mural-bubble-footer {
  display: flex; align-items: center; gap: 6px;
  margin-top: 3px;
}
.mural-bubble-hora { font-size: 10px; color: #9ca3af; }
.mural-bubble-lido { font-size: 10px; color: #5b3aab; }
.mural-bubble-wrap.eu .mural-bubble-footer { justify-content: flex-end; }
.mural-bubble-del {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.5); font-size: 11px;
  padding: 0; opacity: 0;
  transition: opacity 0.15s;
}
.mural-bubble-wrap:hover .mural-bubble-del { opacity: 1; }
.mural-bubble-del:hover { color: #fca5a5; }
.mural-bubble-marcar {
  background: none; border: none; cursor: pointer;
  color: #bbb; font-size: 11px; padding: 0;
  opacity: 0; transition: opacity 0.15s;
}
.mural-bubble-wrap:hover .mural-bubble-marcar { opacity: 1; }
.mural-bubble-marcar:hover { color: #5b3aab; }

.mural-loading { text-align: center; color: #bbb; font-size: 13px; padding: 24px 0; }
.mural-empty-chat { text-align: center; color: #bbb; font-size: 13px; padding: 32px 0; }

/* Compose dentro do chat */
.mural-compose-chat {
  background: #fff;
  border-top: 1px solid #ede9f7;
  padding: 10px 14px;
  flex-shrink: 0;
  position: relative;
}
.mural-compose-textarea {
  width: 100%; border: 1px solid #c4b5e8;
  border-radius: 10px; padding: 8px 11px;
  font-size: 13px; font-family: inherit;
  outline: none; resize: none; color: #2d1a6b;
  background: #faf8ff;
  transition: border-color 0.15s;
}
.mural-compose-textarea:focus {
  border-color: #5b3aab;
  box-shadow: 0 0 0 2px rgba(91,58,171,0.1);
}
.mural-compose-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 7px; gap: 6px;
}
.mural-compose-tools {
  display: flex; gap: 4px; align-items: center;
}
.mural-tool-btn {
  background: none; border: none; cursor: pointer;
  font-size: 16px; padding: 3px 5px; border-radius: 6px;
  color: #7c5bbf; display: flex; align-items: center;
  transition: background 0.12s;
}
.mural-tool-btn:hover { background: #ede9f7; }

/* Preview imagem */
.mural-img-preview {
  position: relative; display: inline-block;
  margin-bottom: 8px;
  border-radius: 10px; overflow: hidden;
  border: 2px solid #c4b5e8;
  max-width: 200px;
}
.mural-img-preview img {
  display: block; max-width: 200px; max-height: 140px;
  object-fit: contain;
}
.mural-img-remover {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,0.55); border: none; color: #fff;
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* Imagem no balão */
.mural-bubble-img {
  display: block; max-width: 260px; max-height: 200px;
  border-radius: 8px; object-fit: contain; cursor: pointer;
  margin-top: 4px;
}
.mural-bubble-text { white-space: pre-wrap; word-break: break-word; }
.mural-bubble-download {
  position: absolute; bottom: 6px; right: 6px;
  background: rgba(0,0,0,0.6); color: #fff; width: 26px; height: 26px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; text-decoration: none; opacity: 0; transition: opacity 0.15s;
}
.mural-bubble-wrap:hover .mural-bubble-download { opacity: 1; }
.mural-bubble-download:hover { background: rgba(0,0,0,0.85); color: #fff; }
.mural-bubble-arquivo {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
  background: rgba(255,255,255,0.18); padding: 8px 12px; border-radius: 8px;
  color: inherit; text-decoration: none; font-size: 12px; max-width: 240px;
  width: fit-content;
}
.mural-bubble-arquivo:hover { background: rgba(255,255,255,0.28); }
.mural-bubble-arquivo span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mural-arq-label {
  background: #eff6ff; padding: 8px 12px; border-radius: 8px;
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: #1e3a5f;
  border: 1px dashed #2563EB; max-width: 200px;
}
.mural-arq-label i { color: #2563EB; }

/* Lightbox */
.mural-lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 3000;
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.mural-lightbox img {
  max-width: 90vw; max-height: 90vh;
  border-radius: 10px; box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

/* Emoji picker */
.mural-emoji-picker {
  position: absolute; bottom: calc(100% + 6px); left: 0;
  background: #fff; border: 1px solid #c4b5e8;
  border-radius: 12px; padding: 10px 8px;
  box-shadow: 0 6px 24px rgba(91,58,171,0.18);
  z-index: 50;
  display: flex; flex-wrap: wrap; gap: 2px;
  width: 280px; max-height: 200px; overflow-y: auto;
}
.mural-emoji-picker span {
  font-size: 20px; cursor: pointer; padding: 3px 4px;
  border-radius: 6px; transition: background 0.1s;
  line-height: 1;
}
.mural-emoji-picker span:hover { background: #ede9f7; }

.mural-char-count { font-size: 11px; color: #bbb; }
.mural-send-btn {
  background: linear-gradient(135deg, #5b3aab, #7c5bbf);
  color: #fff; border: none; border-radius: 8px;
  padding: 7px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: opacity 0.15s;
}
.mural-send-btn:hover { opacity: 0.88; }
.mural-send-btn:disabled { opacity: 0.5; cursor: default; }

/* ---- Painel nova mensagem ---- */
.mural-nova-panel {
  position: absolute; inset: 0;
  background: #fff;
  z-index: 10;
  display: flex; flex-direction: column;
  animation: muralSlideIn 0.18s ease;
}
.mural-nova-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #5b3aab, #7c5bbf);
  color: #fff; font-size: 14px; font-weight: 700;
  flex-shrink: 0;
}
.mural-nova-body {
  flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto;
}
.mural-nova-actions {
  display: flex; align-items: center; justify-content: space-between;
}

/* Select com dropdown */
.mural-select-wrap { position: relative; }
.mural-input {
  width: 100%; padding: 8px 11px;
  border: 1px solid #c4b5e8; border-radius: 8px;
  font-size: 13px; outline: none; background: #fff; color: #2d1a6b;
  transition: border-color 0.15s;
}
.mural-input:focus { border-color: #5b3aab; box-shadow: 0 0 0 2px rgba(91,58,171,0.1); }
.mural-input.selected { background: #ede9f7; font-weight: 600; }
.mural-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid #c4b5e8;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(91,58,171,0.15);
  z-index: 200; max-height: 220px; overflow-y: auto;
}
.mural-dropdown-item {
  padding: 9px 12px; cursor: pointer;
  display: flex; flex-direction: column; gap: 1px;
  border-bottom: 1px solid #f3f0fb; transition: background 0.1s;
}
.mural-dropdown-item:last-child { border-bottom: none; }
.mural-dropdown-item:hover { background: #f0ecf7; }
.mural-dropdown-item-name { font-size: 13px; font-weight: 600; color: #2d1a6b; }
.mural-dropdown-item-esp  { font-size: 11px; color: #7c5bbf; }

/* Toast */
.mural-toast {
  position: fixed; bottom: 24px; right: 24px;
  background: linear-gradient(135deg, #5b3aab, #7c5bbf);
  color: #fff; border-radius: 12px;
  padding: 12px 16px; font-size: 13px;
  box-shadow: 0 4px 20px rgba(91,58,171,0.35);
  z-index: 2000;
  display: flex; align-items: center; gap: 10px;
  max-width: 300px; cursor: pointer;
  animation: muralToastIn 0.25s ease;
}
@keyframes muralToastIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.mural-toast.out { animation: muralToastOut 0.25s ease forwards; }
@keyframes muralToastOut { to { transform: translateY(20px); opacity: 0; } }
.mural-toast-text { flex: 1; min-width: 0; }
.mural-toast-title { font-weight: 700; font-size: 12px; margin-bottom: 2px; }
.mural-toast-msg { font-size: 12px; opacity: 0.9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 600px) {
  .mural-panel { width: 100vw; }
  .mural-sidebar { width: 200px; min-width: 160px; }
}
