/* ===== Chamadas de voz/vídeo e canais de voz ===== */

.canal-participante {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 32px;
  font-size: 13px;
  color: var(--cor-texto-principal);
  animation: participanteEntrar 0.2s ease;
}

.canal-participante.escondido {
  display: none;
}

.canal-participante__avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

@keyframes participanteEntrar {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.controles-chamada {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  max-height: 64px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
}

.controles-chamada.escondido {
  max-height: 0;
  opacity: 0;
  padding: 0 12px;
  pointer-events: none;
}

.controles-chamada__grupo {
  display: flex;
  gap: 10px;
}

.botao-controle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(30, 35, 44, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  color: var(--cor-icones);
  cursor: pointer;
  font-size: 18px;
  transition: color 0.15s ease, transform 0.1s ease;
}

.botao-controle:hover {
  color: var(--cor-texto-principal);
  transform: translateY(-1px);
}

.botao-controle:active {
  transform: scale(0.92);
}

.botao-controle--encerrar {
  background-color: var(--cor-vermelho);
  border: none;
  box-shadow: 0 6px 14px rgba(211, 54, 62, 0.35);
  color: var(--cor-texto-principal);
}

.botao-controle--encerrar:hover {
  color: var(--cor-texto-principal);
  opacity: 0.9;
}

.controles-chamada {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  max-height: 132px;
}

.controles-chamada__linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chamada-status {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.chamada-status__titulo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--cor-online);
}

.chamada-status__titulo::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  animation: pulsoChamada 2s ease-in-out infinite;
}

.chamada-status__local {
  max-width: 100%;
  font-size: 12px;
  color: var(--cor-icones);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chamada-status:hover .chamada-status__local {
  color: var(--cor-texto-principal);
}

.botao-controle--ligado {
  background-color: var(--cor-texto-principal);
  color: #0B0E15;
}

.botao-controle--ligado:hover {
  color: #0B0E15;
}

.botao-controle--desligado {
  color: var(--cor-vermelho);
}

.botao-controle--desligado:hover {
  color: var(--cor-vermelho);
}

.botao-controle--grande {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 22px;
  flex-shrink: 0;
}

.botao-controle--encerrar.botao-controle--grande {
  width: 64px;
  border-radius: 26px;
}

.chamada-dm {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px 16px 14px 16px;
  background-color: var(--cor-bg);
  border-bottom: 1px solid var(--cor-traco);
  --tam-avatar: 72px;
}

.chamada-dm.escondido {
  display: none;
}

.chamada-dm__tiles {
  width: 100%;
  max-width: 780px;
  height: clamp(150px, 26vh, 260px);
  display: flex;
  gap: 12px;
}

.chamada-dm__status {
  min-height: 18px;
  font-size: 13px;
  color: var(--cor-icones);
}

.chamada-dm__status:empty {
  display: none;
}

.chamada-dm__controles,
.voz-controles {
  display: flex;
  align-items: center;
  gap: 12px;
}

.voz-tile {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(135deg, var(--cor-tile, var(--cor-cards)), rgba(11, 14, 21, 0.85));
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}

.voz-tile.falando {
  box-shadow: 0 0 0 3px var(--cor-online);
}

.voz-tile--grande {
  flex: 3 1 0;
}

.voz-tile__avatar {
  width: var(--tam-avatar);
  height: var(--tam-avatar);
  border-radius: 50%;
  object-fit: cover;
  font-size: calc(var(--tam-avatar) * 0.42);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.voz-tile--chamando .voz-tile__avatar {
  opacity: 0.7;
  animation: pulsoAvatar 1.6s ease-out infinite;
}

.voz-tile__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #000;
}

.voz-tile__video--espelhado {
  transform: scaleX(-1);
}

.voz-tile__video--conter {
  object-fit: contain;
}

.voz-tile__rodape {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background-color: rgba(11, 14, 21, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 600;
}

.voz-tile__rodape i {
  flex-shrink: 0;
  color: var(--cor-vermelho);
  font-size: 14px;
}

.voz-tile__nome {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voz-tile__ao-vivo {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  background-color: var(--cor-vermelho);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.area-voz {
  flex: 1;
  min-width: 0;
  display: none;
  flex-direction: column;
  background-color: var(--cor-bg);
}

.cabecalho-voz {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--cor-traco);
  background-color: var(--cor-fundo-geral);
}

.cabecalho-voz__nome {
  font-size: 15px;
  font-weight: 600;
}

.cabecalho-voz__tempo {
  margin-left: 8px;
  font-size: 12px;
  color: var(--cor-icones);
  font-variant-numeric: tabular-nums;
}

.voz-corpo {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.voz-palco {
  flex: 1;
  min-height: 0;
  display: flex;
  --tam-avatar: 120px;
}

.voz-palco.escondido {
  display: none;
}

.voz-palco .voz-tile {
  flex: 1;
}

.voz-tiles {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 12px;
  --tam-avatar: 84px;
}

.voz-tiles .voz-tile {
  flex: 0 0 auto;
  width: 260px;
  height: 146px;
}

.voz-tiles[data-quantidade="1"] .voz-tile {
  width: min(520px, 100%);
  height: min(292px, 60vh);
  --tam-avatar: 110px;
}

.voz-tiles[data-quantidade="2"] .voz-tile {
  width: min(420px, 48%);
  height: min(236px, 45vh);
  --tam-avatar: 96px;
}

.voz-tiles[data-quantidade="3"] .voz-tile,
.voz-tiles[data-quantidade="4"] .voz-tile {
  width: min(340px, 48%);
  height: min(191px, 34vh);
}

.voz-corpo--foco .voz-tiles {
  flex: none;
  flex-wrap: nowrap;
  justify-content: center;
  height: 118px;
  overflow-x: auto;
  --tam-avatar: 44px;
}

.voz-corpo--foco .voz-tiles .voz-tile {
  width: 168px;
  height: 100%;
}

.voz-barra {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px 22px 16px;
}

.voz-barra__direita {
  position: absolute;
  right: 16px;
  display: flex;
  gap: 8px;
}

.dm-chamada {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--cor-icones);
}

.dm-chamada__icone {
  width: 40px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  font-size: 18px;
  color: var(--cor-online);
}

.dm-chamada__texto {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dm-chamada__texto strong {
  color: var(--cor-texto-principal);
}

.dm-chamada__horario {
  font-size: 11px;
  white-space: nowrap;
}

.canal-participante {
  flex-wrap: wrap;
}

.canal-participante__outros {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.canal-participante__outros:empty {
  display: none;
}

.canal-participante__linha {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--cor-icones);
}

.canal-participante__linha-avatar {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
}

.canal-participante .avatar-inicial.canal-participante__linha-avatar {
  width: 20px;
  height: 20px;
  font-size: 10px;
}

.canal-participante__linha-nome {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canal-participante.falando .canal-participante__avatar,
.canal-participante__linha.falando .canal-participante__linha-avatar {
  box-shadow: 0 0 0 2px var(--cor-online);
}

.canal-participante--ao-vivo .canal-participante__nome::after {
  content: 'AO VIVO';
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 5px;
  background-color: var(--cor-vermelho);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

@keyframes pulsoChamada {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

@keyframes pulsoAvatar {
  0% {
    box-shadow: 0 0 0 0 rgba(85, 102, 245, 0.6);
  }

  100% {
    box-shadow: 0 0 0 24px rgba(85, 102, 245, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chamada-status__titulo::before,
  .voz-tile--chamando .voz-tile__avatar {
    animation: none;
  }
}

/* ----- Quem está conectado em cada canal de voz (lista vinda do servidor) ----- */
.canal-participante {
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}

.canal-participante__linha {
  padding: 3px 6px;
  border-radius: 6px;
  color: var(--cor-texto-principal);
  cursor: pointer;
}

.canal-participante__linha:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

.canal-participante__linha-nome small {
  opacity: 0.55;
  font-size: 11px;
}

.canal-participante__icones {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  color: var(--cor-icones);
  font-size: 14px;
}

.canal-participante__icones:empty {
  display: none;
}

.canal-participante__ao-vivo {
  padding: 1px 6px;
  border-radius: 5px;
  background-color: var(--cor-vermelho);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

/* ----- Ampliar / reduzir / tela cheia de qualquer bloco com vídeo ----- */
.voz-tile__acoes {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2;
}

.voz-tile:hover .voz-tile__acoes,
.voz-tile:focus-within .voz-tile__acoes {
  opacity: 1;
}

@media (hover: none) {
  .voz-tile__acoes {
    opacity: 1;
  }
}

.voz-tile__acao {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.voz-tile__acao:hover {
  background-color: rgba(0, 0, 0, 0.85);
}

/* Chamada de DM com um bloco ampliado: palco grande + faixa com todos embaixo */
.chamada-dm__tiles--foco {
  flex-direction: column;
  max-width: 980px;
  height: clamp(280px, 56vh, 620px);
}

.chamada-dm__palco {
  flex: 1;
  min-height: 0;
  display: flex;
  --tam-avatar: 96px;
}

.chamada-dm__palco .voz-tile {
  flex: 1;
}

.chamada-dm__faixa {
  flex: none;
  height: 84px;
  display: flex;
  justify-content: center;
  gap: 10px;
  --tam-avatar: 40px;
}

.chamada-dm__faixa .voz-tile {
  flex: 0 0 150px;
}

/* Tela cheia (da área da chamada) */
.chamada-dm:fullscreen,
.area-voz:fullscreen {
  background-color: var(--cor-bg);
}

.chamada-dm:fullscreen {
  justify-content: center;
  padding: 24px;
}

.chamada-dm:fullscreen .chamada-dm__tiles,
.chamada-dm:fullscreen .chamada-dm__tiles--foco {
  max-width: none;
  height: calc(100vh - 160px);
}
