/* ClipAI -- lives, canal sob plantao, galeria e ajustes (FASE 4 do redesign). */

/* ============ LIVES EM ALTA ============ */
@keyframes m-live-entra { from { opacity: 0; transform: translateY(var(--m-dist-3)) scale(0.97); } }
.lives-grid .live-card.m-entra, .acervo-grid .acervo-card.m-entra {
  animation: m-live-entra var(--m-dur-4) var(--m-ease-saida) both;
  animation-delay: calc(var(--m-i, 0) * var(--m-stagger));
}
/* Selo AO VIVO com pulso de verdade: um anel que se expande a partir do
   ponto (transform + opacity), no lugar de so piscar a opacidade. */
.live-badge { display: inline-flex; align-items: center; gap: 6px; }
.live-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; flex: none;
}
@keyframes m-pulso-anel { from { transform: scale(1); opacity: 0.75; } to { transform: scale(3.2); opacity: 0; } }
.live-badge:not(.offline-badge) { position: absolute; }
.live-badge:not(.offline-badge)::after {
  content: ""; position: absolute; left: 9px; top: 50%; width: 6px; height: 6px;
  margin-top: -3px; border-radius: 50%; background: #fff;
  animation: m-pulso-anel 1.6s ease-out infinite;
}
.ponto-vivo { position: relative; }
.ponto-vivo::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor;
  animation: m-pulso-anel 1.6s ease-out infinite;
}
.live-viewers { font-variant-numeric: tabular-nums; }
/* A miniatura aproxima de leve no hover (o card ja recorta). */
.live-thumb-caixa { overflow: hidden; }
.live-thumb-caixa img { transition: scale var(--m-dur-5) var(--m-ease-saida); }
@media (hover: hover) { .live-card:hover .live-thumb-caixa img { scale: 1.05; } }
@keyframes m-selo-pronto { from { opacity: 0; transform: scale(0.6); } }
.live-prontos:not(.escondido) { animation: m-selo-pronto var(--m-dur-4) var(--m-mola-viva) 0.25s both; }

/* ============ CANAL SOB PLANTAO ============ */
/* Radar SVG: dois aneis saindo do centro + uma varredura girando. */
.plantao-radar {
  position: relative; width: 18px; height: 18px; background: none; border-radius: 50%;
  flex: none; color: var(--texto-3);
}
.plantao-radar svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.plantao-radar .anel { fill: none; stroke: currentColor; stroke-width: 1.2; opacity: 0.35; transform-origin: center; transform-box: fill-box; }
.plantao-radar .nucleo { fill: currentColor; }
.plantao-radar .varre { fill: currentColor; opacity: 0; transform-origin: 9px 9px; }
.canal-selo-plantao.ativo .plantao-radar {
  color: var(--accent); background: none; box-shadow: none; animation: none;
}
@keyframes m-radar-anel { from { transform: scale(0.35); opacity: 0.8; } to { transform: scale(1); opacity: 0; } }
.canal-selo-plantao.ativo .plantao-radar .anel { animation: m-radar-anel 2.2s ease-out infinite; }
.canal-selo-plantao.ativo .plantao-radar .anel.a2 { animation-delay: 1.1s; }
.canal-selo-plantao.ativo .plantao-radar .varre { opacity: 0.55; animation: m-gira 2.4s linear infinite; }

/* Clipe novo chegando ao vivo: entra por cima, com um halo que apaga. */
@keyframes m-chega { from { opacity: 0; transform: translateY(-22px) scale(0.94); } }
@keyframes m-chega-halo { from { opacity: 1; } to { opacity: 0; } }
.canal-clipe.chegando { animation: m-chega var(--m-dur-5) var(--m-mola-suave) both; position: relative; }
.canal-clipe.chegando::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  border: 2px solid var(--accent); box-shadow: 0 0 30px rgba(92, 192, 245, 0.55);
  animation: m-chega-halo 2.4s ease-out 0.3s both;
}
.canal-clipe .cc-novo {
  position: absolute; top: 10px; right: 10px; z-index: 2; padding: 2px 9px; border-radius: 100px;
  background: var(--accent); color: var(--sobre-accent); font-size: 0.66rem; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
  animation: m-selo-pronto var(--m-dur-4) var(--m-mola-viva) both;
}

/* Card bloqueado (Free): no lugar das listras, uma "previa" abstrata borrada
   -- formas na matiz do card, desfocadas -- que da vontade de ver. */
.canal-clipe.bloqueado { --m-matiz: 205; }
.canal-clipe.bloqueado:nth-child(3n+2) { --m-matiz: 262; }
.canal-clipe.bloqueado:nth-child(3n) { --m-matiz: 168; }
.cc-cadeado {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(170deg, hsl(var(--m-matiz) 40% 20%), hsl(var(--m-matiz) 46% 8%));
}
.cc-cadeado::before {
  content: ""; position: absolute; inset: -20%;
  background:
    radial-gradient(34% 22% at 50% 26%, hsl(var(--m-matiz) 80% 66% / 0.75), transparent 70%),
    radial-gradient(60% 18% at 50% 74%, rgba(255, 255, 255, 0.4), transparent 72%),
    radial-gradient(46% 30% at 30% 56%, hsl(calc(var(--m-matiz) + 40) 70% 55% / 0.45), transparent 70%);
  filter: blur(14px); transition: scale var(--m-dur-5) var(--m-ease-saida);
}
.canal-clipe.bloqueado:hover .cc-cadeado::before { scale: 1.12; }
.cc-cadeado svg {
  position: relative; z-index: 1; width: 44px; height: 44px; padding: 10px; border-radius: 50%;
  background: rgba(8, 9, 13, 0.55); backdrop-filter: blur(6px);
  transition: scale var(--m-dur-3) var(--m-mola-viva);
}
@keyframes m-cadeado { 0%, 100% { rotate: 0deg; } 20% { rotate: -11deg; } 45% { rotate: 9deg; } 70% { rotate: -5deg; } }
.canal-clipe.bloqueado:hover .cc-cadeado svg { scale: 1.1; animation: m-cadeado 0.6s ease-in-out; }
.canal-clipe.bloqueado .cc-info { filter: none; opacity: 0.9; }
.cc-desbloquear {
  display: inline-flex; align-self: flex-start; margin-top: 6px; padding: 3px 10px; border-radius: 100px;
  background: var(--accent-suave); border: 1px solid rgba(92, 192, 245, 0.45); color: var(--accent);
  font-size: 0.72rem; font-weight: 700;
}

/* ============ MEUS CLIPES ============ */
/* A barra troca de modo (normal <-> selecao) com uma entrada curta. */
@keyframes m-barra-troca { from { opacity: 0; transform: translateY(calc(var(--m-dist-2) * -1)); } }
.mc-barra-grupo:not(.escondido) { animation: m-barra-troca var(--m-dur-3) var(--m-ease-saida) both; }
.mc-check { transition: scale var(--m-dur-3) var(--m-mola-viva); }
@keyframes m-check-entra { from { opacity: 0; scale: 0.4; } }
.grid-clipes.selecionando .mc-check { animation: m-check-entra var(--m-dur-4) var(--m-mola-viva) both; }
@keyframes m-some { to { opacity: 0; transform: scale(0.9); } }
.clipe-card.saindo { animation: m-some var(--m-dur-2) var(--m-ease-entrada) both; pointer-events: none; }
.mc-filtros .mc-chip, .mc-filtros button { transition: scale var(--m-dur-2) var(--m-mola-viva), background var(--m-dur-2) linear, color var(--m-dur-2) linear, border-color var(--m-dur-2) linear; }

/* Estado vazio: ilustracao em SVG animado (um clipe "chegando" na pilha). */
.m-vazio-arte { display: block; width: 150px; height: 104px; margin: 0 auto 14px; color: var(--accent); }
.m-vazio-arte * { transform-box: fill-box; transform-origin: center; }
.m-vazio-arte .tr { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.m-vazio-arte .fr { opacity: 0.3; }
.m-vazio-arte .ch { fill: currentColor; }
@keyframes m-vazio-flutua { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-7px) rotate(-1deg); } }
@keyframes m-vazio-brilha { 0%, 100% { opacity: 0.25; transform: scale(0.7); } 50% { opacity: 1; transform: scale(1); } }
.m-vazio-arte .solto { animation: m-vazio-flutua 3.6s ease-in-out infinite; }
.m-vazio-arte .faisca { animation: m-vazio-brilha 2.2s ease-in-out infinite; }
.m-vazio-arte .faisca.f2 { animation-delay: 0.7s; }
.m-vazio-arte .faisca.f3 { animation-delay: 1.3s; }

/* ============ AJUSTES: botao flutuante com anel de progresso ============
   O anel e um conic-gradient recortado em coroa; o angulo vem de --m-prog
   (0 a 1), escrito pelo app.js a cada leitura do servidor. */
.ajb-flutua-spin {
  position: relative; width: 26px; height: 26px; border: none; animation: none;
  background: conic-gradient(var(--accent) calc(var(--m-prog, 0) * 1turn), rgba(92, 192, 245, 0.18) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent 62%, #000 64%);
  mask: radial-gradient(farthest-side, transparent 62%, #000 64%);
}
@keyframes m-flutua-entra { from { opacity: 0; transform: translateY(var(--m-dist-3)) scale(0.9); } }
.ajb-flutua:not(.escondido) { animation: m-flutua-entra var(--m-dur-4) var(--m-mola-viva) both; }
.ajb-flutua-pct { font-variant-numeric: tabular-nums; }

/* Bug corrigido: a secao do canal era a unica que nao recortava o brilho
   decorativo do topo (.pagina-brilho), que e mais largo que a tela -- a
   pagina ganhava ~59 px de rolagem lateral no celular. */
.canal-secao { overflow: hidden; overflow: clip; }
.mc-vazio .btn-nav { text-decoration: none; }
