:root {
  --bg: #05060b;
  --surface: rgba(15, 18, 32, 0.72);
  --surface-elevated: rgba(22, 26, 46, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --accent-1: #ff2e63;
  --accent-2: #8b5cf6;
  --accent-3: #06b6d4;
  --gold: #f59e0b;
  --success: #10b981;
  --radius: 22px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
}

/* Luxury Ambient Background */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.34;
  animation: floatOrb 20s ease-in-out infinite alternate;
}

.orb-1 {
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, var(--accent-1), transparent 70%);
  top: -190px;
  left: -140px;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-2), transparent 70%);
  top: 12%;
  right: -200px;
  animation-delay: -7s;
}

.orb-3 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-3), transparent 70%);
  bottom: -190px;
  left: 28%;
  opacity: 0.22;
  animation-delay: -13s;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at 50% 25%, black 35%, transparent 82%);
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(45px, 38px) scale(1.08); }
}

.container {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 22px;
}

/* Navbar */
.navbar {
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  background: rgba(5, 6, 11, 0.58);
  position: sticky;
  top: 0;
  z-index: 30;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  display: grid;
  place-items: center;
  box-shadow: 0 8px 26px rgba(255, 46, 99, 0.4);
}

.brand-icon svg {
  width: 18px;
  height: 18px;
  color: #fff;
}

.brand-text {
  font-weight: 800;
  font-size: 1.28rem;
  letter-spacing: -0.025em;
}

.brand-accent {
  background: linear-gradient(90deg, #ff5f87, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-left: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: #fff;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: #e2e8f0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-green {
  background: var(--success);
  box-shadow: 0 0 12px var(--success);
}

.dot-amber {
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}

/* Main Content & Hero */
.main-content {
  flex: 1;
  padding-top: 60px;
  padding-bottom: 72px;
}

.hero {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 44px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fbcfe8;
  background: linear-gradient(90deg, rgba(255, 46, 99, 0.14), rgba(139, 92, 246, 0.16));
  border: 1px solid rgba(255, 46, 99, 0.3);
  margin-bottom: 22px;
}

.spark-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff4d7d;
  box-shadow: 0 0 10px #ff4d7d;
}

.hero-title {
  font-size: clamp(2.25rem, 5.2vw, 3.7rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.09;
  margin-bottom: 18px;
}

.gradient-text {
  background: linear-gradient(95deg, #ff3e75 0%, #c084fc 48%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.06rem;
  max-width: 620px;
  margin: 0 auto 34px;
}

/* Animated Gradient Glow Border Around Search */
.search-glow-wrap {
  position: relative;
  padding: 1.5px;
  border-radius: 20px;
  background: linear-gradient(120deg, rgba(255, 46, 99, 0.55), rgba(139, 92, 246, 0.45), rgba(6, 182, 212, 0.45));
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.55), 0 0 42px rgba(139, 92, 246, 0.14);
}

.search-shell {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: 18.5px;
  background: rgba(11, 13, 24, 0.94);
  backdrop-filter: blur(20px);
}

.input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 14px;
}

.input-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.input-wrap input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.98rem;
  font-family: inherit;
  padding: 13px 0;
}

.input-wrap input::placeholder {
  color: #64748b;
}

.paste-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.paste-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 13px;
  border: none;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(255, 46, 99, 0.38);
  transition: transform 0.18s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(255, 46, 99, 0.52);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Stats Strip */
.stats-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.stat-pill strong {
  color: #f1f5f9;
  font-weight: 700;
}

.stat-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}

/* Glass Card */
.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(22px);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Preview Card */
.preview-card {
  padding: 28px;
  margin-bottom: 44px;
  animation: slideUp 0.35s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.preview-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 30px;
  align-items: start;
}

.thumb-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  border: 1px solid var(--border-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.duration-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(5, 6, 11, 0.86);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.verified-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #34d399;
  margin-bottom: 6px;
}

.video-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.meta-chip {
  font-size: 0.82rem;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
}

.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.quality-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quality-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.quality-card.active {
  background: linear-gradient(135deg, rgba(255, 46, 99, 0.2), rgba(139, 92, 246, 0.24));
  border-color: rgba(255, 46, 99, 0.75);
  box-shadow: 0 0 0 1px rgba(255, 46, 99, 0.35), 0 10px 24px rgba(255, 46, 99, 0.18);
}

.q-name {
  font-weight: 700;
  font-size: 0.92rem;
}

.q-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.badge-gold {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.badge-purple {
  background: rgba(168, 85, 247, 0.22);
  color: #d8b4fe;
}

.btn-download {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(95deg, #10b981, #06b6d4);
  color: #031512;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.34);
  transition: transform 0.18s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn-download:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 38px rgba(16, 185, 129, 0.48);
}

.btn-download:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Progress Panel */
.progress-panel {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.92rem;
  font-weight: 600;
}

.progress-percent {
  color: #34d399;
  font-weight: 800;
}

.progress-track {
  width: 100%;
  height: 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3));
  transition: width 0.25s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.save-ready-bar {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 13px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.32);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.saved-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #a7f3d0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-secondary {
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Section Blocks */
.section-block {
  margin-top: 56px;
}

.section-heading {
  text-align: center;
  margin-bottom: 26px;
}

.section-kicker {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #c084fc;
  margin-bottom: 6px;
}

.section-heading h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

/* Steps Grid */
.steps-grid,
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.step-card,
.feature-item {
  padding: 26px;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.step-card:hover,
.feature-item:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 0.86rem;
  font-weight: 800;
  color: #fbcfe8;
  background: linear-gradient(135deg, rgba(255, 46, 99, 0.22), rgba(139, 92, 246, 0.24));
  border: 1px solid rgba(255, 46, 99, 0.32);
  margin-bottom: 16px;
}

.step-card h3,
.feature-item h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-card p,
.feature-item p {
  font-size: 0.89rem;
  color: var(--text-muted);
}

.feature-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.icon-rose {
  background: rgba(255, 46, 99, 0.16);
  color: #fb7185;
}

.icon-gold {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

.icon-cyan {
  background: rgba(6, 182, 212, 0.16);
  color: #67e8f9;
}

/* History */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 820px;
  margin: 0 auto;
}

.faq-item {
  padding: 18px 22px;
}

.faq-item summary {
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 600;
  color: #c084fc;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.history-card {
  padding: 22px 24px;
  margin-top: 36px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.history-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.text-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.text-btn:hover {
  color: #fff;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  font-size: 0.86rem;
}

.history-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-tag {
  font-size: 0.74rem;
  font-weight: 700;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.15);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Footer */
.footer {
  padding: 24px 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(5, 6, 11, 0.5);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  padding: 13px 18px;
  border-radius: 13px;
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(15, 18, 32, 0.96);
  color: #fff;
  border: 1px solid var(--border-strong);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
}

.toast.error {
  border-color: rgba(244, 63, 94, 0.6);
  color: #fecdd3;
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.6);
  color: #a7f3d0;
}

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 860px) {
  .preview-grid,
  .steps-grid,
  .features-grid {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
}

@media (max-width: 600px) {
  .search-shell {
    flex-direction: column;
  }
  .quality-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .nav-badges {
    display: none;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
