@import url("theme.css");

/* SEO landing pages */
.landing-body { padding-bottom: 40px; }

.landing-topbar {
  width: min(900px, 94vw);
}

.landing-main {
  width: min(900px, 94vw);
  margin: 0 auto;
  padding: 24px 0 40px;
}

.landing-main h1 {
  text-align: center;
  font-size: clamp(1.75rem, 4.5vw, 2.4rem);
  margin: 0 0 10px;
  line-height: 1.15;
  background: linear-gradient(90deg, var(--text) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  text-align: center;
  color: var(--muted);
  margin: 0 auto 28px;
  max-width: 560px;
  font-size: 1rem;
  line-height: 1.6;
}

.search-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 14px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}

.converter-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.loading-wrap {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}
.loading-wrap.active { display: flex; }

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
  min-height: 1.2em;
  line-height: 1.4;
}
.status.is-error { color: var(--error); }
.status .download-fallback-link {
  color: var(--cyan);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.video-panel {
  display: none;
  margin: 16px 0 0;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  animation: fadeUp 0.35s ease;
  box-shadow: var(--shadow);
}
.video-panel.show { display: block; }

.preview-layout {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 280px);
  gap: 16px;
  padding: 16px;
  align-items: start;
}
.preview-stack { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
.preview-stack .actions-col { padding-top: 4px; }
.player-col { min-width: 0; }

.thumb-frame {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0a1020;
  border: 1px solid var(--border);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.video-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-title {
  margin: 12px 0 4px;
  font-size: 1rem;
  line-height: 1.35;
  text-align: center;
  font-weight: 700;
}
.video-channel {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
}

.actions-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
}

.action-btn {
  width: 100%;
  border: 0;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform var(--transition), filter var(--transition), opacity var(--transition);
}
button.action-btn { font-family: inherit; }
.action-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; }
.action-btn.primary {
  background: linear-gradient(135deg, var(--cta), var(--cta-hover));
  color: #fff;
  box-shadow: 0 8px 22px rgba(225, 29, 72, 0.28);
}
.action-btn.ghost {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.action-btn-hd {
  background: rgba(56, 189, 248, 0.1);
  color: var(--text);
  border: 1px solid rgba(56, 189, 248, 0.28);
}
.action-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.04); }
.action-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.quality-label {
  margin: 0 0 4px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}
.quality-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.quality-tag.free { background: rgba(16, 185, 129, 0.15); color: var(--ok); }
.quality-tag.pro { background: rgba(56, 189, 248, 0.15); color: var(--cyan); }

.panel-download-progress {
  display: none;
  margin: 14px 16px 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.panel-download-progress.active { display: block; animation: fadeUp 0.35s ease; }
.panel-download-progress[hidden] { display: none !important; }
.panel-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.84rem;
}
.panel-progress-title { color: var(--text); font-weight: 600; }
.panel-progress-pct {
  color: var(--cyan);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 2.5rem;
  text-align: right;
}
.panel-progress-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--surface-solid);
  overflow: hidden;
  border: 1px solid var(--border);
}
.panel-progress-value {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cta), var(--cyan), var(--ok));
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.panel-progress-label {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.seo-copy {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.seo-copy h2 {
  margin: 20px 0 8px;
  font-size: 1.15rem;
}
.seo-copy h2:first-child { margin-top: 0; }
.seo-copy p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.65;
}

@media (max-width: 640px) {
  .converter-form { grid-template-columns: 1fr; }
  .preview-layout { grid-template-columns: 1fr; }
  .action-btn { min-height: 46px; }
  .btn { width: 100%; min-height: 46px; }
  .input { font-size: 16px; min-height: 46px; }
}
