/* ============================================================
   CONTATOS.CSS — Botão lateral + painel de chat
   ============================================================ */

/* ── Botão lateral ─────────────────────────────────────────── */
.ct-lateral-btn {
  position: fixed;
  left: 0; top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  background: #FFFFFF;
  border: 1px solid #D9D5CC;
  border-left: none;
  border-radius: 0 10px 10px 0;
  padding: 14px 6px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: background .15s;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}
.ct-lateral-btn:hover { background: #EDE9DE; border-color: #e67e22; }
.ct-lateral-label {
  font-size: .68rem; font-weight: 900; color: #666873;
  letter-spacing: 1px; text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}
.ct-lateral-icon { font-size: 1.1rem; }
.ct-badge {
  display: none;
  position: absolute; top: 6px; right: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #e74c3c; color: #fff;
  font-size: .6rem; font-weight: 900;
  align-items: center; justify-content: center;
  border: 2px solid #FFFFFF;
}

/* ── Painel principal ──────────────────────────────────────── */
.ct-panel {
  position: fixed;
  left: -360px; top: 0; bottom: 0;
  width: 340px;
  background: #F4F2ED;
  border-right: 1px solid #D9D5CC;
  z-index: 800;
  display: flex; flex-direction: column;
  transition: left .25s ease;
  box-shadow: 4px 0 24px rgba(0,0,0,.5);
}
.ct-panel.ct-open { left: 0; }

/* Header do painel */
.ct-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid #EDE9DE;
  background: #FFFFFF;
  flex-shrink: 0;
}
.ct-panel-titulo {
  font-family: 'Bangers', cursive; font-size: 1.2rem;
  letter-spacing: 1px; color: #20212A;
}
.ct-close-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,.55); border: 1px solid #D9D5CC;
  color: #fff; font-size: .85rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.ct-close-btn:hover { background: #e74c3c; color: #fff; border-color: #e74c3c; }

/* Barra de adicionar */
.ct-add-bar {
  display: flex; gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid #EDE9DE;
  flex-shrink: 0;
}
.ct-add-input {
  flex: 1; background: #FFFFFF; border: 1px solid #D9D5CC;
  border-radius: 8px; padding: 7px 10px; color: #20212A;
  font-size: .8rem; font-family: 'Nunito', sans-serif; outline: none;
}
.ct-add-input:focus { border-color: #e67e22; }
.ct-add-input::placeholder { color: #666873; }
.ct-add-btn {
  padding: 7px 12px; border-radius: 8px;
  background: #e67e22; border: none; color: #fff;
  font-size: .78rem; font-weight: 900; cursor: pointer;
  font-family: 'Nunito', sans-serif; transition: background .15s;
}
.ct-add-btn:hover { background: #d35400; }

/* Msg de feedback */
.ct-msg-feedback {
  display: none; font-size: .75rem; color: #e67e22;
  padding: 4px 12px; background: rgba(230,126,34,.08);
  border-bottom: 1px solid rgba(230,126,34,.2);
}

/* Lista de contatos */
.ct-lista {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 6px 0;
}

/* Pedido de amizade */
.ct-pedido-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid #EDE9DE;
  background: rgba(52,152,219,.06);
}
.ct-pedido-txt { flex: 1; font-size: .78rem; color: #666873; }
.ct-pedido-btns { display: flex; gap: 4px; }
.ct-btn-aceitar {
  padding: 4px 10px; border-radius: 6px;
  background: #2ecc71; border: none; color: #fff;
  font-size: .72rem; font-weight: 900; cursor: pointer;
}
.ct-btn-recusar {
  padding: 4px 10px; border-radius: 6px;
  background: #e74c3c; border: none; color: #fff;
  font-size: .72rem; font-weight: 900; cursor: pointer;
}

/* Item de amigo */
.ct-amigo-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid #D9D5CC; transition: background .15s;
}
.ct-amigo-item:hover, .ct-amigo-item.active { background: rgba(0,0,0,.04); }
.ct-avatar-wrap { position: relative; flex-shrink: 0; }
.ct-avatar { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.ct-avatar-emoji {
  width: 40px; height: 40px; border-radius: 10px;
  background: #EDE9DE; display: flex; align-items: center;
  justify-content: center; font-size: 1.3rem;
}
.ct-status-dot {
  position: absolute; bottom: 2px; right: 2px;
  width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid #F4F2ED;
}
.ct-status-dot.online  { background: #2ecc71; }
.ct-status-dot.offline { background: #666873; }
.ct-amigo-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ct-amigo-nome { font-size: .84rem; font-weight: 800; color: #20212A; }
.ct-amigo-preview { font-size: .72rem; color: #666873; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-unread-badge {
  background: #e74c3c; color: #fff; border-radius: 50%;
  width: 20px; height: 20px; display: flex; align-items: center;
  justify-content: center; font-size: .65rem; font-weight: 900; flex-shrink: 0;
}
.ct-vazio { text-align: center; padding: 30px 16px; color: #666873; font-size: .8rem; line-height: 1.6; }

/* ── Janela de conversa ────────────────────────────────────── */
.ct-conv {
  flex: 1; display: none; flex-direction: column; overflow: hidden;
}
.ct-conv-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid #EDE9DE;
  background: #FFFFFF; flex-shrink: 0;
}
.ct-back-btn {
  background: none; border: none; color: #666873; font-size: 1.4rem;
  cursor: pointer; padding: 0 4px; line-height: 1;
  transition: color .15s;
}
.ct-back-btn:hover { color: #e67e22; }
.ct-conv-avatar { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.ct-conv-avatar-emoji {
  width: 36px; height: 36px; border-radius: 8px;
  background: #EDE9DE; display: flex; align-items: center;
  justify-content: center; font-size: 1.2rem; flex-shrink: 0;
}
.ct-conv-info { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.ct-conv-nome { font-size: .88rem; font-weight: 900; color: #20212A; }
.ct-conv-status { font-size: .68rem; font-weight: 700; }
.ct-conv-status.online  { color: #2ecc71; }
.ct-conv-status.offline { color: #666873; }

/* Área de mensagens */
.ct-msgs-area {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.ct-msg { display: flex; flex-direction: column; max-width: 80%; }
.ct-minha { align-self: flex-end; align-items: flex-end; }
.ct-dele  { align-self: flex-start; align-items: flex-start; }
.ct-msg-bubble {
  padding: 8px 12px; border-radius: 12px;
  font-size: .82rem; line-height: 1.4; word-break: break-word;
}
.ct-minha .ct-msg-bubble { background: #e67e22; color: #fff; border-bottom-right-radius: 4px; }
.ct-dele  .ct-msg-bubble { background: #EDE9DE; color: #20212A; border-bottom-left-radius: 4px; }
.ct-msg-hora { font-size: .65rem; color: #666873; margin-top: 2px; }
.ct-lida { color: #3498db; }
.ct-vazio-msgs { text-align: center; color: #666873; font-size: .8rem; margin: auto; }

/* Input de mensagem */
.ct-input-area {
  display: flex; gap: 6px;
  padding: 10px 12px; border-top: 1px solid #EDE9DE;
  background: #FFFFFF; flex-shrink: 0;
}
.ct-msg-input {
  flex: 1; background: #FFFFFF; border: 1px solid #D9D5CC;
  border-radius: 8px; padding: 8px 12px; color: #20212A;
  font-size: .82rem; font-family: 'Nunito', sans-serif; outline: none;
  resize: none;
}
.ct-msg-input:focus { border-color: #e67e22; }
.ct-send-btn {
  width: 38px; height: 38px; border-radius: 8px;
  background: #e67e22; border: none; color: #fff;
  font-size: 1rem; cursor: pointer; transition: background .15s;
  display: flex; align-items: center; justify-content: center;
}
.ct-send-btn:hover { background: #d35400; }

/* ── Painel de conversa (ao lado do painel de contatos) ── */
.ct-conv-panel {
  position: fixed;
  left: -700px; top: 0; bottom: 0;
  width: 340px;
  background: #F4F2ED;
  border-right: 1px solid #D9D5CC;
  border-left: 1px solid #D9D5CC;
  z-index: 801;
  display: flex; flex-direction: column;
  transition: left .25s ease;
  box-shadow: 4px 0 24px rgba(0,0,0,.4);
  overflow: hidden;
}
.ct-conv-panel.ct-conv-open { left: 340px; }
