/* chat-skin.css | V2.2 — Compact bubbles with labels + timestamps */

/* Chat container */
#chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
}

/* Base bubble wrapper */
.chat-message {
  display: inline-flex;
  flex-direction: column;
  max-width: 78%;
}

/* Bubble content */
.chat-message .bubble-label {
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 4px;
  opacity: .9;
}

.chat-message .bubble-text {
  position: relative;  /* anchor tails */
  background: #fff;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.35;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}


.chat-message .bubble-meta {
  margin-top: 6px;
  font-size: 11px;
  opacity: .75;
}

/* Role-specific layout + colors */

/* Customer / You (right side, pale green) */
.chat-message.user {
  align-self: flex-end;
  margin-left: 18%;
}
.chat-message.user .bubble-text {
  background: #f0fdf4;    /* pale green */
  color: #14532d;
  border-top-right-radius: 6px;
}
.chat-message.user .bubble-label {
  color: #14532d;
}

/* Agent (left side, gray) */
.chat-message.agent {
  align-self: flex-start;
  margin-right: 18%;
}
.chat-message.agent .bubble-text {
  background: #f3f4f6;    /* light gray */
  color: #1f2937;
  border-top-left-radius: 6px;
}
.chat-message.agent .bubble-label {
  color: #0f172a;
}

/* Bot (same lane as agent, gray) */
.chat-message.bot {
  align-self: flex-start;
  margin-right: 18%;
}
.chat-message.bot .bubble-text {
  background: #f3f4f6;
  color: #1f2937;
  border-top-left-radius: 6px;
}
.chat-message.bot .bubble-label {
  color: #0f172a;
}

/* Admin (left side, amber) */
.chat-message.admin {
  align-self: flex-start;
  margin-right: 18%;
}
.chat-message.admin .bubble-text {
  background: #FDF2E9;    /* soft amber */
  color: #7C2D12;
  border-top-left-radius: 6px;
}
.chat-message.admin .bubble-label {
  color: #7C2D12;
}

/* Optional: dark mode tweaks */
@media (prefers-color-scheme: dark) {
  .chat-message.agent .bubble-text,
  .chat-message.bot .bubble-text {
    background: #273244;
    color: #e5e7eb;
  }
  .chat-message.user .bubble-text {
    background: #1669b2;
    color: #eaf4ff;
  }
}


/* ---- Avatars (left roles only) ----------------------------------------- */
.msg { display: grid; grid-template-columns: 32px 1fr; column-gap: 10px; }
.chat-message.user { display: inline-flex; }            /* user stays without avatar */
.msg .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  overflow: hidden; background: #0f5132; color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:12px;
}
.msg .avatar img { width:100%; height:100%; object-fit:cover; }

/* Wrap bubble parts so tails can attach cleanly */
.chat-message .bubble-wrap { position:relative; display:inline-block; }

/* ---- Tails -------------------------------------------------------------- */
/* left tail */
.chat-message.agent .bubble-text::after,
.chat-message.bot .bubble-text::after {
  content:"";
  position:absolute; left:-6px; top:10px;
  width: 0; height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid #f3f4f6;     /* same as left bubble bg */
}
/* right tail */
.chat-message.user .bubble-text::after {
  content:"";
  position:absolute; right:-6px; top:10px;
  width: 0; height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 6px solid #f0fdf4;      /* same as right bubble bg */
}

/* Slight layout tweaks when avatar present */
.chat-message.agent,
.chat-message.bot { margin-right:18%; }
