/* Reset e Estilos Globais */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-color: #000000;
  --card-bg: #090909;
  --card-border: #1a1a1a;
  --card-border-active: #2563eb;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent-live: #10b981;
  --accent-paused: #6b7280;
  --accent-hover: #3b82f6;
  --footer-bg: rgba(8, 8, 8, 0.94);
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-bottom: 14px;
  user-select: none;
}

/* Barra Superior Mínima (Sem Logotipos) */
/* Barra Superior Mínima (Sem Logotipos) */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background-color: #040404;
  border-bottom: 1px solid #141414;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 10px;
  min-width: 0;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.active-indicator {
  width: 9px;
  height: 9px;
  background-color: var(--accent-live);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-live);
  animation: pulse 2s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

.stream-counter {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Seletor de Perfil de Layout na Barra Superior (à direita dos canais em exibição) */
.layout-profile-picker {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: 6px;
  padding-left: 8px;
  border-left: 1px solid #1f1f1f;
}

.layout-profile-select {
  background-color: #121212;
  color: #f3f4f6;
  border: 1px solid #2b2b2b;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 105px;
  min-width: 90px;
  max-width: 115px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.layout-profile-select:hover {
  border-color: #3b82f6;
  background-color: #181818;
}

.layout-profile-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.layout-profile-select option {
  background-color: #121212;
  color: #ffffff;
  padding: 6px;
}

/* Container Central com o Dropdown Select */
.top-bar-center {
  flex: 1;
  max-width: 580px;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.select-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.select-label {
  display: none;
}

.channel-picker-select {
  flex: 1;
  min-width: 200px;
  max-width: 460px;
  background-color: #121212;
  color: #f3f4f6;
  border: 1px solid #2b2b2b;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-picker-select:hover {
  border-color: #3b82f6;
  background-color: #181818;
}

.channel-picker-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.channel-picker-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  border-color: #1f1f1f;
  background-color: #0c0c0c;
  color: #6b7280;
}

.channel-picker-select option {
  background-color: #121212;
  color: #ffffff;
  padding: 6px;
}

/* Ações da Barra Superior */
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-action {
  background-color: #141414;
  color: #d1d5db;
  border: 1px solid #262626;
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-action:hover {
  background-color: #222222;
  color: #ffffff;
  border-color: #3b3b3b;
}

/* ✅ icone dentro do badge ( Gerenciar / Recarregar / Mudo ) */
.btn-action { display: inline-flex; align-items: center; gap: 6px; }
.btn-ico { width: 14px; height: 14px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-action.is-refreshing .btn-ico { animation: spin 0.8s linear infinite; }
/* ✅ Thumbnails automáticos ligados: botão azul (ícone gira enquanto há atualização em andamento) */
.btn-action.is-active { color: #60a5fa; border-color: rgba(96, 165, 250, 0.6); background-color: rgba(59, 130, 246, 0.12); }

.layout-selector {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.layout-selector select {
  background-color: #141414;
  color: #e5e7eb;
  border: 1px solid #262626;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
}

/* Grade Responsiva com Tamanho Mínimo Calculado */
.grid-container {
  display: grid;
  padding: 14px;
  gap: 12px;
  width: 100%;
  flex: 1;
  grid-template-columns: repeat(auto-fit, minmax(clamp(300px, 22vw, 460px), 1fr)); /* ✅ 4 colunas em 1366–1920px */
  align-content: start;
  align-items: start;
}

/* ✅ Auto Adaptativo: 4 colunas fixas a partir de 900px (vale também com zoom/escala do Windows) */
@media (min-width: 900px) {
  .grid-container:not([class*="layout-grid-"]) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 2400px) {
  .grid-container:not([class*="layout-grid-"]) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.grid-container.layout-grid-1 {
  grid-template-columns: 1fr;
  max-width: 1100px;
  margin: 0 auto;
}

.grid-container.layout-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-container.layout-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-container.layout-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-container.layout-grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

.grid-container.layout-grid-6 {
  grid-template-columns: repeat(6, 1fr);
}

/* Janela / Card de Streaming Arrastável */
.stream-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  height: fit-content;
}

.stream-card:hover {
  border-color: #333333;
}

.stream-card.is-playing {
  border-color: rgba(59, 130, 246, 0.45);
}

.stream-footer {
  cursor: default;
}

/* Área do Vídeo */
.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.video-freeze-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
  pointer-events: none;
  z-index: 2;
}

.video-freeze-frame.show {
  display: block;
}

.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #000000;
  display: block;
  z-index: 1;
}

/* Indicador de Carregamento */
.video-loader {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #9ca3af;
  font-size: 11px;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 5;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.stream-card.is-ready .video-loader {
  opacity: 0;
  display: none;
}

/* ✅ Canal em PLAY juntando buffer após travar: spinner central com "Bufferizando..." */
.video-loader .loader-text-buffering,
.stream-card.is-buffering .video-loader .loader-text-loading {
  display: none;
}

.stream-card.is-buffering .video-loader .loader-text-buffering {
  display: inline;
}

.stream-card.is-ready.is-buffering .video-loader {
  display: flex;
  opacity: 1;
  background: rgba(0, 0, 0, 0.55);
  padding: 10px 14px;
  border-radius: 8px;
}

/* Indicador Central de Play / Pausa / Reload */
.play-overlay-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  background-color: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
  opacity: 0.55;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.play-overlay-badge svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.play-overlay-badge .icon-play {
  margin-left: 2px;
  display: block;
}

.play-overlay-badge .icon-pause {
  display: none;
}

.play-overlay-badge .icon-reload {
  display: none;
}

/* Quando pausado: passar o mouse deixa ligeiramente mais nítido com play */
.stream-card:not(.is-playing):not(.is-reloading):hover .play-overlay-badge {
  opacity: 0.85;
  background-color: rgba(0, 0, 0, 0.65);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Quando em play: oculto por padrão, mas ao passar o mouse mostra PAUSA */
.stream-card.is-playing .play-overlay-badge {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
}

.stream-card.is-playing .play-overlay-badge .icon-play {
  display: none;
}

.stream-card.is-playing .play-overlay-badge .icon-pause {
  display: block;
}

.stream-card.is-playing:not(.is-reloading):hover .play-overlay-badge {
  opacity: 0.75;
  transform: translate(-50%, -50%) scale(1);
  background-color: rgba(0, 0, 0, 0.65);
  border-color: rgba(255, 255, 255, 0.35);
}

/* NO MOMENTO DO RELOAD: troca o ícone de play por reload girando no centro (APENAS se não estiver em play) */
.stream-card.is-reloading:not(.is-playing) .play-overlay-badge {
  opacity: 0.95 !important;
  transform: translate(-50%, -50%) scale(1) !important;
  background-color: rgba(0, 0, 0, 0.75) !important;
  border-color: rgba(96, 165, 250, 0.6) !important;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.4) !important;
}

.stream-card.is-reloading:not(.is-playing) .play-overlay-badge .icon-play,
.stream-card.is-reloading:not(.is-playing) .play-overlay-badge .icon-pause {
  display: none !important;
}

.stream-card.is-reloading:not(.is-playing) .play-overlay-badge .icon-reload {
  display: block !important;
  animation: spinReload 0.85s linear infinite;
  color: #60a5fa;
}

/* Quando em player ao vivo, o ícone de reload central NUNCA deve aparecer */
.stream-card.is-playing .play-overlay-badge .icon-reload {
  display: none !important;
}

.stream-card.is-reloading .reload-btn svg {
  animation: spinReload 0.85s linear infinite;
  color: #60a5fa;
}

@keyframes spinReload {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Feedback de Clique Rápido */
.click-feedback {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.click-feedback.show {
  opacity: 1;
}

/* Pé da Janela do Canal */
.stream-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: #0c0c0c;
  border-top: 1px solid #181818;
  min-height: 40px;
}

.channel-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

/* ✅ Alça de arrasto e feedback do Drag & Drop das janelas */
.drag-handle {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: #52525b;
  cursor: grab;
}

.drag-handle svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.drag-handle:hover {
  color: #a1a1aa;
}

.stream-card.is-dragging {
  opacity: 0.45;
}

.stream-card.drag-over {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.channel-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-paused);
  flex-shrink: 0;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.stream-card.is-playing .channel-status-dot {
  background-color: var(--accent-live);
  box-shadow: 0 0 6px var(--accent-live);
}

.channel-name {
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 4px;
  border-bottom: 1px dashed transparent;
  transition: all 0.15s ease;
}

.channel-name:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
  border-bottom-color: rgba(255, 255, 255, 0.35);
}

.channel-name-input {
  background-color: #161616;
  border: 1px solid #3b82f6;
  border-radius: 4px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 1px 6px;
  outline: none;
  width: 100%;
  max-width: 170px;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.stream-footer-actions {
  display: flex;
  align-items: center;
  gap: 0; /* ✅ ícones mais próximos */
  flex-shrink: 0;
}

.card-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  padding: 4px 3px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.card-btn:hover {
  color: #ffffff;
  background-color: #1e1e1e;
}

.card-btn.reload-btn:hover svg {
  transform: rotate(180deg);
}

.card-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.card-btn.fav-btn {
  color: #71717a;
}

/* ✅ Play/Pausa e Expandir/Recolher: ícone acompanha o estado do card */
.card-btn .icon-btn-pause,
.card-btn .icon-btn-collapse {
  display: none;
}

.stream-card.is-playing .play-btn .icon-btn-play,
.stream-card.is-expanded .expand-btn .icon-btn-expand {
  display: none;
}

.stream-card.is-playing .play-btn .icon-btn-pause,
.stream-card.is-expanded .expand-btn .icon-btn-collapse {
  display: block;
}

.stream-card.is-playing .play-btn {
  color: #60a5fa;
}

/* ✅ Tela cheia: ícones mais espaçados e sem o "X" (remover fica só na janela normal) */
.stream-card.is-expanded .stream-footer-actions {
  gap: 10px;
}

.stream-card.is-expanded .card-btn {
  padding: 6px;
}

.stream-card.is-expanded .card-btn svg {
  width: 18px;
  height: 18px;
}

.stream-card.is-expanded .remove-btn,
.stream-card.is-expanded .drag-handle {
  display: none;
}

.card-btn.fav-btn:hover {
  color: #fbbf24;
  background-color: rgba(251, 191, 36, 0.15);
}

.card-btn.fav-btn.is-fav {
  color: #fbbf24;
}

.card-btn.fav-btn svg {
  fill: transparent;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.card-btn.fav-btn.is-fav svg {
  fill: #fbbf24;
  stroke: #fbbf24;
  filter: drop-shadow(0 0 3px rgba(251, 191, 36, 0.4));
}

/* Modo Expandido (2 Cliques para Expandir / 2 Cliques para Recolher) */
.stream-card.is-expanded {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border: none !important;
  border-radius: 0 !important;
  background-color: #000000 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.stream-card.is-expanded .video-wrapper {
  flex: 1;
  height: calc(100vh - 46px);
  aspect-ratio: auto;
}

.stream-card.is-expanded .stream-footer {
  background-color: #040404;
  border-top: 1px solid #1a1a1a;
  padding: 10px 24px;
  height: 46px;
}

.stream-card.is-expanded .channel-name {
  font-size: 15px;
  max-width: 500px;
}

/* Responsividade */
@media (max-width: 768px) {
  .top-bar {
    flex-wrap: wrap;
  }
  .top-bar-center {
    order: 3;
    max-width: 100%;
    width: 100%;
  }
  .grid-container {
    grid-template-columns: 1fr;
    padding: 8px;
    gap: 8px;
  }
  .top-bar-actions .layout-selector {
    display: none;
  }
}

/* Botão Gerenciar Lista */
.btn-manage {
  background-color: #1a1a1a;
  border-color: #333333;
  color: #e5e7eb;
}
.btn-manage:hover {
  background-color: #27272a;
  border-color: #52525b;
}

/* Modal de Gerenciamento da Lista de Canais */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 50px 16px 20px;
  animation: fadeIn 0.2s ease;
  overflow-y: auto;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background-color: #0c0c0c;
  border: 1px solid #262626;
  border-radius: 12px;
  width: 100%;
  max-width: 630px;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 10px;
  border-bottom: 1px solid #1a1a1a;
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  color: #f4f4f5;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #a1a1aa;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  color: #ffffff;
  background-color: #27272a;
}

.modal-description {
  font-size: 12px;
  color: #71717a;
  padding: 10px 20px 0;
}

/* Caixa para Adicionar Canal à Lista */
.modal-add-box {
  padding: 12px 20px 4px;
}

.modal-add-form {
  display: flex;
  gap: 10px;
  align-items: center;
  background-color: #121212;
  border: 1px solid #222222;
  padding: 8px 12px;
  border-radius: 8px;
}

.modal-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.modal-input.url-input {
  width: 100%;
  background-color: #1a1a1a;
  border: 1px solid #2e2e2e;
  border-radius: 6px;
  padding: 8px 32px 8px 12px;
  color: #f4f4f5;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}

.modal-input.url-input:focus {
  border-color: #3b82f6;
}

.btn-input-clear {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #71717a;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  z-index: 2;
}

.btn-input-clear:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.15);
}

.btn-input-clear svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.btn-modal-add {
  background-color: #2563eb;
  border: 1px solid #1d4ed8;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-modal-add:hover {
  background-color: #1d4ed8;
}

.btn-modal-add:disabled {
  background-color: #1e3a8a;
  border-color: #1e3a8a;
  color: #bfdbfe;
  cursor: not-allowed;
}

.modal-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 8px;
}

.modal-search-bar input {
  flex: 1;
  background-color: #171717;
  border: 1px solid #2e2e2e;
  border-radius: 6px;
  padding: 8px 12px;
  color: #f4f4f5;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.modal-search-bar input:focus {
  border-color: #3b82f6;
}

.modal-count-badge {
  font-size: 11px;
  color: #a1a1aa;
  background-color: #1f1f23;
  padding: 5px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
  background-color: #27272a;
  border-radius: 3px;
}

/* Linha do Canal com Colunas e Lixeira Discreta */
.channel-manage-item,
.manage-item {
  display: flex;
  align-items: center;
  padding: 7px 12px;
  background-color: #121212;
  border: 1px solid #1f1f1f;
  border-radius: 6px;
  gap: 12px;
  transition: background-color 0.15s, border-color 0.15s;
}

.channel-manage-item:hover,
.manage-item:hover {
  background-color: #171717;
  border-color: #2a2a2a;
}

/* Botão Favorito com Estrela na Lista */
.channel-fav-btn {
  background: transparent;
  border: none;
  color: #52525b;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
  line-height: 1;
}

.channel-fav-btn:hover {
  color: #fbbf24;
  background-color: rgba(251, 191, 36, 0.14);
  transform: scale(1.15);
}

.channel-fav-btn.is-fav {
  color: #fbbf24;
}

.channel-fav-btn svg {
  width: 16px;
  height: 16px;
  fill: transparent;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
  transition: all 0.15s ease;
}

.channel-fav-btn.is-fav svg {
  fill: #fbbf24;
  stroke: #fbbf24;
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.45));
}

/* Coluna 1: Nome do Canal */
.channel-manage-col-name {
  flex: 1.3;
  min-width: 0;
  display: flex;
  align-items: center;
}

.channel-manage-name {
  font-size: 13px;
  font-weight: 500;
  color: #f4f4f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  border-bottom: 1px dashed transparent;
  transition: all 0.15s ease;
}

.channel-manage-name:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
  border-bottom-color: rgba(255, 255, 255, 0.4);
}

.channel-manage-name-input {
  background-color: #161616;
  border: 1px solid #3b82f6;
  border-radius: 4px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  padding: 2px 6px;
  outline: none;
  width: 100%;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* Coluna 2: Domínio do Site & Comparação de Streaming */
.channel-manage-col-domain {
  flex: 1.4;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  cursor: help;
}

.channel-manage-domain {
  font-size: 12px;
  color: #a1a1aa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  cursor: help;
  transition: color 0.15s ease;
}

.channel-manage-col-domain:hover .channel-manage-domain {
  color: #60a5fa;
  text-decoration: underline dotted;
}

.channel-stream-badge {
  font-size: 11px;
  color: #38bdf8;
  background-color: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.22);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  cursor: help;
  flex-shrink: 1;
  transition: all 0.15s ease;
}

.channel-manage-col-domain:hover .channel-stream-badge {
  background-color: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.45);
}

/* ✅ Coluna 3: URL do Streaming */
.channel-manage-col-stream {
  flex: 2;
  min-width: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  cursor: copy;
}

.channel-manage-col-stream .channel-stream-badge {
  max-width: 100%;
  cursor: copy;
}

.channel-manage-col-stream:hover .channel-stream-badge {
  background-color: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.45);
}

.channel-stream-badge.is-empty {
  color: #52525b;
  background-color: transparent;
  border-color: #27272a;
}

/* Coluna 4: Ação (Lixeira Discreta) */
.channel-manage-col-action {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.channel-delete-btn,
.btn-delete-channel {
  background: transparent;
  border: none;
  color: #52525b;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.channel-delete-btn:hover,
.btn-delete-channel:hover {
  background-color: rgba(239, 68, 68, 0.14);
  color: #ef4444;
}

.channel-delete-btn svg,
.btn-delete-channel svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.modal-empty {
  text-align: center;
  color: #71717a;
  padding: 30px;
  font-size: 13px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid #1a1a1a;
  background-color: #080808;
}

.btn-modal-secondary {
  background: transparent;
  border: 1px solid #333333;
  color: #a1a1aa;
  padding: 7px 13px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-modal-secondary:hover {
  background-color: #18181b;
  color: #f4f4f5;
  border-color: #4b5563;
}

.btn-modal-primary {
  background-color: #2563eb;
  border: 1px solid #1d4ed8;
  color: #ffffff;
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-modal-primary:hover {
  background-color: #1d4ed8;
}

/* Ícone de reload do card gira enquanto o thumbnail (canal em pausa) é atualizado */
.stream-card.is-thumb-updating .reload-btn svg {
  animation: spinReload 0.85s linear infinite;
  color: #60a5fa;
}

/* Enquanto o stream ainda não carregou, o loader central já indica o progresso */
.stream-card:not(.is-ready) .play-overlay-badge {
  display: none;
}

/* ==========================================================================
   Modal de Gerenciamento de Layouts (Idêntico ao Gerenciador de Canais)
   ========================================================================== */
.layout-manage-item {
  display: flex;
  align-items: center;
  padding: 7px 12px;
  background-color: #121212;
  border: 1px solid #1f1f1f;
  border-radius: 6px;
  gap: 12px;
  transition: background-color 0.15s, border-color 0.15s;
}

.layout-manage-item:hover {
  background-color: #171717;
  border-color: #2a2a2a;
}

.layout-manage-col-name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.layout-manage-name {
  font-size: 13px;
  font-weight: 500;
  color: #f4f4f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
}

.layout-manage-name:hover {
  color: #60a5fa;
  background-color: #1a1a1a;
}

.layout-manage-name-input {
  width: 100%;
  background-color: #171717;
  border: 1px solid #3b82f6;
  border-radius: 4px;
  padding: 3px 6px;
  color: #f4f4f5;
  font-size: 13px;
  font-weight: 500;
  outline: none;
}

.layout-manage-col-action {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.layout-manage-stats {
  font-size: 11px;
  color: #71717a;
  white-space: nowrap;
  margin-left: auto;
}

/* Badge no título do modal de canais indicando o layout atual */
.layout-badge {
  color: #60a5fa;
  font-weight: 600;
  background-color: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 12px;
}
