﻿/* ============================================================
   YTX Hub  Professional SaaS Design
   ============================================================ */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Variables */
:root {
  --accent:       #6c63ff;
  --accent2:      #a78bfa;
  --accent-dark:  #4f46e5;
  --accent-glow:  rgba(108,99,255,0.35);
  --bg:           #07070f;
  --bg2:          #0d0d1a;
  --surface:      #12121f;
  --surface2:     #1a1a2e;
  --surface3:     #22223a;
  --border:       rgba(255,255,255,0.10);
  --border2:      rgba(108,99,255,0.30);
  --text:         #eeeeff;
  --text-muted:   #9898c0;
  --text-dim:     #606088;
  --green:        #10d98a;
  --green-dark:   #0ab872;
  --red:          #ff5c7a;
  --yellow:       #fbbf24;
  --radius:       16px;
  --radius-sm:    10px;
  --shadow:       0 8px 40px rgba(0,0,0,0.6);
  --shadow-accent:0 0 40px rgba(108,99,255,0.2);
}

/* Body */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 16px 100px;
  overflow-x: hidden;
  position: relative;
}

/*  Animated background  */
.bg-blobs {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
}
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.12;
  animation: blobFloat 18s ease-in-out infinite;
}
.blob-1 { width: 600px; height: 600px; background: #6c63ff; top: -200px; left: -150px; animation-delay: 0s; }
.blob-2 { width: 500px; height: 500px; background: #a78bfa; bottom: -100px; right: -100px; animation-delay: -6s; }
.blob-3 { width: 400px; height: 400px; background: #10d98a; top: 40%; left: 50%; animation-delay: -12s; }
@keyframes blobFloat {
  0%,100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(30px,-40px) scale(1.05); }
  66%      { transform: translate(-20px,30px) scale(0.95); }
}

/*  Container  */
.container {
  width: 100%; max-width: 780px;
  position: relative; z-index: 1;
  padding-top: 56px;
}

/*  Header  */
header { text-align: center; margin-bottom: 48px; }

.logo {
  display: inline-flex; align-items: center; gap: 14px;
  margin-bottom: 20px; text-decoration: none;
}
.logo-img {
  width: 52px; height: 52px; border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 0 24px var(--accent-glow);
}
.logo-text {
  font-size: 2rem; font-weight: 800; letter-spacing: -0.03em;
  color: var(--text); line-height: 1;
}
.logo-text .logo-accent { color: var(--accent); }

.tagline {
  font-size: 1.05rem; font-weight: 500;
  color: var(--text); margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.subtitle {
  font-size: 0.82rem; color: var(--text-muted);
  letter-spacing: 0.04em; margin-bottom: 20px;
}

/* ── Platform badges ── */
.platform-badges {
  display: flex; justify-content: center;
  gap: 8px; flex-wrap: wrap;
}
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.75rem; font-weight: 600;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid; letter-spacing: 0.02em;
  transition: transform 0.2s, box-shadow 0.2s;
}
.badge:hover { transform: translateY(-2px); }
.badge-yt  { color: #ff4444; border-color: rgba(255,68,68,0.3);  background: rgba(255,68,68,0.07); }
.badge-vk  { color: #5b8cff; border-color: rgba(91,140,255,0.3); background: rgba(91,140,255,0.07); }
.badge-rt  { color: #ff8c00; border-color: rgba(255,140,0,0.3);  background: rgba(255,140,0,0.07); }

/* ── ffmpeg warning ── */
.ffmpeg-warn {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(251,191,36,0.07);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 0.84rem;
  color: #fcd34d; margin-bottom: 20px; line-height: 1.55;
}
.ffmpeg-warn svg { flex-shrink: 0; margin-top: 2px; color: var(--yellow); }
.ffmpeg-warn a { color: #fcd34d; text-decoration: underline; }

/* ── Search section ── */
.search-section { margin-bottom: 28px; }

.search-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow), var(--shadow-accent);
  transition: border-color 0.3s;
}
.search-card:focus-within {
  border-color: var(--border2);
  box-shadow: var(--shadow), 0 0 0 3px rgba(108,99,255,0.12);
}

.input-group { display: flex; gap: 10px; }

.input-wrap {
  flex: 1; position: relative; display: flex; align-items: center;
}
.input-icon {
  position: absolute; left: 14px;
  color: var(--text-dim); pointer-events: none; flex-shrink: 0;
}
.input-wrap input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.97rem;
  padding: 14px 16px 14px 42px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.input-wrap input:focus {
  border-color: var(--accent);
  background: var(--surface3);
}
.input-wrap input::placeholder { color: var(--text-dim); }

/*  Buttons  */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.93rem; font-weight: 600;
  padding: 14px 22px;
  transition: all 0.2s ease;
  text-decoration: none; white-space: nowrap;
  position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s;
}
.btn:hover::after { background: rgba(255,255,255,0.06); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; min-width: 120px; justify-content: center;
  box-shadow: 0 4px 20px rgba(108,99,255,0.4);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(108,99,255,0.55); }

.btn-download {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff; justify-content: center; width: 100%;
  box-shadow: 0 4px 20px rgba(16,217,138,0.3);
  font-size: 1rem; padding: 15px 22px;
}
.btn-download:hover { box-shadow: 0 6px 28px rgba(16,217,138,0.45); }

.btn-secondary {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface3); }

.btn-cancel {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.82rem; padding: 8px 16px;
  margin-top: 14px;
}
.btn-cancel:hover { color: var(--red); border-color: rgba(255,92,122,0.4); background: rgba(255,92,122,0.06); }

.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/*  Feature pills  */
.feature-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; margin-top: 14px;
}
.pill {
  font-size: 0.75rem; color: var(--text-muted);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 12px;
  letter-spacing: 0.02em;
}

/*  Error  */
.error-msg {
  color: var(--red); font-size: 0.85rem;
  margin-top: 10px; padding: 10px 14px;
  background: rgba(255,92,122,0.08);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--red);
}

/*  Video Card  */
.video-info { margin-bottom: 24px; }

.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; display: flex;
  box-shadow: var(--shadow);
  animation: slideUp 0.35s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.video-thumb {
  position: relative; flex-shrink: 0;
  width: 300px; background: #0a0a14;
  /* Фиксируем соотношение 16:9 */
  aspect-ratio: 16 / 9;
  align-self: stretch;
}
.video-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.thumb-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.video-thumb:hover .thumb-overlay { opacity: 1; }

.duration-badge {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.85); color: #fff;
  font-size: 0.74rem; font-weight: 700;
  padding: 2px 8px; border-radius: 5px;
  letter-spacing: 0.03em;
}

.video-meta {
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 12px;
  flex: 1; min-width: 0; justify-content: center;
}
.meta-top { display: flex; align-items: center; gap: 8px; }

.platform-label {
  font-size: 0.68rem; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.platform-label.yt    { background: rgba(255,68,68,0.12);  color: #ff5555; }
.platform-label.vk    { background: rgba(91,140,255,0.12); color: #6b9fff; }
.platform-label.rt    { background: rgba(255,140,0,0.12);  color: #ff9a1a; }
.platform-label.other { background: rgba(255,255,255,0.06); color: var(--text-muted); }

.video-title {
  font-size: 0.96rem; font-weight: 600; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
  color: var(--text);
}
.uploader { color: var(--text-muted); font-size: 0.82rem; }

.format-selector { display: flex; flex-direction: column; gap: 6px; }
.format-selector label {
  font-size: 0.78rem; color: var(--text-muted);
  font-weight: 500; display: flex; align-items: center; gap: 5px;
}
.format-selector select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.9rem;
  padding: 10px 12px; outline: none; cursor: pointer;
  transition: border-color 0.2s;
}
.format-selector select:focus { border-color: var(--accent); }

/*  Progress  */
.progress-section { margin-bottom: 24px; }

.progress-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease;
}

/* Превью сверху карточки */
.progress-thumb {
  width: 100%; height: 160px;
  object-fit: cover; display: block;
  border-bottom: 1px solid var(--border);
}

.progress-body {
  padding: 20px 24px 20px;
}

/* Название видео */
.progress-title {
  font-size: 0.88rem; font-weight: 600;
  color: var(--text); line-height: 1.45;
  margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* Строка с кольцом и баром */
.progress-row {
  display: flex; gap: 20px; align-items: center;
}

.progress-icon-wrap { flex-shrink: 0; }
.progress-ring-outer {
  position: relative; width: 60px; height: 60px;
  display: flex; align-items: center; justify-content: center;
}
.progress-ring { transform: rotate(-90deg); }
.ring-bg   { stroke: var(--surface3); }
.ring-fill { stroke: var(--accent); transition: stroke-dashoffset 0.5s ease; }
.ring-pct  {
  position: absolute; font-size: 0.7rem; font-weight: 700;
  color: var(--accent); letter-spacing: -0.02em;
}

.progress-info { flex: 1; min-width: 0; }
.progress-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 12px;
}
.progress-status-text { font-size: 0.92rem; font-weight: 600; color: var(--text); }
.progress-pct-text    { font-size: 0.88rem; font-weight: 700; color: var(--accent); }

.progress-bar-wrap {
  background: var(--surface3);
  border-radius: 999px; height: 7px;
  overflow: hidden; margin-bottom: 10px;
  position: relative;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 999px; width: 0%;
  transition: width 0.45s ease;
}
.progress-bar-glow {
  position: absolute; top: 0; left: 0; height: 100%;
  width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(167,139,250,0.6), transparent);
  animation: shimmer 1.5s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}
.progress-meta {
  display: flex; justify-content: space-between;
  font-size: 0.8rem; color: var(--text-muted);
}

/*  Done  */
.done-section { margin-bottom: 24px; }

.done-card {
  background: var(--surface);
  border: 1px solid rgba(16,217,138,0.2);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  display: flex; flex-direction: column;
  align-items: center; gap: 14px;
  box-shadow: var(--shadow), 0 0 40px rgba(16,217,138,0.08);
  animation: slideUp 0.35s ease;
}
.done-anim svg { overflow: visible; }
.done-circle {
  stroke-dasharray: 226; stroke-dashoffset: 226;
  animation: drawCircle 0.6s ease forwards 0.1s;
}
.done-check {
  stroke-dasharray: 60; stroke-dashoffset: 60;
  animation: drawCheck 0.4s ease forwards 0.65s;
}
@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawCheck  { to { stroke-dashoffset: 0; } }

.done-title { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.done-sub   { font-size: 0.88rem; color: var(--text-muted); margin-top: -6px; }

/*  How it works  */
.how-section {
  margin-top: 52px; margin-bottom: 0;
  padding: 36px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.how-title {
  font-size: 1.1rem; font-weight: 700;
  text-align: center; margin-bottom: 28px;
  color: var(--text); letter-spacing: -0.01em;
}
.steps { display: flex; flex-direction: column; gap: 20px; }
.step  { display: flex; align-items: flex-start; gap: 16px; }
.step-num {
  flex-shrink: 0; width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 800; color: #fff;
  box-shadow: 0 4px 14px rgba(108,99,255,0.4);
}
.step-text { display: flex; flex-direction: column; gap: 3px; padding-top: 6px; }
.step-text strong { font-size: 0.93rem; font-weight: 600; color: var(--text); }
.step-text span   { font-size: 0.83rem; color: var(--text-muted); line-height: 1.5; }

/*  Footer  */
footer {
  text-align: center; margin-top: 52px;
  padding-bottom: 32px;
}
.footer-links {
  display: flex; justify-content: center; align-items: center;
  gap: 12px; margin-bottom: 8px;
}
.footer-links a {
  color: var(--accent); font-size: 0.82rem; font-weight: 500;
  text-decoration: none; opacity: 0.8;
  transition: opacity 0.2s;
}
.footer-links a:hover { opacity: 1; }
.footer-links span { color: var(--text-dim); font-size: 0.7rem; }
.footer-copy { color: var(--text-dim); font-size: 0.75rem; }

/*  Utility  */
.hidden { display: none !important; }

/*  Error page  */
.error-page-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 56px 48px;
  box-shadow: var(--shadow);
}
.error-code {
  font-size: 6rem; font-weight: 900;
  line-height: 1; letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 16px;
}
.error-message {
  font-size: 1.1rem; color: var(--text-muted); font-weight: 500;
}

/*  Responsive  */
@media (max-width: 600px) {
  .container { padding-top: 28px; }
  .logo-text  { font-size: 1.5rem; }
  .logo-img   { width: 38px; height: 38px; }
  header { margin-bottom: 28px; }

  /* Видео-карточка: вертикальная на мобиле */
  .video-card  { flex-direction: column; }
  .video-thumb { width: 100%; height: 200px; }
  .video-meta  { padding: 14px 16px; gap: 10px; }
  .video-title { font-size: 0.9rem; -webkit-line-clamp: 3; }
  .uploader    { font-size: 0.78rem; }
  .format-selector select { font-size: 0.85rem; padding: 9px 10px; }
  .btn-download { font-size: 0.95rem; padding: 13px 16px; }

  /* Прогресс-карточка: превью скрываем — экономим место */
  .progress-thumb { display: none; }
  .progress-body  { padding: 16px; }
  .progress-title { font-size: 0.84rem; margin-bottom: 12px; }
  .progress-row   { gap: 14px; }

  .input-group { flex-direction: column; }
  .btn-primary { width: 100%; justify-content: center; }
  .how-section { padding: 20px 16px; }
  .done-card   { padding: 32px 16px; }
}

@media (max-width: 400px) {
  .feature-pills .pill:nth-child(n+4) { display: none; }
}
