/**
 * Twitch Tools - Live Channels Ticker / Marquee Styles
 * melekafollows.com
 */

/* ==========================================================================
   CONTAINER PRINCIPAL DO TICKER (TRANSPARENTE PARA EMBUTIR EM ELEMENTOS PAI)
   ========================================================================== */
.tt-ticker-strip {
  width: 100%;
  background: transparent;
  border: none;
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
  font-family: 'Outfit', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #f8fafc;
}

.tt-ticker-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Modo full-width */
.tt-ticker-strip.tt-is-fullwidth .tt-ticker-inner {
  max-width: 100%;
  padding: 0;
}

/* ==========================================================================
   BOTÃO ESTÁTICO (AO VIVO AGORA)
   ========================================================================== */
.tt-ticker-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff;
  white-space: nowrap;
  padding: 6px 14px;
  background: rgba(235, 4, 0, 0.18);
  border: 1px solid rgba(235, 4, 0, 0.45);
  border-radius: 9999px;
  text-decoration: none;
  flex-shrink: 0;
  box-shadow: none;
  transition: background 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

a.tt-ticker-badge:hover {
  background: rgba(235, 4, 0, 0.32);
  border-color: rgba(235, 4, 0, 0.75);
  box-shadow: none;
  color: #ffffff;
  transform: none;
}

/* Dot Pulsante do Botão */
.tt-pulse-dot {
  width: 7px;
  height: 7px;
  background: #eb0400;
  border-radius: 50%;
  box-shadow: 0 0 8px #eb0400;
  flex-shrink: 0;
  animation: ttPulseLive 1.5s infinite;
}

@keyframes ttPulseLive {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.35); opacity: 1; box-shadow: 0 0 12px #eb0400; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* ==========================================================================
   ESTEIRA DO MARQUEE (VIEWPORT & TRACKS)
   ========================================================================== */
.tt-ticker-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
  /* Máscara gradiente sutil nas pontas para suavizar a entrada/saída */
  mask-image: linear-gradient(to right, transparent 0%, black 20px, black calc(100% - 20px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 20px, black calc(100% - 20px), transparent 100%);
}

.tt-ticker-track {
  display: flex;
  align-items: center;
  width: max-content;
  will-change: transform;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-duration: 35s;
}

/* Animação para a Esquerda (padrão de tickers de notícias) */
.tt-ticker-track.tt-dir-left {
  animation-name: ttTickerScrollLeft;
}

/* Animação para a Direita */
.tt-ticker-track.tt-dir-right {
  animation-name: ttTickerScrollRight;
}

@keyframes ttTickerScrollLeft {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes ttTickerScrollRight {
  0% {
    transform: translate3d(-50%, 0, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

/* Pausa no Hover */
.tt-ticker-strip.tt-pause-on-hover:hover .tt-ticker-track {
  animation-play-state: paused;
}

/* Grupos que formam o loop contínuo */
.tt-ticker-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 10px;
  flex-shrink: 0;
  width: max-content;
}

/* Modo Estático (Quando os canais cabem na tela: sem animação, sem clone e sem scrollbar) */
.tt-ticker-strip.tt-is-static .tt-ticker-track,
.tt-ticker-track.tt-is-static {
  animation: none !important;
  transform: none !important;
  width: auto !important;
  max-width: 100% !important;
}

.tt-ticker-strip.tt-is-static .tt-ticker-group-clone,
.tt-ticker-track.tt-is-static .tt-ticker-group-clone {
  display: none !important;
}

.tt-ticker-strip.tt-is-static .tt-ticker-viewport {
  mask-image: none !important;
  -webkit-mask-image: none !important;
}

/* Ocultação total e permanente de scrollbars nativos */
.tt-ticker-strip,
.tt-ticker-strip *,
.tt-ticker-inner,
.tt-ticker-viewport,
.tt-ticker-track,
.tt-ticker-group {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.tt-ticker-strip::-webkit-scrollbar,
.tt-ticker-strip *::-webkit-scrollbar,
.tt-ticker-inner::-webkit-scrollbar,
.tt-ticker-viewport::-webkit-scrollbar,
.tt-ticker-track::-webkit-scrollbar,
.tt-ticker-group::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

/* ==========================================================================
   PÍLULA DE STREAMER (.tt-streamer-pill)
   ========================================================================== */
.tt-streamer-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1a1c26;
  background: rgba(26, 28, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 12px 4px 5px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  color: #f8fafc;
  flex-shrink: 0 !important;
  box-shadow: none;
  transition: border-color 0.18s ease;
  user-select: none;
  cursor: pointer;
}

.tt-streamer-pill:hover {
  border-color: #9146ff;
  transform: none;
  box-shadow: none;
}

/* Estilo para canais Ao Vivo */
.tt-streamer-pill.is-live {
  border-color: rgba(0, 245, 212, 0.4);
}

.tt-streamer-pill.is-live:hover {
  border-color: #00f5d4;
  transform: none;
  box-shadow: none;
}

/* Avatar com borda */
.tt-pill-avatar-wrap {
  position: relative;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.tt-pill-avatar {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  max-width: 26px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
  border: 1.5px solid #9146ff;
  background: #13141c;
}

.tt-streamer-pill.is-live .tt-pill-avatar {
  border-color: #eb0400;
}

/* Dot pequeno de status no avatar */
.tt-pill-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #eb0400;
  border: 1.5px solid #1a1c26;
  box-shadow: 0 0 5px #eb0400;
}

/* Nome do Streamer */
.tt-pill-name {
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

/* Jogo ou Status */
.tt-pill-game {
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 400;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tt-streamer-pill:hover .tt-pill-game {
  color: #cbd5e1;
}

/* Offline */
.tt-streamer-pill.is-offline {
  opacity: 0.72;
}

.tt-streamer-pill.is-offline .tt-pill-avatar {
  border-color: #64748b;
}

.tt-streamer-pill.is-offline .tt-pill-game {
  color: #64748b;
}

/* ==========================================================================
   ACESSIBILIDADE E RESPONSIVIDADE
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .tt-ticker-track {
    animation: none !important;
  }
}

@media (max-width: 768px) {
  .tt-ticker-inner {
    gap: 10px;
    padding: 0 12px;
  }

  .tt-ticker-badge {
    padding: 4px 10px;
    font-size: 0.72rem;
  }

  .tt-streamer-pill {
    padding: 3px 10px 3px 4px;
    font-size: 0.78rem;
  }

  .tt-pill-avatar-wrap,
  .tt-pill-avatar {
    width: 22px;
    height: 22px;
  }

  .tt-pill-game {
    max-width: 120px;
  }
}
