
/* ================= CHAT COMPONENT (ANIMATED & ISOLATED) ================= */

.cb-chat{
  width:360px;
  height:520px;
  background:#0f1a2e;
  border-radius:16px;
  display:flex;
  flex-direction:column;
  font-family:system-ui, sans-serif;
  color:white;
  overflow:hidden;
  box-shadow:0 20px 50px rgba(0,0,0,.4);
  animation:cb-open .6s ease-out both;
}

@keyframes cb-open{
  from{opacity:0; transform:translateY(20px) scale(.95);}
  to{opacity:1; transform:none;}
}

/* HEADER */
.cb-header{
  height:64px;
  padding:10px 12px;
  display:flex;
  gap:10px;
  align-items:center;
  background:#12213d;
  flex-shrink:0;
}
.cb-avatar{
  width:38px;
  height:38px;
  border-radius:50%;
  overflow:hidden;
  background:#0b1220;
  flex-shrink:0;
}

.cb-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.cb-title b{font-size:14px}
.cb-title span{font-size:11px;opacity:.6}

/* BODY */
.cb-body{
  flex:1;
  overflow-y:auto;
  padding:12px;
  background:#0b1220;
}
.cb-timeline{
  display:flex;
  flex-direction:column;
  gap:10px;
}

/* MESSAGE ROWS */
.cb-row{
  display:flex;
  opacity:0;
  transform:translateY(10px);
  animation:cb-msg-in .3s ease-out forwards;
}
.cb-row.me{ justify-content:flex-end; }
.cb-row.them{ justify-content:flex-start; }

/* Delays */
.cb-m1{animation-delay:.4s}
.cb-m2{animation-delay:.8s}
.cb-m3{animation-delay:1.2s}
.cb-m4{animation-delay:1.6s}

/* typing */
.cb-typing-wrap{
  animation:
    cb-msg-in .25s ease-out forwards,
    cb-vanish .25s ease-in forwards;
  animation-delay:2.0s, 2.6s;
}

/* mensajes luego del typing */
.cb-m6{animation-delay:3.0s}
.cb-m7{animation-delay:3.4s}
.cb-m8{animation-delay:3.8s}
.cb-m9{animation-delay:4.2s}
.cb-seen{animation-delay:4.7s}

@keyframes cb-msg-in{
  to{opacity:1; transform:none;}
}

@keyframes cb-vanish{
  to{
    opacity:0;
    transform:translateY(6px);
    height:0;
    margin:0;
    padding:0;
  }
}

/* BUBBLES */
.cb-bubble{
  max-width:78%;
  padding:10px 12px;
  border-radius:14px;
  font-size:13px;
  line-height:1.25;
  background:#182746;
}
.cb-row.me .cb-bubble{ background:#2f6bff; }

.cb-meta{
  font-size:10px;
  opacity:.5;
  margin-top:4px;
  text-align:right;
}

/* Typing indicator */
.cb-typing{
  width:60px;
  padding:10px;
  border-radius:14px;
  background:#182746;
  display:flex;
  justify-content:center;
  gap:4px;
}
.cb-typing i{
  width:6px;height:6px;
  border-radius:50%;
  background:white;
  opacity:.4;
  animation:cb-typing 1s infinite;
}
.cb-typing i:nth-child(2){animation-delay:.15s}
.cb-typing i:nth-child(3){animation-delay:.3s}

@keyframes cb-typing{
  0%,100%{transform:translateY(0);opacity:.4}
  50%{transform:translateY(-4px);opacity:1}
}

/* Footer */
.cb-footer{
  height:56px;
  padding:8px;
  background:#12213d;
  display:flex;
  align-items:center;
  flex-shrink:0;
}
.cb-input{
  flex:1;
  background:#1b2a4a;
  border-radius:12px;
  padding:8px 12px;
  font-size:12px;
  opacity:.6;
}
.cb-status-dot{
  display:inline-block;
  width:8px;
  height:8px;
  border-radius:50%;
  background:#22c55e; /* verde SaaS */
  margin-right:6px;
  box-shadow:0 0 6px rgba(34,197,94,.8);
}


.cb-status {
  display: flex;
  align-items: center;
  font-size: 11px;              /* más chico */
  color: rgba(255,255,255,0.55); /* gris suave */
  font-weight: 500;
  letter-spacing: 0.2px;
}