/* YouTube Downloader By Shozi v1.1.6
 * Public UI intentionally mirrors the original Shozi downloader design.
 */
.ytbs{
  --primary:#c00000;
  --primary-hover:#9e0000;
  --info:#0ea5b7;
  --info-hover:#0a8291;
  --ok:#22c55e;
  --muted:#6b7280;
  --bg:#ffffff;
  --card:#ffffff;
  --border:#e5e7eb;
  --shadow:0 10px 30px rgba(0,0,0,.08);
  font-family:"Poppins",system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  color:#111827;
  max-width:1180px;
  margin:2.5rem auto;
  padding:0 1rem;
}
.ytbs *{box-sizing:border-box}
.ytbs [hidden]{display:none!important}
.ytbs main-p,.ytbs .ytbs-form-title{
  display:block;
  text-align:center;
  font-size:clamp(1.2rem,2.5vw,2rem);
  font-weight:800;
  margin:0 0 1.25rem;
  color:#111827;
  white-space:normal;
  overflow:hidden;
  text-overflow:ellipsis;
  padding:0 1rem;
}
.ytbs .downloader-wrapper{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:var(--shadow);
  padding:clamp(1rem,3vw,2rem);
}
.ytbs .url-input-group{display:flex;gap:.6rem;align-items:center;margin-bottom:1.25rem}
.ytbs .ytbs-url{
  flex:1 1 auto;
  height:44px;
  border:2px solid var(--border);
  border-radius:10px;
  padding:0 .9rem;
  font-size:16px;
  background:#fff;
  color:#111827;
  transition:border-color .15s ease,box-shadow .15s ease;
}
.ytbs .ytbs-url:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 4px rgba(192,0,0,.12)}
.ytbs .ytbs-url.invalid{border-color:#e63946;outline:none}
.ytbs .ytbs-paste{
  background:#eef2f7;color:#1f2937;border:none;height:44px;padding:0 14px;border-radius:10px;cursor:pointer;
}
.ytbs .ytbs-paste:hover{background:#e7ecf4}
.ytbs .ytbs-fetch{
  background:var(--primary);color:#fff;border:none;height:44px;padding:0 18px;border-radius:10px;cursor:pointer;font-weight:700;
}
.ytbs .ytbs-fetch:hover{background:var(--primary-hover)}
.ytbs .ytbs-fetch:disabled{background:#bbb;cursor:not-allowed}

/* Loader + error */
.ytbs .ytbs-loader{margin:1.25rem auto 0;text-align:center}
.ytbs .ytbs-loader .spinner{width:44px;height:44px;border-radius:50%;border:5px solid #eee;border-top-color:var(--primary);animation:ytbs-spin 1s linear infinite;margin:0 auto 10px}
.ytbs .ytbs-loader .loader-text{margin:0;color:#4b5563;font-weight:600;font-size:.95rem;line-height:1.45}
.ytbs .ytbs-loader-title{color:#374151}
.ytbs .ytbs-loader-sub{color:#64748b;font-size:.9rem}
@keyframes ytbs-spin{to{transform:rotate(360deg)}}
.ytbs .ytbs-msg,.ytbs-public-notice{margin:.75rem 0 0;padding:.9rem 1rem;background:#f8fafc;border:1px solid #dbe3ec;color:#334155;border-radius:10px}
.ytbs .ytbs-msg.error,.ytbs-public-notice.error{background:#fee2e2;border-color:#fecaca;color:#7f1d1d}

/* Video header */
.ytbs .video-info-header{
  display:grid;grid-template-columns:120px 1fr;gap:14px;align-items:center;background:#fafafa;border:1px solid var(--border);border-radius:12px;padding:12px;margin-bottom:14px;
}
.ytbs .ytbs-thumb{width:100%;height:auto;aspect-ratio:16/9;border-radius:8px;object-fit:cover;background:#eef2f7}
.ytbs .ytbs-title{font-size:1.05rem;font-weight:700;margin:0 0 6px}
.ytbs .ytbs-duration{color:#475569;margin:0}

/* Tabs */
.ytbs .tabs{display:flex;gap:.5rem;background:#f3f4f6;border-radius:10px;padding:6px;margin:14px 0 6px}
.ytbs .tab-link{flex:1;background:transparent;border:none;border-radius:8px;padding:8px 10px;cursor:pointer;font-weight:700;color:#374151}
.ytbs .tab-link.active{background:#fff;color:var(--primary);box-shadow:0 2px 6px rgba(0,0,0,.06)}
.ytbs .tab-content{display:none}
.ytbs .tab-content.active{display:block}
.ytbs .tab-content h3{margin:16px 0 10px;font-size:1rem;color:#1f2937}

/* Original format tables */
.ytbs table{width:100%;border-collapse:collapse;background:#fff;border:1px solid var(--border);border-radius:12px;overflow:hidden;box-shadow:0 2px 10px rgba(0,0,0,.03)}
.ytbs thead th{background:#f8fafc;text-align:left;color:#1f2937;font-weight:800;padding:12px 14px;border-bottom:1px solid var(--border)}
.ytbs tbody td{padding:12px 14px;border-bottom:1px solid var(--border)}
.ytbs tbody tr:last-child td{border-bottom:0}
.ytbs tbody tr:hover{background:#fafcff}
.ytbs td:last-child,.ytbs td.action-cell{text-align:right;white-space:nowrap}
.ytbs .button-container{background:#f9fafb;border:1px solid var(--border);border-radius:8px;padding:8px;margin:8px 0;text-align:center}
.ytbs .dl-btn,.ytbs .dl-btn-audio,.ytbs .button-download-now,.ytbs .danger{
  display:inline-flex;align-items:center;justify-content:center;font-family:inherit;font-weight:700;font-size:14px;line-height:1;padding:10px 14px;border-radius:8px;border:0;cursor:pointer;transition:transform .04s ease,box-shadow .2s ease,background-color .2s ease;box-shadow:0 6px 14px rgba(0,0,0,.06)
}
.ytbs .dl-btn,.ytbs .dl-btn-audio,.ytbs .button-download-now{background:var(--primary);color:#fff;box-shadow:0 6px 16px rgba(192,0,0,.18)}
.ytbs .dl-btn:hover,.ytbs .dl-btn-audio:hover,.ytbs .button-download-now:hover{background:var(--primary-hover);box-shadow:0 8px 20px rgba(158,0,0,.22)}
.ytbs .dl-btn:active,.ytbs .dl-btn-audio:active{transform:translateY(1px);box-shadow:0 4px 10px rgba(0,0,0,.12)}

/* Current production progress engine, styled to match original form */
.ytbs .ytbs-progress{background:#f9fafb;border:1px solid var(--border);border-radius:12px;padding:16px;margin:10px 0 0;text-align:center}
.ytbs .ytbs-progress-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:8px}
.ytbs .ytbs-stage{font-weight:700;color:#374151;text-align:left}
.ytbs .ytbs-percent{font-size:13px;font-weight:800;color:#475569}
.ytbs .ytbs-progress-track{height:26px;background:#e5e7eb;border-radius:14px;overflow:hidden;margin:0 auto 10px;box-shadow:inset 0 1px 2px rgba(0,0,0,.05)}
.ytbs .ytbs-progress-track i{display:block;width:0;height:100%;background:linear-gradient(90deg,#705cff 0%,#6f78ff 42%,#63c8b4 100%);transition:width .3s ease;border-radius:14px}
.ytbs .ytbs-progress-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:35px}
.ytbs .ytbs-bytes{font-size:12px;color:#64748b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ytbs .ytbs-cancel{background:#ef4444;color:#fff;box-shadow:none}
.ytbs .ytbs-cancel:hover{background:#dc2626}
.ytbs .ytbs-complete{text-align:center;margin-top:10px}

@media(max-width:640px){
  .ytbs{padding:0 .7rem;margin:1.4rem auto}
  .ytbs .url-input-group{flex-wrap:wrap}
  .ytbs .ytbs-url{width:100%;flex-basis:100%}
  .ytbs .ytbs-paste{order:2}
  .ytbs .ytbs-fetch{order:3;width:100%}
  .ytbs .video-info-header{grid-template-columns:1fr;text-align:center}
  .ytbs table.responsive,.ytbs table.responsive thead,.ytbs table.responsive tbody,.ytbs table.responsive th,.ytbs table.responsive td,.ytbs table.responsive tr{display:block;width:100%}
  .ytbs table.responsive thead{display:none}
  .ytbs table.responsive tbody tr{border:1px solid var(--border);border-radius:12px;padding:12px 14px;margin:16px 0;box-shadow:0 2px 10px rgba(0,0,0,.03);background:#fff}
  .ytbs table.responsive tbody td{border:none;padding:8px 0;display:block;text-align:left}
  .ytbs table.responsive tbody td:before{content:attr(data-label);display:block;color:#6b7280;font-size:11px;font-weight:700;margin-bottom:5px}
  .ytbs table.responsive td.action-cell{text-align:left;white-space:normal}
  .ytbs table.responsive td.action-cell:before{display:none}
  .ytbs .dl-btn,.ytbs .dl-btn-audio{width:100%}
}


/* v1.3.6 instant YouTube preview + patience keeper */
.ytbs .ytbs-result.is-looking-up .video-info-header{
  position:relative;overflow:hidden;
  animation:ytbs-preview-breathe 2.2s ease-in-out infinite;
}
.ytbs .ytbs-result.is-looking-up .video-info-header::after{
  content:"";position:absolute;inset:0 auto 0 -45%;width:34%;pointer-events:none;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.72),transparent);
  transform:skewX(-16deg);animation:ytbs-preview-shimmer 2.3s ease-in-out infinite;
}
.ytbs .ytbs-thumb.is-preview{filter:saturate(.94);animation:ytbs-thumb-pulse 2s ease-in-out infinite}
.ytbs .ytbs-result.is-looking-up .ytbs-title{color:#1f2937}
.ytbs .ytbs-result.is-looking-up .ytbs-duration{color:#64748b}
.ytbs .ytbs-loader{padding:.25rem 0 .35rem}
.ytbs .ytbs-loader .loader-text{max-width:720px;margin-left:auto;margin-right:auto}
@keyframes ytbs-preview-shimmer{0%{left:-45%}55%,100%{left:125%}}
@keyframes ytbs-preview-breathe{0%,100%{box-shadow:0 0 0 rgba(192,0,0,0)}50%{box-shadow:0 8px 28px rgba(15,23,42,.07)}}
@keyframes ytbs-thumb-pulse{0%,100%{opacity:1}50%{opacity:.88}}
@media (prefers-reduced-motion:reduce){
  .ytbs .ytbs-result.is-looking-up .video-info-header,.ytbs .ytbs-result.is-looking-up .video-info-header::after,.ytbs .ytbs-thumb.is-preview{animation:none}
}


/* v1.3.7 thumbnail-first extraction patience UI */
.ytbs .ytbs-result.is-looking-up .video-info-header{
  grid-template-columns:160px minmax(0,1fr);
  padding:16px;
}
.ytbs .ytbs-result.is-looking-up .ytbs-title{
  font-size:1.08rem;
  margin-bottom:8px;
}
.ytbs .ytbs-result.is-looking-up .ytbs-duration{
  min-height:1.5em;
  transition:opacity .18s ease;
}
.ytbs .ytbs-lookup-notice{
  margin-top:12px;
  padding:10px 12px;
  border:1px solid #fde68a;
  border-radius:9px;
  background:#fffbeb;
  color:#854d0e;
  font-size:.88rem;
  line-height:1.45;
  animation:ytbs-notice-in .25s ease-out both;
}
.ytbs .ytbs-lookup-notice strong{color:#713f12}
@keyframes ytbs-notice-in{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:640px){
  .ytbs .ytbs-result.is-looking-up .video-info-header{grid-template-columns:1fr;text-align:left}
  .ytbs .ytbs-result.is-looking-up .ytbs-thumb{max-width:260px;margin:0 auto}
}
@media (prefers-reduced-motion:reduce){.ytbs .ytbs-lookup-notice{animation:none}}


/* v1.3.8 mobile-centered extraction patience UI */
@media(max-width:640px){
  .ytbs .ytbs-result.is-looking-up .video-info-header{
    text-align:center;
    justify-items:center;
    align-items:center;
  }
  .ytbs .ytbs-result.is-looking-up .video-details{
    width:100%;
    text-align:center;
  }
  .ytbs .ytbs-result.is-looking-up .ytbs-title,
  .ytbs .ytbs-result.is-looking-up .ytbs-duration,
  .ytbs .ytbs-result.is-looking-up .ytbs-lookup-notice{
    text-align:center;
    margin-left:auto;
    margin-right:auto;
  }
  .ytbs .ytbs-result.is-looking-up .ytbs-duration{
    max-width:320px;
  }
  .ytbs .ytbs-result.is-looking-up .ytbs-lookup-notice{
    max-width:340px;
  }
}


/* v1.3.12 — polished patience copy + independent real extraction route telemetry */
.ytbs .ytbs-live-route{
  margin-top:8px;
  padding:7px 10px;
  border-radius:8px;
  background:#eff6ff;
  border:1px solid #bfdbfe;
  color:#1e40af;
  font-size:.84rem;
  line-height:1.4;
  font-weight:600;
  transition:opacity .18s ease, transform .18s ease;
}
.ytbs .ytbs-live-route.is-warning{background:#fff7ed;border-color:#fed7aa;color:#9a3412}
.ytbs .ytbs-live-route.is-success{background:#f0fdf4;border-color:#bbf7d0;color:#166534}
.ytbs .ytbs-live-route.is-error{background:#fef2f2;border-color:#fecaca;color:#991b1b}
@media(max-width:640px){
  .ytbs .ytbs-result.is-looking-up .ytbs-live-route{
    max-width:340px;
    margin-left:auto;
    margin-right:auto;
    text-align:center;
  }
}
