/* ===== Shozi YT Downloader – Red theme, mobile-first ===== */
#shozi-downloader {
  --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: 960px;
  margin: 2.5rem auto;
  padding: 0 1rem;
}

#shozi-downloader main-p {
  display: block;
  text-align: center;
  font-size: clamp(1.2rem, 2.5vw, 2.0rem);
  font-weight: 800;
  margin: 0 0 1.25rem;
  color: #111827;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 1rem;
}

#shozi-downloader .downloader-wrapper {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: clamp(1rem, 3vw, 2rem);
}

/* input row */
#shozi-downloader .url-input-group {
  display: flex;
  gap: .6rem;
  align-items: center;
  margin-bottom: 1.25rem;
}
#shozi-downloader #video-url {
  flex: 1 1 auto;
  height: 44px;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0 .9rem;
  font-size: 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#shozi-downloader #video-url:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(192,0,0,.12);
}
#shozi-downloader #paste-btn {
  background: #eef2f7;
  color: #1f2937;
  border: none;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  cursor: pointer;
}
#shozi-downloader #paste-btn:hover { background: #e7ecf4; }
#shozi-downloader #get-video-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}
#shozi-downloader #get-video-btn:hover { background: var(--primary-hover); }
#shozi-downloader #get-video-btn:disabled { background: #bbb; cursor: not-allowed; }

/* loader + error */
#shozi-downloader .loader {
  display: none;
  margin: 1.25rem auto 0;
  text-align: center;
}
#shozi-downloader .loader .spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 5px solid #eee; border-top-color: var(--primary);
  animation: spin 1s linear infinite;
  margin: 0 auto 10px auto;
}
#shozi-downloader .loader .loader-text {
  margin: 0;
  color: #4b5563;
  font-weight: 600;
  font-size: .95rem;
}
@keyframes spin { to { transform: rotate(360deg) } }

#shozi-downloader .error-notice {
  display: none;
  margin: .75rem 0 0;
  padding: .9rem 1rem;
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
  border-radius: 10px;
}

/* video header */
#shozi-downloader .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;
}
#shozi-downloader #video-thumbnail {
  width: 100%; height: auto; border-radius: 8px; object-fit: cover;
}
#shozi-downloader #video-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 6px; }
#shozi-downloader #video-duration { color: #475569; margin: 0; }

/* tabs */
#shozi-downloader .tabs {
  display: flex; gap: .5rem;
  background: #f3f4f6; border-radius: 10px; padding: 6px; margin: 14px 0 6px;
}
#shozi-downloader .tab-link {
  flex: 1; background: transparent; border: none; border-radius: 8px;
  padding: 8px 10px; cursor: pointer; font-weight: 700; color: #374151;
}
#shozi-downloader .tab-link.active {
  background: #fff; color: var(--primary);
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

/* progress */
#shozi-downloader .progress-container {
  display: none;
  background: #f9fafb; border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; margin: 10px 0 0;
  text-align: center;
}
#shozi-downloader #progress-status {
  font-weight: 700; color: #374151; margin-bottom: 8px;
}
#shozi-downloader .progress-bar-wrapper {
  height: 26px; background: #e5e7eb; border-radius: 14px; overflow: hidden; margin: 0 auto 10px;
}
#shozi-downloader #progress-bar {
  width: 0%; height: 100%;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  transition: width .35s ease;
}
#shozi-downloader #cancel-btn {
  background: #ef4444; color: #fff; border: none; border-radius: 10px; padding: 8px 14px; cursor: pointer;
}
#shozi-downloader #cancel-btn:hover { background: #dc2626; }

/* final download */
#shozi-downloader #post-complete-actions { display: none; }
#shozi-downloader #download-now-btn {
  background: var(--primary); color: #fff; border: none; border-radius: 10px; padding: 10px 16px; font-weight: 800; cursor: pointer;
}
#shozi-downloader #download-now-btn:hover { background: var(--primary-hover); }

/* tables */
#shozi-downloader 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);
}
#shozi-downloader thead th {
  background: #f8fafc; text-align: left; color: #1f2937; font-weight: 800;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
#shozi-downloader tbody td {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
#shozi-downloader tbody tr:hover { background: #fafcff; }
#shozi-downloader td:last-child,
#shozi-downloader td.action-cell { text-align: right; white-space: nowrap; }

/* action buttons (unified base) */
#shozi-downloader .dl-btn,
#shozi-downloader .dl-btn-audio,
#shozi-downloader .button-download-now,
#shozi-downloader .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);
}

/* video buttons */
#shozi-downloader .dl-btn-instant { background: var(--primary); color: #fff; }
#shozi-downloader .dl-btn-instant:hover { background: var(--primary-hover); }
#shozi-downloader .dl-btn-process { background: var(--info); color: #fff; }
#shozi-downloader .dl-btn-process:hover { background: var(--info-hover); }

/* audio download button (red primary) */
#shozi-downloader .dl-btn-audio {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(192,0,0,.18);
}
#shozi-downloader .dl-btn-audio:hover {
  background: var(--primary-hover);
  box-shadow: 0 8px 20px rgba(158,0,0,.22);
}
#shozi-downloader .dl-btn-audio:active,
#shozi-downloader .dl-btn-instant:active,
#shozi-downloader .dl-btn-process:active {
  transform: translateY(1px);
  box-shadow: 0 4px 10px rgba(0,0,0,.12);
}
#shozi-downloader .dl-btn-audio:disabled,
#shozi-downloader .dl-btn-instant:disabled,
#shozi-downloader .dl-btn-process:disabled {
  opacity: .6; cursor: not-allowed; box-shadow: none;
}

/* Button container styling */
#shozi-downloader .button-container {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  margin: 8px 0;
  text-align: center;
}

/* ---------- Loader label spacing on all sizes ---------- */
#shozi-downloader .loader { text-align: center; }
#shozi-downloader .loader .spinner { margin: 0 auto 10px auto; }
#shozi-downloader .loader p { margin: 0; }

/* ---------- Responsive cards for phones ---------- */
@media (max-width: 640px) {
  /* form stack */
  #shozi-downloader .url-input-group { flex-wrap: wrap; }
  #shozi-downloader #paste-btn { order: 2; }
  #shozi-downloader #get-video-btn { order: 3; width: 100%; }

  /* header stack */
  #shozi-downloader .video-info-header { grid-template-columns: 1fr; text-align: center; }

  /* turn table rows into cards */
  #shozi-downloader table.responsive,
  #shozi-downloader table.responsive thead,
  #shozi-downloader table.responsive tbody,
  #shozi-downloader table.responsive th,
  #shozi-downloader table.responsive td,
  #shozi-downloader table.responsive tr { display: block; width: 100%; }

  #shozi-downloader table.responsive thead { display: none; }

  #shozi-downloader 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;
  }

  /* show label ABOVE value */
  #shozi-downloader table.responsive tbody td {
    border: none;
    padding: 8px 0;
    display: block;
    text-align: left;
  }
  #shozi-downloader table.responsive
  /* Highlight invalid YouTube URL input */
  
#video-url.invalid {
  border-color: #e63946;
  outline: none;
}
