/* Vibe Pessoas UI — camada visual da lista e conversa individual.
 * Não altera Firebase nem a estrutura de dados.
 */

#vibe-pessoas-btn{
    position:fixed;
    right:18px;
    bottom:92px;
    z-index:10030;
    width:56px;
    height:56px;
    border:1px solid rgba(255,255,255,.14);
    border-radius:50%;
    background:rgba(10,35,65,.94);
    color:#1a73e8;
    box-shadow:0 8px 24px rgba(0,0,0,.35);
    font-size:20px;
    display:grid;
    place-items:center;
    -webkit-tap-highlight-color:transparent;
}

#vibe-pessoas-btn:active{ transform:scale(.96); }

.vibe-pessoas-overlay{
    position:fixed;
    inset:0;
    z-index:10035;
    display:none;
    flex-direction:column;
    background:rgba(5,7,12,.98);
    color:#fff;
    box-sizing:border-box;
}

.vibe-pessoas-overlay.aberta{ display:flex; }

#vibe-conversa-overlay{
    z-index:10040;
    height:100dvh;
    min-height:100vh;
    overflow:hidden;
}

.vibe-pessoas-topo{
    display:flex;
    align-items:center;
    gap:12px;
    flex:0 0 auto;
    padding:10px 12px;
    min-height:56px;
    box-sizing:border-box;
    background:linear-gradient(180deg,#090d16,#05070c);
    border-bottom:1px solid rgba(255,255,255,.08);
}

.vibe-pessoas-topo button{
    width:40px;
    height:40px;
    flex:0 0 40px;
    border:0;
    border-radius:50%;
    background:rgba(255,255,255,.08);
    color:#fff;
    display:grid;
    place-items:center;
    font-size:18px;
}

.vibe-pessoas-topo strong{
    min-width:0;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    font-size:18px;
}

.vibe-pessoas-lista{
    flex:1;
    min-height:0;
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    padding:8px 12px 24px;
}

.vibe-pessoa{
    width:100%;
    display:flex;
    align-items:center;
    gap:12px;
    padding:12px;
    margin:0 0 7px;
    border:1px solid rgba(255,255,255,.06);
    border-radius:16px;
    background:linear-gradient(145deg,rgba(255,255,255,.055),rgba(255,255,255,.025));
    color:#fff;
    text-align:left;
    box-sizing:border-box;
    font:inherit;
    -webkit-tap-highlight-color:transparent;
}

.vibe-pessoa:active{
    background:rgba(26,115,232,.18);
    transform:scale(.995);
}

.vibe-pessoa img,
.vibe-pessoa .fallback-avatar{
    width:48px;
    height:48px;
    min-width:48px;
    min-height:48px;
    flex:0 0 48px;
    border-radius:50%;
    object-fit:cover;
    background:#1a73e8;
    display:grid;
    place-items:center;
}

.vibe-pessoa-info{ min-width:0; display:flex; flex-direction:column; }
.vibe-pessoa-nome{ font-weight:700; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.vibe-pessoa-sub{ font-size:12px; color:rgba(255,255,255,.55); margin-top:2px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }

.vibe-conversa-topo{ gap:10px; }
.vibe-conversa-perfil{ min-width:0; display:flex; align-items:center; gap:10px; }
.vibe-conversa-avatar,
.vibe-conversa-avatar img{
    width:38px;
    height:38px;
    min-width:38px;
    min-height:38px;
    border-radius:50%;
    object-fit:cover;
}
.vibe-conversa-avatar{ display:grid; place-items:center; background:#1a73e8; color:#fff; font-weight:800; }

.vibe-pessoa-chat{
    flex:1;
    min-height:0;
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    padding:16px 12px 82px;
    display:flex;
    flex-direction:column;
    gap:8px;
}

.vibe-pessoa-msg-linha{
    display:flex;
    align-items:flex-end;
    gap:7px;
    max-width:88%;
}

.vibe-pessoa-msg-linha.propria{
    align-self:flex-end;
    flex-direction:row-reverse;
}

.vibe-pessoa-msg-linha.outra{ align-self:flex-start; }

.vibe-msg-avatar,
.vibe-msg-avatar img{
    width:30px;
    height:30px;
    min-width:30px;
    min-height:30px;
    border-radius:50%;
    object-fit:cover;
}

.vibe-msg-avatar{
    display:grid;
    place-items:center;
    background:#1a73e8;
    color:#fff;
    font-size:12px;
    font-weight:800;
}

.vibe-pessoa-msg{
    max-width:78%;
    padding:10px 13px;
    border-radius:16px;
    line-height:1.35;
    word-break:break-word;
    white-space:pre-wrap;
    background:rgba(255,255,255,.08);
    border:1px solid rgba(255,255,255,.06);
}

.vibe-pessoa-msg.propria{
    background:#1a73e8;
    border-color:rgba(255,255,255,.08);
    border-bottom-right-radius:5px;
}

.vibe-pessoa-msg.outra{ border-bottom-left-radius:5px; }

.vibe-pessoa-compositor{
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    z-index:2;
    display:flex;
    gap:8px;
    padding:10px;
    padding-bottom:calc(10px + env(safe-area-inset-bottom));
    background:rgba(5,7,12,.98);
    border-top:1px solid rgba(255,255,255,.08);
}

.vibe-pessoa-compositor input{
    flex:1;
    min-width:0;
    height:44px;
    border:1px solid rgba(255,255,255,.12);
    border-radius:22px;
    padding:0 15px;
    outline:none;
    background:#191919;
    color:#fff;
    font-size:16px;
    box-sizing:border-box;
}

.vibe-pessoa-compositor input:focus{ border-color:rgba(26,115,232,.65); }

.vibe-pessoa-compositor button{
    width:44px;
    height:44px;
    min-width:44px;
    flex:0 0 44px;
    border:0;
    border-radius:50%;
    background:#1a73e8;
    color:#fff;
    display:grid;
    place-items:center;
    -webkit-tap-highlight-color:transparent;
}

.vibe-pessoa-compositor button:active{ transform:scale(.95); }
.vibe-pessoas-vazio{ padding:30px 15px; text-align:center; color:rgba(255,255,255,.55); }

@media (max-width:380px){
    #vibe-pessoas-btn{ right:14px; bottom:88px; width:52px; height:52px; }
    .vibe-pessoa-msg{ max-width:84%; }
    .vibe-msg-avatar,.vibe-msg-avatar img{ width:27px; height:27px; min-width:27px; min-height:27px; }
}


/* Áudio do chat: botão de microfone e painel de gravação */
#vibe-conversa-audio{ flex:0 0 auto; }
#vibe-conversa-audio.gravando{
    background:#e53935;
    animation:vibe-pulsa 1.1s ease-in-out infinite;
}
@keyframes vibe-pulsa{
    0%,100%{ transform:scale(1); }
    50%{ transform:scale(1.08); }
}
.vibe-gravando{
    display:flex;
    align-items:center;
    gap:8px;
    padding:8px 16px 14px;
    font-size:13px;
    color:#c9d3e0;
    background:rgba(5,7,12,.92);
}
.vibe-gravando-ponto{
    width:10px;
    height:10px;
    border-radius:50%;
    background:#e53935;
    animation:vibe-pulsa 1s ease-in-out infinite;
}
.vibe-gravando-dica{ opacity:.7; }
.vibe-pessoa-msg.audio{
    padding:6px 8px;
    background:transparent;
}
.vibe-pessoa-msg.audio audio{
    display:block;
    max-width:220px;
    height:38px;
}
