/* =========================================================
   Vidora — UI
   ========================================================= */

:root {
  --bg: #060810;
  --surface: rgba(18, 22, 36, 0.62);
  --surface-solid: #0c111d;
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text: #f3f5fc;
  --muted: #9aa3bb;
  --dim: #6f7890;
  --violet: #8b5cf6;
  --violet-deep: #6d28d9;
  --cyan: #22d3ee;
  --green: #34d399;
  --red: #fb7185;
  --radius: 22px;
  --shadow: 0 24px 70px -24px rgba(0, 0, 0, 0.75);
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue",
    Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

img { max-width: 100%; }

/* ---------- Background ---------- */

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 68px 68px;
  -webkit-mask-image: radial-gradient(ellipse 75% 55% at 50% 0%, #000 20%, transparent 78%);
          mask-image: radial-gradient(ellipse 75% 55% at 50% 0%, #000 20%, transparent 78%);
  opacity: 0.75;
  pointer-events: none;
}

.orb {
  position: fixed;
  z-index: -2;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
}

.orb-a {
  width: 620px;
  height: 620px;
  top: -320px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(109, 40, 217, 0.4);
}

.orb-b {
  width: 460px;
  height: 460px;
  right: -180px;
  bottom: -160px;
  background: rgba(8, 145, 178, 0.16);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(6, 8, 16, 0.5) 55%, var(--bg) 100%);
}

/* ---------- Utilities ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.022));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(22px);
          backdrop-filter: blur(22px);
}

/* ---------- Buttons ---------- */

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 46%, #0891b2 125%);
  color: #fff;
  font-weight: 650;
  font-size: 0.94rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 10px 28px -8px rgba(124, 58, 237, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.primary-btn svg { width: 18px; height: 18px; flex: none; }

.primary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 16px 34px -10px rgba(124, 58, 237, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.primary-btn:active:not(:disabled) { transform: translateY(0); }

.primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.primary-btn.loading { pointer-events: none; }
.primary-btn.loading svg { display: none; }
.primary-btn.loading::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  animation: spin 0.75s linear infinite;
}

.primary-btn.small {
  height: 36px;
  padding: 0 14px;
  font-size: 0.8rem;
  border-radius: 10px;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  border-color: var(--border-strong);
}

.ghost-btn.small { height: 36px; padding: 0 14px; font-size: 0.8rem; }

.text-btn {
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 0.76rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.18s ease;
}
.text-btn:hover { color: var(--red); }

:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.7);
  outline-offset: 3px;
}

/* ---------- Nav ---------- */

.nav {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 11px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9 55%, #0891b2 130%);
  color: #fff;
  box-shadow: 0 8px 22px -7px rgba(124, 58, 237, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.brand-mark svg { width: 21px; height: 21px; }

.brand-name {
  font-size: 1.16rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 31px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 550;
  letter-spacing: 0.02em;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
  animation: pulse 2.4s ease-in-out infinite;
}

/* ---------- Hero ---------- */

.hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 54px 24px 0;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #c4b5fd;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.eyebrow svg { width: 13px; height: 13px; }

.hero h1 {
  margin-top: 22px;
  font-size: clamp(2.4rem, 5.4vw, 3.9rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.grad {
  background: linear-gradient(100deg, #c4b5fd 5%, #8b5cf6 38%, #22d3ee 95%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.lede {
  max-width: 640px;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.7;
}

/* ---------- Downloader ---------- */

.downloader {
  max-width: 850px;
  margin: 34px auto 0;
  padding: 12px;
  border-radius: 24px;
  text-align: left;
}

.input-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 7px 7px 7px 15px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: rgba(7, 10, 18, 0.82);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-row:focus-within {
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.09);
}

.input-icon { display: grid; place-items: center; color: var(--dim); }
.input-icon svg { width: 19px; height: 19px; }

#url-input {
  width: 100%;
  min-width: 0;
  height: 48px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.96rem;
  outline: none;
}

#url-input::placeholder { color: #626b83; }

.paste-btn { height: 38px; padding: 0 13px; font-size: 0.78rem; }

#download-now-btn { height: 48px; min-width: 128px; border-radius: 12px; }

.options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 10px 8px 2px;
}

.quality-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 550;
}

.quality-field > svg { width: 15px; height: 15px; color: #8b94ab; }

.quality-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 6px 27px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background-color: rgba(255, 255, 255, 0.045);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%239aa3bb' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  color: var(--text);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 550;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.quality-select:hover,
.quality-select:focus {
  border-color: rgba(139, 92, 246, 0.5);
  background-color: rgba(139, 92, 246, 0.08);
  outline: none;
}

.quality-select option { background: #101522; color: var(--text); }

.save-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #6f7890;
  font-size: 0.67rem;
}

.save-note svg { width: 13px; height: 13px; color: var(--green); }

.photo-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 9px 8px 2px;
  color: #a5b4fc;
  font-size: 0.7rem;
  line-height: 1.55;
}

.photo-note svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: #c4b5fd; }
.photo-note strong { color: #ddd6fe; font-weight: 600; }

.device-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  max-width: 620px;
  margin: 14px auto 0;
  color: #788199;
  font-size: 0.72rem;
  line-height: 1.55;
  text-align: left;
}

.device-note svg { width: 14px; height: 14px; flex: none; color: #67e8f9; }
.device-note strong { color: #aab3c9; font-weight: 600; }

.lede strong { color: #b9c1d6; font-weight: 600; }

.error-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 13px;
  border: 1px solid rgba(251, 113, 133, 0.28);
  border-radius: 12px;
  background: rgba(251, 113, 133, 0.08);
  color: #fda4af;
  font-size: 0.81rem;
  line-height: 1.55;
  text-align: left;
}

.supported {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 14px;
  padding: 13px 8px 3px;
}

.supported-label {
  color: var(--dim);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.platforms { display: flex; flex-wrap: wrap; gap: 6px; }

.platform {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.028);
  color: #8e97af;
  font-size: 0.69rem;
  font-weight: 550;
  line-height: 1.5;
}

.platform::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}

.platform.yt { color: #ff8585; }
.platform.tt { color: #67e8f9; }
.platform.fb { color: #93c5fd; }
.platform.ig { color: #f9a8d4; }
.platform.x { color: #e2e8f0; }
.platform.dy { color: #f0abfc; }
.platform.bi { color: #7dd3fc; }
.platform.more { color: var(--dim); }
.platform.more::before { display: none; }

.quick-facts {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 26px;
  margin-top: 20px;
  color: #8b94ab;
  font-size: 0.75rem;
}

.quick-facts b { color: var(--green); font-weight: 700; margin-right: 3px; }


/* ---------- Job panel ---------- */

.job-section {
  max-width: 850px;
  margin: 20px auto 0;
  padding: 0 24px;
}

.job-panel {
  margin-top: 0;
  padding: 19px 21px;
  border-radius: 19px;
  animation: fadeUp 0.35s ease both;
}

.job-head { display: flex; align-items: center; gap: 13px; }

.job-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.job-icon svg { width: 20px; height: 20px; }

.job-icon.done {
  background: rgba(52, 211, 153, 0.13);
  border-color: rgba(52, 211, 153, 0.3);
  color: #6ee7b7;
}

.job-icon.error {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.28);
  color: #fda4af;
}

.spinner {
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(196, 181, 253, 0.28);
  border-top-color: #c4b5fd;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.job-text { flex: 1; min-width: 0; }

.job-text h3 {
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-text p { color: var(--dim); font-size: 0.72rem; }

.job-percent {
  color: #c4b5fd;
  font-size: 1.03rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.progress-track {
  height: 7px;
  margin: 15px 0 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.065);
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8b5cf6, #22d3ee, #8b5cf6);
  background-size: 220% 100%;
  animation: gradientSlide 2.2s linear infinite;
  transition: width 0.35s ease;
}

.job-panel.indeterminate .progress-bar {
  width: 34%;
  animation: indeterminate 1.35s ease-in-out infinite;
}

.job-panel.done .progress-bar {
  background: linear-gradient(90deg, #10b981, #34d399);
  animation: none;
}

.job-panel.done .job-percent { color: #6ee7b7; }

.job-panel.error .progress-bar {
  background: linear-gradient(90deg, #be123c, #fb7185);
  animation: none;
}

.job-panel.error .job-percent { color: #fda4af; }

.job-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
}

.job-stats {
  color: var(--dim);
  font-size: 0.71rem;
  font-variant-numeric: tabular-nums;
}

.job-actions { display: flex; align-items: center; gap: 8px; }

.job-panel .error-box { margin-top: 12px; }

/* ---------- History ---------- */

.history { margin-top: 26px; text-align: left; }

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  padding: 0 2px;
}

.history-head h3 {
  color: var(--dim);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.history-list { display: grid; gap: 7px; }

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.026);
}

.h-icon {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  flex: none;
  border-radius: 9px;
  background: rgba(34, 211, 238, 0.09);
  color: #67e8f9;
}

.h-icon svg { width: 17px; height: 17px; }

.h-main { flex: 1; min-width: 0; }

.h-title {
  color: #d9deeb;
  font-size: 0.79rem;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h-sub { color: var(--dim); font-size: 0.66rem; }

/* ---------- Features ---------- */

.features {
  max-width: 1060px;
  margin: 76px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.feature { padding: 23px 22px; border-radius: 19px; text-align: left; }

.feature-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 15px;
  border-radius: 11px;
  border: 1px solid transparent;
}

.feature-icon svg { width: 20px; height: 20px; }

.feature-icon.violet {
  background: rgba(139, 92, 246, 0.11);
  border-color: rgba(139, 92, 246, 0.22);
  color: #c4b5fd;
}

.feature-icon.cyan {
  background: rgba(34, 211, 238, 0.09);
  border-color: rgba(34, 211, 238, 0.2);
  color: #67e8f9;
}

.feature-icon.green {
  background: rgba(52, 211, 153, 0.09);
  border-color: rgba(52, 211, 153, 0.2);
  color: #6ee7b7;
}

.feature h3 {
  margin-bottom: 6px;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.feature p { color: var(--muted); font-size: 0.77rem; line-height: 1.65; }

/* ---------- Steps ---------- */

.steps {
  max-width: 1000px;
  margin: 22px auto 0;
  padding: 21px 26px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-radius: 19px;
}

.step { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; }

.step-num {
  flex: none;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #a78bfa;
  padding-top: 2px;
}

.step h3 { font-size: 0.8rem; font-weight: 650; }
.step p { color: var(--dim); font-size: 0.7rem; line-height: 1.5; }

.step-divider {
  flex: none;
  width: 1px;
  height: 36px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.13), transparent);
}

/* ---------- Footer ---------- */

footer {
  max-width: 880px;
  margin: 68px auto 40px;
  padding: 0 24px;
  text-align: center;
}

.disclaimer {
  color: #5c6478;
  font-size: 0.68rem;
  line-height: 1.75;
}

.copyright { margin-top: 14px; color: #454c5f; font-size: 0.66rem; }

/* ---------- Animations ---------- */

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

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16); }
  50% { box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.05); }
}

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

@keyframes gradientSlide {
  to { background-position: -220% 0; }
}

@keyframes indeterminate {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(330%); }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .features { grid-template-columns: 1fr; max-width: 620px; }
  .steps { flex-direction: column; align-items: stretch; gap: 15px; max-width: 620px; }
  .step-divider { width: 100%; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent); }
}

@media (max-width: 640px) {
  .nav { padding: 16px 18px; }
  .hero { padding: 38px 18px 0; }
  .hero h1 { margin-top: 18px; font-size: clamp(2.05rem, 9.5vw, 2.8rem); }
  .lede { font-size: 0.92rem; margin-top: 16px; }
  .downloader { padding: 9px; margin-top: 26px; border-radius: 20px; }
  .input-row { grid-template-columns: auto minmax(0, 1fr) auto; padding: 6px 6px 6px 12px; }
  #download-now-btn { grid-column: 1 / -1; width: 100%; height: 45px; }
  .paste-btn { height: 36px; }
  #url-input { height: 44px; font-size: 0.9rem; }
  .options-row { padding: 9px 4px 2px; gap: 8px 12px; }
  .save-note { font-size: 0.63rem; }
  .photo-note { margin: 8px 4px 2px; font-size: 0.66rem; }
  .supported { padding: 11px 4px 2px; }
  .device-note { font-size: 0.68rem; padding: 0 4px; }
  .quick-facts { gap: 7px 15px; font-size: 0.7rem; }
  .job-section { margin-top: 16px; padding: 0 15px; }
  .job-panel { padding: 16px; }
  .job-text h3 {
    font-size: 0.84rem;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .job-percent { font-size: 0.9rem; }
  .job-foot { flex-wrap: wrap; }
  .features { margin-top: 50px; padding: 0 15px; }
  .steps { margin: 18px 15px 0; padding: 19px; }
  .history-item { padding: 9px 11px; }
  .h-sub { display: none; }
  footer { margin-top: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
