/* =====================================================
   MONDO SENZA TEMPO — CSS Chat Condiviso  v1.0
   Usato da: dashboard.html, operatore-panel.html, admin.html
   Classi generate da js/chat.js → CHAT.renderMessaggi()
   ===================================================== */

/* ── Contenitore vuoto ──────────────────────────── */
.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: rgba(168, 156, 200, 0.6);
  text-align: center;
  flex: 1;
  min-height: 160px;
}
.chat-empty i {
  font-size: 2.2rem;
  margin-bottom: 12px;
  opacity: 0.4;
  display: block;
}
.chat-empty p {
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 0;
}

/* ── Messaggio singolo ──────────────────────────── */
.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 78%;
  animation: chatMsgIn 0.22s ease-out;
}
@keyframes chatMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Allineamento sinistra/destra */
.chat-msg-sx {
  align-self: flex-start;
  align-items: flex-start;
}
.chat-msg-dx {
  align-self: flex-end;
  align-items: flex-end;
}

/* Messaggio eliminato: opacità ridotta */
.chat-msg-del {
  opacity: 0.55;
}

/* ── Etichetta mittente (solo admin) ─────────────── */
.chat-msg-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 3px;
  padding: 0 4px;
}
.chat-msg-label.cartomante {
  color: #c9a84c;
}
.chat-msg-label.utente {
  color: #60a5fa;
}

/* ── Bubble ──────────────────────────────────────── */
.chat-msg-bubble {
  border-radius: 16px;
  padding: 10px 14px;
  position: relative;
  word-break: break-word;
  line-height: 1.55;
  max-width: 100%;
}

/* Bubble sinistra (cartomante / interlocutore) */
.chat-msg-sx .chat-msg-bubble {
  background: #f0ebe0;
  border: 1px solid rgba(201,168,76,0.40);
  border-bottom-left-radius: 4px;
  color: #1a1a1a;
}

/* Bubble destra (io / mittente corrente) */
.chat-msg-dx .chat-msg-bubble {
  background: #ddeeff;
  border: 1px solid rgba(96,165,250,0.45);
  border-bottom-right-radius: 4px;
  color: #1a1a1a;
}

/* ── Testo messaggio ─────────────────────────────── */
.chat-msg-testo {
  font-size: 0.9rem;
  margin-bottom: 4px;
  white-space: pre-wrap;
}

/* ── Messaggio eliminato (testo sostitutivo) ─────── */
.chat-msg-eliminato {
  font-size: 0.82rem;
  font-style: italic;
  color: #9ca3af;
  padding: 2px 0;
}

/* ── Meta (ora + badge eliminato) ───────────────── */
.chat-msg-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.chat-msg-ora {
  font-size: 0.7rem;
  color: #9ca3af;
  flex-shrink: 0;
}
.chat-msg-del-badge {
  font-size: 0.65rem;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: 0.04em;
}

/* ── Azioni admin (elimina / ripristina) ─────────── */
.chat-msg-admin-actions {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
}
.chat-btn-elimina,
.chat-btn-ripristina {
  border: none;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.72rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.18s;
  font-family: inherit;
}
.chat-btn-elimina {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.chat-btn-elimina:hover {
  background: rgba(239, 68, 68, 0.28);
}
.chat-btn-ripristina {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.25);
}
.chat-btn-ripristina:hover {
  background: rgba(34, 197, 94, 0.25);
}
