/* ============================================================
   iList / DyList — Design System v4.0
   UX rewrite: z-index fix, entrada visível, danger zone,
   controles em grupos, estado vazio, proporcões melhores
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; }

/* ── TOKENS ── */
:root {
  --bg:            #060B14;
  --surface:       #0B1623;
  --surface2:      #0d1b2a;
  --surface3:      #1e293b;
  --border:        rgba(255,255,255,0.07);
  --border-solid:  #1e293b;
  --accent:        #FF9900;
  --accent-glow:   rgba(255,153,0,0.20);
  --accent-soft:   rgba(255,153,0,0.10);
  --cyan:          #06b6d4;
  --green:         #10b981;
  --red:           #ef4444;
  --amber:         #f59e0b;
  --purple:        #8b5cf6;
  --text:          #f1f5f9;
  --muted:         #94a3b8;
  --muted2:        #64748b;
  --mono:          'JetBrains Mono', monospace;
  --sans:          'Syne', sans-serif;
  --radius:        14px;
  --radius-sm:     8px;
  --grad-bar:      linear-gradient(90deg, #06b6d4, #FF9900, #ef4444);
  --shadow:        0 4px 32px rgba(0,0,0,0.5);

  /* ── Z-INDEX STACKING — hierarquia clara ── */
  --z-base:        auto;   /* box e sidebar: sem stacking context próprio */
  --z-modal:       10000;  /* modais: acima de tudo */
  --z-overlay:     19999;  /* darkOverlay */
  --z-toast:       20000;  /* toasts */
}

/* ── NOISE TEXTURE ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

/* Glow orb de fundo */
body::after {
  content: '';
  position: fixed;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(255,153,0,0.04) 0%, transparent 70%);
  top: -150px; left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
}

/* ── BODY ── */
body {
  margin: 0;
  padding: 20px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── MAIN BOX ── */
.box {
  background: var(--surface);
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 700px;
  position: relative;
  z-index: var(--z-base);
  /* sem overflow:hidden para não cortar modais */
}

.box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-bar);
  border-radius: 20px 20px 0 0;
  pointer-events: none;
}

@media (min-width: 1024px) { .box { width: 86%; } }

/* ── TÍTULO ── */
.app-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.app-title .brand-accent { color: var(--accent); }

.app-title .brand-tagline {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted2);
  font-family: var(--mono);
  letter-spacing: 0;
}

/* ── INPUT INTELIGENTE ÚNICO ── */
.url-input-area {
  margin-bottom: 12px;
}

.url-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.url-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--surface3);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.url-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Ícone à esquerda — muda via JS conforme o tipo detectado */
.url-input-icon {
  padding: 0 12px;
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1;
  user-select: none;
  transition: transform 0.2s;
}

.url-input-field {
  flex: 1;
  min-width: 0;
  background: transparent;
  color: var(--text);
  border: none;
  padding: 12px 8px;
  font-size: 14px;
  font-family: var(--sans);
  font-weight: 600;
  outline: none;
}

.url-input-field::placeholder {
  color: var(--muted2);
  font-weight: 400;
}

/* Botão de busca externo */
.url-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--amber));
  border: none;
  border-radius: var(--radius-sm);
  color: #000;
  cursor: pointer;
  margin-left: 0;
  transition: all 0.2s;
  box-shadow: 0 0 14px var(--accent-glow);
}

.url-search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,153,0,0.4);
  background: linear-gradient(135deg, #e68900, var(--amber));
}

/* Indicador de tipo detectado abaixo do input */
.url-type-indicator {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 700;
  animation: fadeIn 0.15s ease;
}

.url-type-indicator.show { display: flex; }

.url-type-indicator.type-video  { background: rgba(16,185,129,0.08);  color: var(--green);  border: 1px solid rgba(16,185,129,0.2);  }
.url-type-indicator.type-canal  { background: rgba(6,182,212,0.08);   color: var(--cyan);   border: 1px solid rgba(6,182,212,0.2);   }
.url-type-indicator.type-lista  { background: rgba(139,92,246,0.08);  color: var(--purple); border: 1px solid rgba(139,92,246,0.2);  }
.url-type-indicator.type-busca  { background: rgba(255,153,0,0.08);   color: var(--accent); border: 1px solid rgba(255,153,0,0.2);   }

/* ── BOTÃO CRIAR CATEGORIA (agora sozinho na action-row) ── */
.action-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: stretch;
}

.btn-criar-categoria {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--sans);
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-criar-categoria {
  background: linear-gradient(135deg, var(--accent), var(--amber));
  color: #000;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-criar-categoria:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255,153,0,0.35);
}

.btn-buscar-videos {
  background: linear-gradient(135deg, var(--purple), #7c3aed);
  color: #fff;
  box-shadow: 0 0 16px rgba(139,92,246,0.2);
}

.btn-buscar-videos:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139,92,246,0.35);
}

.btn-equalizador-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--sans);
  transition: all 0.2s;
  white-space: nowrap;
  background: linear-gradient(135deg, #0e7490, #0284c7);
  color: #fff;
  box-shadow: 0 0 14px rgba(6,182,212,0.2);
  flex-shrink: 0;
}

.btn-equalizador-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6,182,212,0.4);
  background: linear-gradient(135deg, #0891b2, #0369a1);
}

/* ── BTN PRIMARY genérico ── */
.btn-primary {
  background: var(--cyan);
  color: #fff;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #0891b2;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(6,182,212,0.3);
}

/* ── INPUTS base ── */
input, button {
  padding: 10px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--sans);
}

input {
  background: var(--surface3);
  color: var(--text);
  border: 1px solid var(--border-solid);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

button {
  background: var(--cyan);
  color: #fff;
  cursor: pointer;
  margin-left: 10px;
  font-weight: 700;
  transition: all 0.2s;
}

button:hover {
  background: #0891b2;
  transform: translateY(-2px);
}

/* ── IFRAME (PLAYER) ── */
iframe {
  margin-top: 20px;
  width: 100%;
  height: 400px;
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

/* ── PLAYER CONTROLS ── */
.player-controls-advanced {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: var(--radius);
  margin-top: 16px;
}

.progress-container {
  width: 100%;
  height: 5px;
  background: var(--surface3);
  border-radius: 3px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: height 0.15s;
}

.progress-container:hover { height: 7px; }

.progress-bar {
  height: 100%;
  background: var(--grad-bar);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
  font-family: var(--mono);
}

.main-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
}

.control-btn {
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text);
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 17px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  transform: scale(1.1);
  box-shadow: 0 0 20px var(--accent-glow);
}

.control-btn-primary {
  background: #04a6e9;
  border-color: #04a6e9;
  color: #fff;
  width: 54px; height: 54px;
  font-size: 22px;
  box-shadow: 0 0 28px rgba(4,166,233,0.35);
}

.control-btn-primary:hover {
  background: #0394d0;
  box-shadow: 0 0 40px rgba(4,166,233,0.5);
  transform: scale(1.08);
  color: #fff;
}

/* ── SECONDARY CONTROLS — 2 GRUPOS ── */
.secondary-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

/* separador visual entre grupos */
.controls-divider {
  width: 1px;
  height: 24px;
  background: var(--border-solid);
  flex-shrink: 0;
  margin: 0 2px;
}

.control-btn-small {
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0 11px;
  height: 32px;
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--sans);
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s;
  margin-left: 0;
}

.control-btn-small:hover {
  background: var(--accent-soft);
  border-color: rgba(255,153,0,0.3);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-oled {
  background: rgba(0,0,0,0.5);
  border-color: rgba(255,255,255,0.08);
}

.btn-oled:hover {
  background: #000;
  border-color: var(--amber);
  color: var(--amber) !important;
  box-shadow: 0 0 12px rgba(245,158,11,0.2);
}

.btn-tutoriais {
  background: rgba(102,126,234,0.12);
  border-color: rgba(102,126,234,0.28);
  color: #a5b4fc;
}

.btn-tutoriais:hover {
  background: rgba(102,126,234,0.22);
  border-color: rgba(102,126,234,0.5);
  color: #c7d2fe !important;
  box-shadow: 0 0 12px rgba(102,126,234,0.25);
  transform: translateY(-1px);
}

.speed-control,
.timer-control-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.speed-control label,
.timer-control-inline label {
  font-size: 10px;
  color: var(--muted2);
  font-family: var(--mono);
  white-space: nowrap;
}

.speed-select,
.timer-select {
  background: var(--surface3);
  color: var(--text);
  border: 1px solid var(--border-solid);
  padding: 0 8px;
  height: 32px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--sans);
  cursor: pointer;
  min-width: 68px;
  transition: border-color 0.2s;
  margin-left: 0;
}

.speed-select:hover, .speed-select:focus {
  border-color: var(--accent);
  outline: none;
}

.timer-select:hover, .timer-select:focus {
  border-color: var(--green);
  outline: none;
}

#timerDisplay {
  font-size: 11px;
  color: var(--green);
  font-family: var(--mono);
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── PLAYLIST ACTIONS — 3 ZONAS ── */
.playlist-zone {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Zona 1: reprodução */
.zone-play {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Zona 2: seleção */
.zone-select {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Zona 3: perigo — isolada com borda vermelha */
.zone-danger {
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: rgba(239,68,68,0.03);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zone-danger-label {
  font-size: 10px;
  font-family: var(--mono);
  color: rgba(239,68,68,0.5);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 2px;
}

.playlist-zone button {
  width: 100%;
  margin-left: 0;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-family: var(--sans);
  padding: 11px;
  font-size: 13px;
  transition: all 0.2s;
}

/* Botões por tipo */
.btn-play-all {
  background: linear-gradient(135deg, var(--accent), var(--amber));
  color: #000;
  border: none;
  box-shadow: 0 0 16px var(--accent-glow);
}

.btn-play-all:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255,153,0,0.35);
}

.btn-play-selected {
  background: var(--surface3);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-play-selected:hover {
  border-color: rgba(255,153,0,0.3);
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-select-all {
  background: rgba(139,92,246,0.1);
  color: var(--purple);
  border: 1px solid rgba(139,92,246,0.2);
}

.btn-select-all:hover {
  background: rgba(139,92,246,0.18);
  border-color: rgba(139,92,246,0.4);
  transform: translateY(-1px);
}

.btn-delete-selected {
  background: rgba(245,158,11,0.08);
  color: var(--amber);
  border: 1px solid rgba(245,158,11,0.2);
}

.btn-delete-selected:hover {
  background: rgba(245,158,11,0.16);
  border-color: rgba(245,158,11,0.4);
  transform: translateY(-1px);
}

.btn-clear-all {
  background: rgba(239,68,68,0.08);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}

.btn-clear-all:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(239,68,68,0.3);
}

/* ── DIVIDER GRADIENTE ── */
.grad-divider {
  border: 0;
  height: 1px;
  background: var(--grad-bar);
  border-radius: 2px;
  margin: 16px 0;
  opacity: 0.25;
}

/* ── UTILITY SECTION (install, backup) ── */
.utility-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.utility-label {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 2px;
}

.btn-install-pwa {
  background: linear-gradient(135deg, var(--green), #059669) !important;
  color: #fff;
  width: 100%;
  margin-left: 0;
  border: none;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 0 16px rgba(16,185,129,0.15);
  transition: all 0.2s;
}

.btn-install-pwa:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16,185,129,0.3);
}

.backup-row {
  display: flex;
  gap: 8px;
}

.btn-backup {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--sans);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  margin-left: 0;
}

.btn-backup:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* ── PLAYLIST SIDEBAR ── */
.playlist {
  background: var(--surface);
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  width: 300px;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
  /* SEM position:relative e SEM z-index — não cria stacking context,
     modais do <body> sempre ficam acima */
  flex-shrink: 0;
}

.playlist::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-bar);
  border-radius: 20px 20px 0 0;
  pointer-events: none;
}

/* Wrapper para o ::before funcionar sem criar stacking context na sidebar */
.playlist {
  position: relative; /* necessário só para o ::before — mas sem z-index */
}

.playlist::-webkit-scrollbar { width: 2px; }
.playlist::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 2px;
}

/* ── CATEGORY FILTERS ── */
.category-filters { margin-bottom: 14px; width: 100%; }

.category-select-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-color-indicator {
  width: 22px; height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.15);
}

.category-select {
  flex: 1;
  padding: 10px 14px;
  background: var(--surface3);
  color: var(--text);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--sans);
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23f1f5f9' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  margin-left: 0;
}

.category-select:hover, .category-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background-color: var(--surface2);
}

.category-select option { background: var(--surface2); color: var(--text); }

/* ── PLAYLIST ITEMS ── */
.playlist-item {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13px;
  gap: 8px;
  cursor: move;
  transition: all 0.2s;
  position: relative;
}

.playlist-item:hover {
  background: var(--surface3);
  border-color: rgba(255,153,0,0.2);
  transform: translateX(2px);
}

.playlist-item.dragging { opacity: 0.5; cursor: grabbing; }

.playlist-item.drag-over { border-top: 2px solid var(--accent); }

.playlist-item.now-playing {
  background: linear-gradient(90deg,
    rgba(255,153,0,0.14) 0%,
    rgba(255,153,0,0.05) 100%);
  border-left: 3px solid var(--accent) !important;
  animation: pulse-playing 2.5s ease-in-out infinite;
}

@keyframes pulse-playing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,153,0,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(255,153,0,0); }
}

.playlist-item.now-playing span { color: var(--accent); font-weight: 700; }

.drag-handle {
  color: var(--muted2);
  font-size: 14px;
  cursor: grab;
  display: flex;
  align-items: center;
  user-select: none;
  flex-shrink: 0;
  letter-spacing: 1px;
}

.drag-handle:active { cursor: grabbing; }

.playlist-item > span[title] {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  order: 1;
  font-weight: 600;
  font-size: 13px;
}

.playlist-item > button { display: none; }

/* Checkbox */
.checkbox-container {
  position: relative;
  width: 20px; height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  order: 2;
}

.checkbox-container input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  min-width: 20px; min-height: 20px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  margin: 0; padding: 0; flex-shrink: 0;
}

.checkbox-container input[type="checkbox"]:checked {
  background: var(--accent-soft);
}

.checkbox-container input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.play-number {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 20px; height: 20px;
  background: var(--accent);
  color: #000;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  z-index: 2;
  pointer-events: none;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.playlist-item.selected .play-number { display: flex; }
.playlist-item.selected input[type="checkbox"] { opacity: 0; }

/* ── EMPTY STATE ── */
.playlist-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  gap: 12px;
  border: 1px dashed var(--border-solid);
  border-radius: var(--radius);
  margin: 8px 0;
  opacity: 0;
  animation: fadeInEmpty 0.4s ease 0.2s forwards;
}

@keyframes fadeInEmpty {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.playlist-empty-state .empty-icon {
  font-size: 36px;
  filter: grayscale(0.3);
}

.playlist-empty-state .empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.playlist-empty-state .empty-hint {
  font-size: 12px;
  color: var(--muted2);
  font-family: var(--mono);
  line-height: 1.6;
  max-width: 200px;
}

.playlist-empty-state .empty-hint strong {
  color: var(--accent);
}

/* ── PLAYLIST CONTROLS (sidebar) ── */
.playlist-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}

.playlist-controls button {
  width: 100%;
  margin-left: 0;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-family: var(--sans);
  padding: 11px;
  transition: all 0.2s;
}

/* ── MODALS — z-index correto ── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  justify-content: center;
  align-items: center;
  z-index: var(--z-modal);  /* acima da sidebar */
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--surface2);
  border: 1px solid rgba(255,153,0,0.12);
  padding: 24px;
  border-radius: 18px;
  width: 90%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04);
  animation: scaleIn 0.22s ease forwards;
  position: relative;
  overflow: hidden;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-bar);
  border-radius: 18px 18px 0 0;
}

.modal-content h3 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
  width: 100%;
}

.modal-buttons > button {
  background: var(--cyan);
  color: #fff;
  padding: 11px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--sans);
  width: 100%;
  margin-left: 0;
  transition: all 0.2s;
}

.modal-buttons > button:hover {
  background: #0891b2;
  transform: translateY(-1px);
}

.modal-content > .close-btn {
  margin-top: 10px;
  background: var(--surface3) !important;
  color: var(--muted) !important;
  padding: 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  border: 1px solid var(--border) !important;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  margin-left: 0;
  transition: all 0.2s;
}

.modal-content > .close-btn:hover {
  background: var(--surface3) !important;
  border-color: rgba(239,68,68,0.4) !important;
  color: var(--red) !important;
  transform: translateY(-1px);
}

/* ── CATEGORY MODAL ── */
.category-modal-content {
  max-width: 500px !important;
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
  text-align: left;
}

.category-modal-content::-webkit-scrollbar { width: 4px; }
.category-modal-content::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.category-input {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-solid);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: var(--sans);
  font-weight: 600;
  margin: 10px 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.category-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.color-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s;
}

.color-btn:hover { transform: scale(1.12); }

.color-btn.selected {
  border-color: #fff;
  box-shadow: 0 0 16px rgba(255,255,255,0.4);
}

/* Category nav tabs */
.category-nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
  background: var(--bg);
  padding: 12px;
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}

.category-nav-tab {
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--sans);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  margin-left: 0;
}

.category-nav-tab::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 3px; height: 100%;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform 0.2s;
}

.category-nav-tab:hover {
  background: var(--accent-soft);
  border-color: rgba(255,153,0,0.2);
  color: var(--text);
  transform: translateX(3px);
  box-shadow: none;
}

.category-nav-tab:hover::before { transform: scaleY(1); }

.category-nav-tab.active {
  background: rgba(255,153,0,0.1);
  border-color: rgba(255,153,0,0.3);
  color: var(--accent);
}

.category-nav-tab.active::before { transform: scaleY(1); }
.category-nav-tab-icon { font-size: 17px; flex-shrink: 0; }

.category-tab-content { display: none; }
.category-tab-content.active {
  display: block;
  animation: fadeInTab 0.22s ease;
}

@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.category-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface3);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: all 0.2s;
}

.category-list-item:hover {
  background: var(--accent-soft);
  border-color: rgba(255,153,0,0.2);
  transform: translateX(2px);
}

.color-indicator { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; }

.btn-icon {
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--sans);
  margin-left: 0;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--accent-soft);
  border-color: rgba(255,153,0,0.3);
  color: var(--accent);
  transform: scale(1.05);
  box-shadow: none;
}

.btn-danger { background: rgba(239,68,68,0.1) !important; border-color: rgba(239,68,68,0.25) !important; color: var(--red) !important; }
.btn-danger:hover { background: var(--red) !important; color: #fff !important; transform: scale(1.05); }

/* ── OUTROS BOTÕES ── */
.btn-stats {
  background: linear-gradient(135deg, var(--purple), #7c3aed) !important;
  color: #fff;
  width: 100%; margin-left: 0;
  border: none; padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 0 16px rgba(139,92,246,0.15);
  transition: all 0.2s;
}

.btn-stats:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(139,92,246,0.3); }

.extensions-btn, .categories-btn {
  background: linear-gradient(135deg, var(--accent), var(--amber)) !important;
  color: #000 !important; font-weight: 800 !important;
  box-shadow: 0 0 16px var(--accent-glow);
  transition: all 0.2s;
}

.extensions-btn:hover, .categories-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255,153,0,0.35);
}

/* ── CONFIRM MODAL ── */
#confirmModal .modal-content { border-color: rgba(239,68,68,0.2); }
#confirmModal .modal-content::before { background: var(--red); }

/* ── DARK MODE OVERLAY ── */
#darkModeBtnWrapper {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  margin-bottom: 16px;
}

#darkModeBtn {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; font-size: 15px;
  color: var(--muted); font-family: var(--sans); font-weight: 600;
  background: none; border: none; padding: 0; margin: 0;
  transition: all 0.2s;
}

#darkModeBtn:hover { color: var(--amber); transform: scale(1.05); box-shadow: none; }

#darkOverlay {
  display: none;
  position: fixed; inset: 0;
  background: #000;
  z-index: var(--z-overlay);
  justify-content: center; align-items: center; flex-direction: column;
  color: #FBD697;
  font-family: var(--sans);
  animation: fadeIn 0.5s ease;
  cursor: pointer;
}

#lamp {
  font-size: 52px; cursor: pointer; margin-bottom: 24px;
  animation: lampPulse 2.5s ease-in-out infinite;
  transition: transform 0.3s;
}

#lamp:hover { transform: scale(1.15); }

@keyframes lampPulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.06); }
}

#darkOverlay span {
  cursor: pointer; font-size: 14px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px;
  text-align: center; padding: 0 20px; line-height: 1.6;
  font-family: var(--mono);
}

#darkOverlay::before {
  content: '🔋 Modo OLED/AMOLED';
  position: absolute; top: 30px;
  font-size: 11px; color: var(--green);
  text-transform: uppercase; letter-spacing: 2px;
  opacity: 0.7; font-family: var(--mono);
}

#darkOverlay::after {
  content: 'Economia máxima de bateria | Tela permanece acesa';
  position: absolute; bottom: 30px;
  font-size: 11px; color: var(--muted2);
  text-align: center; padding: 0 20px;
  line-height: 1.5; font-family: var(--mono);
}

/* ── MENSAGEM PIX ── */
#msgPix {
  display: none;
  position: fixed; bottom: 20px; left: 50%;
  transform: translateX(-50%);
  background: var(--accent); color: #000;
  padding: 8px 20px; border-radius: 20px;
  font-size: 13px; font-weight: 800; font-family: var(--mono);
  box-shadow: 0 4px 20px var(--accent-glow);
  z-index: var(--z-toast);
}

/* ── FOOTER ── */
.app-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.copy {
  color: var(--muted2);
  font-size: 11px;
  font-family: var(--mono);
  line-height: 1.8;
}

.copy strong { color: var(--muted); }
.copy .copy-accent { color: var(--accent); }

#instagramFollowBtn {
  background: transparent !important;
  border: 1px solid rgba(255,102,204,0.18) !important;
  border-radius: 10px;
  color: var(--muted) !important;
  padding: 8px 14px;
  font-size: 11px; font-family: var(--mono); font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; margin: 0;
  transition: all 0.2s;
}

#instagramFollowBtn:hover {
  background: rgba(255,102,204,0.06) !important;
  border-color: rgba(255,102,204,0.4) !important;
  color: #FF66CC !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(255,102,204,0.15);
}

/* ── STATS ── */
.stats-modal-content { max-width: 500px !important; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px; margin: 16px 0;
}

.stat-card {
  background: var(--bg);
  padding: 14px;
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.stat-card:hover {
  border-color: rgba(255,153,0,0.3);
  transform: translateY(-2px);
}

.stat-value { font-size: 28px; font-weight: 800; color: var(--accent); margin-bottom: 4px; letter-spacing: -1px; }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; font-family: var(--mono); }

/* ── ANIMATIONS ── */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── KONAMI ── */
@keyframes rainbow { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(360deg); } }
.konami-mode { animation: rainbow 3s linear infinite !important; }

#konami-message {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff; padding: 40px 60px; border-radius: 20px;
  font-size: 28px; font-weight: 800; font-family: var(--sans);
  text-align: center; z-index: 99999;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#konami-message.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  body { flex-direction: column; padding: 8px; }

  .box, .playlist { width: 100%; max-width: 100%; padding: 14px; }
  .playlist { width: 100%; max-height: none; }

  iframe { height: 220px; }
  .player-controls-advanced { padding: 12px; }
  .main-controls { gap: 7px; }
  .control-btn { width: 38px; height: 38px; font-size: 15px; }
  .control-btn-primary { width: 48px; height: 48px; font-size: 18px; }

  .secondary-controls {
    gap: 6px; padding: 8px 10px;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .control-btn-small { padding: 0 9px; font-size: 11px; height: 30px; }
  .speed-select, .timer-select { font-size: 11px; min-width: 60px; height: 30px; }
  .speed-control label, .timer-control-inline label { display: none; }

  .stats-grid { grid-template-columns: 1fr; }

  /* Footer mobile: empilhado, centralizado */
  .app-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  /* Action row mobile: mantém side-by-side, reduz padding */
  .action-row {
    gap: 6px;
  }

  .btn-criar-categoria,
  .btn-buscar-videos {
    padding: 10px 10px;
    font-size: 12px;
    gap: 5px;
  }

  /* URL input mobile: input e botão em linha, botão compacto */
  .url-input-area { gap: 6px; }
  .url-input-field { font-size: 13px; padding: 10px 12px; }
  .url-add-btn { padding: 10px 14px; font-size: 13px; }
}

@media (max-width: 420px) {
  .control-btn { width: 35px; height: 35px; font-size: 14px; }
  .control-btn-primary { width: 44px; height: 44px; font-size: 17px; }

  /* Em telas muito pequenas, esconde o texto dos botões de ação
     e mantém só o ícone SVG */
  .btn-criar-categoria .btn-label,
  .btn-buscar-videos .btn-label { display: none; }
}

/* ══════════════════════════════════════════════
   SMART SEARCH — UI de paginação e resultados
══════════════════════════════════════════════ */

/* Modal da busca inteligente */
#smartSearchModal .modal-content,
#apiKeyModal .modal-content,
#channelVideosModal .modal-content,
#batchConfirmModal > div {
  background: var(--surface2);
  border: 1px solid rgba(255,153,0,0.12);
  border-radius: 18px;
  position: relative;
  overflow: hidden;
}

#smartSearchModal .modal-content::before,
#apiKeyModal .modal-content::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-bar);
  border-radius: 18px 18px 0 0;
}

/* Forçar z-index em todas as modais criadas dinamicamente pelo JS */
#smartSearchModal,
#apiKeyModal,
#channelVideosModal,
#batchConfirmModal {
  z-index: var(--z-modal) !important;
}

/* Barra de pesquisa dentro da busca */
#smartSearchInput {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-solid);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: var(--sans);
  font-weight: 600;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

#smartSearchInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Botão executar busca */
#smartSearchExecuteBtn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--amber));
  color: #000;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 800;
  font-size: 14px;
  font-family: var(--sans);
  cursor: pointer;
  margin-bottom: 14px;
  margin-left: 0;
  transition: all 0.2s;
  box-shadow: 0 0 16px var(--accent-glow);
}

#smartSearchExecuteBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,153,0,0.3);
}

/* Tabs da busca */
.smart-tab {
  background: var(--surface3) !important;
  color: var(--muted) !important;
  border: 1px solid var(--border) !important;
  padding: 7px 14px !important;
  border-radius: var(--radius-sm) !important;
  cursor: pointer;
  font-size: 12px !important;
  font-weight: 700 !important;
  font-family: var(--sans) !important;
  transition: all 0.2s !important;
  margin-left: 0 !important;
}

.smart-tab.active,
.smart-tab[style*="background:#990066"],
.smart-tab[style*="background: #990066"] {
  background: linear-gradient(135deg, var(--accent), var(--amber)) !important;
  color: #000 !important;
  border-color: transparent !important;
  box-shadow: 0 0 12px var(--accent-glow) !important;
}

/* Botão adicionar à lista */
#smartSearchAddBtn {
  width: 100%;
  background: linear-gradient(135deg, var(--green), #059669) !important;
  color: #fff !important;
  padding: 12px !important;
  border-radius: var(--radius-sm) !important;
  border: none !important;
  font-weight: 800 !important;
  font-size: 14px !important;
  font-family: var(--sans) !important;
  cursor: pointer;
  margin-left: 0 !important;
  box-shadow: 0 0 16px rgba(16,185,129,0.2);
  transition: all 0.2s;
}

#smartSearchAddBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16,185,129,0.3);
}

/* ── PAGINAÇÃO ── */
.search-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.search-pagination-info {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
  white-space: nowrap;
}

.search-pagination-info strong {
  color: var(--accent);
}

.search-pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination-per-page {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-per-page label {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted2);
  white-space: nowrap;
}

.pagination-per-page select {
  background: var(--surface3);
  color: var(--text);
  border: 1px solid var(--border-solid);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-family: var(--sans);
  font-weight: 700;
  cursor: pointer;
  height: 28px;
  margin-left: 0;
  transition: border-color 0.2s;
}

.pagination-per-page select:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-pagination {
  background: var(--surface3);
  border: 1px solid var(--border-solid);
  color: var(--text);
  padding: 0 12px;
  height: 30px;
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--sans);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  margin-left: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-pagination:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: rgba(255,153,0,0.3);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-pagination:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-pagination.load-more {
  background: rgba(6,182,212,0.08);
  border-color: rgba(6,182,212,0.2);
  color: var(--cyan);
  width: 100%;
  justify-content: center;
  height: 36px;
  margin-top: 4px;
}

.btn-pagination.load-more:hover:not(:disabled) {
  background: rgba(6,182,212,0.15);
  border-color: rgba(6,182,212,0.4);
  color: var(--cyan);
}

/* Página atual badge */
.pagination-page-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,153,0,0.1);
  border: 1px solid rgba(255,153,0,0.25);
  color: var(--accent);
  border-radius: 6px;
  padding: 0 10px;
  height: 30px;
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 700;
  white-space: nowrap;
}

/* Selecionar tudo / nenhum da página */
.search-page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}

.search-page-actions-left {
  display: flex;
  gap: 6px;
}

.btn-check-action {
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-family: var(--sans);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  margin-left: 0;
  height: 26px;
  display: inline-flex;
  align-items: center;
}

.btn-check-action:hover {
  background: var(--accent-soft);
  border-color: rgba(255,153,0,0.3);
  color: var(--accent);
}

.search-selected-count {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
}

.search-selected-count strong {
  color: var(--accent);
}

/* Item de resultado */
.search-result-item {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: 6px;
  align-items: center;
  transition: background 0.15s;
  cursor: pointer;
}

.search-result-item:nth-child(even) {
  background: rgba(255,255,255,0.025);
}

.search-result-item:hover {
  background: var(--accent-soft);
}

.search-result-item input[type="checkbox"] {
  width: 16px; height: 16px;
  min-width: 16px; min-height: 16px;
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  accent-color: var(--accent);
  flex-shrink: 0;
  margin: 0;
}

.search-result-thumb {
  width: 64px; height: 46px;
  object-fit: cover;
  border-radius: 5px;
  background: var(--surface3);
  flex-shrink: 0;
}

.search-result-title {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Loading state */
#smartSearchLoading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--mono);
}

/* Close btn dentro de modais JS */
#smartSearchCloseBtn,
#cancelApiKeyBtn,
#channelCloseBtn {
  width: 100%;
  background: var(--surface3) !important;
  color: var(--muted) !important;
  border: 1px solid var(--border) !important;
  padding: 10px !important;
  border-radius: var(--radius-sm) !important;
  cursor: pointer;
  font-family: var(--sans) !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  margin-left: 0 !important;
  margin-top: 8px !important;
  transition: all 0.2s !important;
}

#smartSearchCloseBtn:hover,
#cancelApiKeyBtn:hover,
#channelCloseBtn:hover {
  border-color: rgba(239,68,68,0.3) !important;
  color: var(--red) !important;
}