/* ================== RESET BÁSICO ================== */
*{margin:0;padding:0;box-sizing:border-box;}

body{
  background:#f3f3f3;
  font-family:Arial, sans-serif;
}

/* ================== CONTAINER PRINCIPAL ================== */
.container{
  width:100%;
  max-width:600px;
  max-height:90vh;
  overflow-y:auto;
  overflow-x:hidden;
  margin:20px auto;
  background:#fff;
  padding:20px 25px;
  border-radius:8px;
  box-shadow:0 3px 12px rgba(0,0,0,.1);
  text-align:center;
}

/* ================== ÁREA DE BUSCA ================== */
.search-container{width:100%;margin-bottom:25px;}

.search-input-wrapper{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
}

.search-icon{
  position:absolute;left:0;top:50%;transform:translateY(-50%);
  width:28px;height:28px;fill:red;z-index:2;margin-left:8px;
}

#searchInput{
  flex:1;font-size:16px;border:none;border-bottom:3px solid transparent;
  padding:8px 20px 8px 45px;margin-right:10px;
  border-image:linear-gradient(to right,#e95959,#ebcbc2,#ebcbc2,#e95959) 1;
  transition:.3s;
}
#searchInput.typing{
  border-image:linear-gradient(to right,#43ce43,#c3ebc2,#c3ebc2,#43ce43) 1;
}
#searchInput:focus{outline:none;}

/* ================== BOTÃO “BUSCAR” ================== */
#searchButton{
  background:linear-gradient(135deg,#67c1ff,#007bff);
  color:#fff;border:none;border-radius:20px;font-size:16px;cursor:pointer;
  padding:8px 20px;box-shadow:0 2px 6px rgba(0,0,0,.1);
  transition:transform .3s, box-shadow .3s;
}
#searchButton:hover:not(.inactive-button){
  transform:translateY(-2px);box-shadow:0 4px 12px rgba(0,0,0,.15);
}
.inactive-button{background:#ccc!important;cursor:not-allowed;box-shadow:none!important;transform:none!important;}

/* ================== TEXTO DE CARREGAMENTO ================== */
#loading{margin-top:10px;font-size:16px;color:#c0392b;font-weight:bold;animation:blink 1.5s infinite;display:none;}
@keyframes blink{0%{opacity:1;}50%{opacity:.2;}100%{opacity:1;}}
.hidden{display:none!important;}

/* ================== LISTA DE CANAIS ================== */
.results-list{list-style:none;padding:0;margin:0;}
.results-list li{
  display:flex;align-items:center;gap:15px;
  margin-bottom:10px;padding:10px 12px;border:1px solid #e0e0e0;
  border-radius:8px;transition:.2s;cursor:pointer;background:#fafafa;
}
.results-list li:hover{transform:scale(1.01);box-shadow:0 2px 8px rgba(0,0,0,.1);}
.channel-image{width:50px;height:50px;border-radius:50%;}

/* cartão especial */
.results-list li.single-btn{display:block;text-align:center;}

/* ================== TÍTULOS SELEÇÃO ================== */
.selected-title{font-style:italic;margin-bottom:12px;display:none;font-size:1.1rem;color:#555;}
.selected-channel{border:2px dashed #888;padding:15px;margin-bottom:15px;word-wrap:break-word;background:#fcfcfc;}

/* ================== BOTÕES DE AÇÃO ================== */
.action-buttons{display:flex;justify-content:center;gap:15px;margin-top:15px;}
.action-buttons button{
  border:none;font-size:15px;color:#fff;border-radius:20px;padding:10px 20px;cursor:pointer;
  transition:.3s;box-shadow:0 2px 6px rgba(0,0,0,.1);
}
.action-buttons button:hover{transform:translateY(-2px);box-shadow:0 4px 12px rgba(0,0,0,.15);}
#increaseSubscribersBtn{background:linear-gradient(135deg,#6eea92,#28a745);}
#increaseViewsBtn{background:linear-gradient(135deg,#55e4ed,#17a2b8);}

/* ================== LISTA DE VÍDEOS ================== */
#videoListContainer{margin-top:20px;text-align:left;}
#videoListContainer h2{text-align:center;margin-bottom:12px;font-size:1.2rem;color:#444;}

.video-list{list-style:none;padding:8px;margin:0 auto;max-height:250px;overflow-y:auto;border:1px solid #e0e0e0;border-radius:8px;background:#fafafa;}
.video-list li{
  position:relative;
  display:flex;align-items:center;gap:15px;margin-bottom:10px;padding:10px 12px;
  border:1px solid #ddd;border-radius:6px;transition:.2s;background:#fff;cursor:pointer;
}
.video-list li:hover{transform:scale(1.01);box-shadow:0 2px 8px rgba(0,0,0,.1);}
.video-thumbnail{width:80px;height:80px;object-fit:cover;border-radius:4px;}
.selected-video-item{border:2px solid green!important;}
.selected-video-item::after{
  content:'Selecionado';
  position:absolute;right:8px;top:8px;
  background:#28a745;color:#fff;font-weight:bold;
  font-size:12px;padding:2px 6px;border-radius:4px;
}

/* ================== BOTÃO "CARREGAR MAIS VÍDEOS" ================== */
.load-more-btn{
  background:linear-gradient(135deg,#ffda6e,#ffc107);color:#333;border:none;
  border-radius:20px;font-size:15px;padding:10px 20px;cursor:pointer;
  margin:10px auto 20px;display:block;transition:.3s;
  max-width:100%;white-space:normal;line-height:1.3;
}
.load-more-btn:hover{transform:translateY(-2px);box-shadow:0 4px 12px rgba(0,0,0,.15);}

/* ================== VÍDEO SELECIONADO ================== */
#selectedVideoContainer{margin-top:25px;}
.selected-video{border:2px dashed #888;padding:15px;margin-bottom:15px;word-wrap:break-word;background:#fcfcfc;text-align:center;}
.selected-video img{width:auto;height:120px;object-fit:contain;border-radius:4px;margin-bottom:8px;}
#selectedVideoTitle{margin-bottom:12px;font-size:1.1rem;font-style:italic;color:#555;}

/* ================== BOTÕES "IMPULSIONAR" ================== */
.copy-link-btn{
  background:linear-gradient(135deg,#ff4d4d,#c40000);
  color:#fff!important;
  text-shadow:0 0 2px rgba(0,0,0,.25);
  border:none;border-radius:20px;
  font-size:15px;font-weight:bold;
  cursor:pointer;padding:10px 20px;margin-top:10px;
  box-shadow:0 0 10px rgba(255,255,255,.85);
  transition:transform .3s, box-shadow .3s;
  animation:pulse 1.6s ease-in-out infinite;
  max-width:100%;white-space:normal;line-height:1.3;
}
.copy-link-btn:hover{
  animation:none;                       /* pausa pulsar */
  transform:translateY(-2px) scale(1.05);
  box-shadow:0 0 14px rgba(255,255,255,.95);
}

/* animação pulsante */
@keyframes pulse{
  0%  {transform:scale(1);    box-shadow:0 0 10px rgba(255,255,255,.85);}
  50% {transform:scale(1.05); box-shadow:0 0 16px rgba(255,255,255,1);}
  100%{transform:scale(1);    box-shadow:0 0 10px rgba(255,255,255,.85);}
}

/* ================== BADGE “CANAL CONECTADO” ================== */
.copy-link-info{
  margin-top:10px;font-size:14px;
  font-weight:bold;
  color:#fff;background:#28a745;
  padding:5px 8px;border-radius:12px;
  display:inline-flex;align-items:center;gap:6px;
}
.copy-link-info svg{width:1em;height:1em;fill:#fff;}

/* ================== MENSAGENS DE REDIRECIONAMENTO ================== */
.redirect-msg{
  margin-top:8px;
  font-size:15px;
  font-weight:bold;
  color:#007bff;
  display:flex;align-items:center;gap:6px;
}
.redirect-msg svg{width:1.1em;height:1.1em;fill:#28a745;}

/* ================== CONTAGEM (antiga) – mantida p/ fallback ======= */
.redirect-count{margin-top:5px;font-size:14px;color:#d35400;font-weight:bold;}

/* BOTÕES SECUNDÁRIOS PADRÃO (exceto três principais) */
button:not(#searchButton):not(#increaseSubscribersBtn):not(#increaseViewsBtn){
  font-size:15px;padding:10px 20px;border-radius:20px;
}

/* ================== MOBILE (≤480px) ================== */
@media(max-width:480px){
  #searchButton,
  .action-buttons button,
  .copy-link-btn,
  .load-more-btn{
    font-size:14px;
    padding:8px 16px;
  }
  .action-buttons{flex-direction:column;gap:10px;}
}

/* =====================================================
   LOADER (ícone azul + líquido vermelho + texto piscando)
===================================================== */
#loading:not(.hidden){
  display:flex!important;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  min-height:160px;
}

.loader-icon{position:relative;width:84px;margin:0 auto}
.loader-icon svg{width:100%;height:auto;display:block}
.loader-icon .svg-base{fill:#007bff;}
.loader-fill{
  position:absolute;top:0;left:0;width:100%;height:0;overflow:hidden;
  animation:fillDown 1.2s linear infinite;
}
.loader-fill svg{fill:#d80027;}
@keyframes fillDown{0%{height:0}100%{height:100%}}

.loader-text{
  margin-top:10px;text-align:center;font-weight:bold;
  animation:colorBlink 1s linear infinite;
}
@keyframes colorBlink{
  0%  {color:#d80027;}
  33% {color:#000;}
  66% {color:#fff;}
 100% {color:#d80027;}
}