:root {
  --bg: #060912;
  --bg-2: #0a0f1d;
  --panel: rgba(20, 27, 45, 0.7);
  --panel-solid: #111729;
  --border: rgba(80, 110, 190, 0.18);
  --border-glow: rgba(80, 140, 255, 0.5);
  --text: #eaf0fb;
  --muted: #8b97b4;
  --blue: #3b82f6;
  --cyan: #2dd4ff;
  --purple: #a855f7;
  --indigo: #5b7cfa;
  --fb: #1877f2;
  --yt: #ff0033;
  --tt: #25f4ee;
  --ig: #e1306c;
  --xx: #1d9bf0;
  --ok: #22c55e;
  --err: #ef4444;
  --grad: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 60%, #2dd4ff 100%);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", "Noto Sans Thai", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Ambient background glow */
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(59,130,246,0.18), transparent 70%),
    radial-gradient(40% 40% at 12% 30%, rgba(168,85,247,0.14), transparent 70%),
    radial-gradient(40% 40% at 88% 35%, rgba(45,212,255,0.12), transparent 70%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }

/* ---- Navbar ---- */
.nav {
  display: flex; align-items: center; gap: 24px;
  padding: 18px 40px;
  max-width: 1280px; margin: 0 auto;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
}
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; }
.logo-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--grad); border-radius: 9px; font-size: 17px;
  box-shadow: 0 0 18px rgba(91,124,250,0.5);
}
.logo-accent { color: var(--cyan); }
.nav-links { display: flex; gap: 30px; margin-left: 26px; }
.nav-links a { color: var(--muted); font-size: 15px; font-weight: 500; transition: color 0.15s; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 2px;
  background: var(--cyan); border-radius: 2px; box-shadow: 0 0 8px var(--cyan);
}
.btn-start {
  margin-left: auto; padding: 10px 22px; border: none; cursor: pointer;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 14px;
  border-radius: 10px; box-shadow: 0 0 20px rgba(91,124,250,0.5);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-start:hover { transform: translateY(-1px); box-shadow: 0 0 28px rgba(91,124,250,0.7); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; padding: 6px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; }

main { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---- Hero ---- */
.hero { text-align: center; padding: 60px 0 30px; }
.hero-title {
  font-size: clamp(38px, 7vw, 76px); font-weight: 900; line-height: 1.05; letter-spacing: -0.02em;
}
.grad {
  background: linear-gradient(120deg, #3b82f6, #a855f7, #2dd4ff);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { color: var(--muted); font-size: clamp(15px, 2.4vw, 20px); margin: 22px auto 0; max-width: 640px; line-height: 1.5; }

.search-box {
  display: flex; align-items: center; gap: 10px;
  margin: 40px auto 0; max-width: 760px;
  background: rgba(13, 19, 36, 0.85); border: 1px solid var(--border-glow);
  border-radius: 16px; padding: 10px 10px 10px 20px;
  box-shadow: 0 0 30px rgba(45,140,255,0.18), inset 0 0 20px rgba(45,140,255,0.05);
}
.search-icon { font-size: 18px; opacity: 0.8; }
.search-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 16px; font-family: inherit; padding: 12px 4px;
}
.search-input::placeholder { color: #5e6b8a; }
.btn-analyze {
  border: none; cursor: pointer; white-space: nowrap;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 15px;
  padding: 14px 26px; border-radius: 12px;
  box-shadow: 0 0 22px rgba(91,124,250,0.55);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-analyze:hover { transform: translateY(-1px); box-shadow: 0 0 30px rgba(91,124,250,0.8); }
.btn-analyze:disabled { opacity: 0.6; cursor: not-allowed; }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 26px auto 0; max-width: 720px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(20, 28, 48, 0.7); border: 1px solid var(--border); color: #c3cce0;
}
.chip.plain { color: var(--muted); }
.chip-ic { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 5px; font-size: 11px; font-weight: 800; color: #fff; }
.chip-ic.yt { background: var(--yt); } .chip-ic.fb { background: var(--fb); }
.chip-ic.tt { background: #000; color: var(--tt); } .chip-ic.ig { background: linear-gradient(45deg,#f09433,#dc2743,#bc1888); }
.chip-ic.xx { background: #000; }

/* ---- Workspace ---- */
.workspace {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px;
  margin-top: 36px;
}
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  padding: 20px; backdrop-filter: blur(8px);
  box-shadow: 0 0 40px rgba(20,40,90,0.25);
}

/* Preview card */
.preview-card { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }
.thumb-wrap { position: relative; border-radius: 12px; overflow: hidden; background: var(--bg-2); aspect-ratio: 16/10; }
.thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-duration {
  position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,0.8);
  padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600;
}
.thumb-play {
  position: absolute; inset: 0; margin: auto; width: 56px; height: 56px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(0,0,0,0.45); border: 2px solid rgba(255,255,255,0.7);
  font-size: 18px; color: #fff; backdrop-filter: blur(2px);
}
.preview-body { display: flex; flex-direction: column; min-width: 0; }
.video-title { font-size: 18px; font-weight: 700; line-height: 1.35; }
.video-meta { color: var(--muted); font-size: 13px; margin-top: 7px; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.ready-tag { color: var(--ok); font-size: 13px; font-weight: 600; margin-top: 8px; }

.quality-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 8px; margin-top: 16px; }
.q-tile {
  border: 1px solid var(--border); background: rgba(13,19,36,0.6); border-radius: 10px;
  padding: 11px 8px; text-align: center; cursor: pointer; transition: all 0.15s; user-select: none;
}
.q-tile:hover { border-color: var(--border-glow); }
.q-tile.active { border-color: var(--cyan); background: rgba(45,140,255,0.12); box-shadow: 0 0 14px rgba(45,140,255,0.3); }
.q-tile .q-main { font-size: 14px; font-weight: 700; }
.q-tile .q-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.btn-download {
  margin-top: 16px; border: none; cursor: pointer; width: 100%;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 16px;
  padding: 15px; border-radius: 12px; box-shadow: 0 0 24px rgba(91,124,250,0.5);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-download:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 0 32px rgba(91,124,250,0.8); }
.btn-download:disabled { opacity: 0.45; cursor: not-allowed; }

/* Processing card */
.processing-head { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.processing-ic {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px;
  background: rgba(45,140,255,0.15); color: var(--cyan); font-size: 16px;
}
.steps { list-style: none; margin: 22px 0 0; display: flex; flex-direction: column; gap: 18px; }
.step { display: flex; align-items: center; gap: 12px; }
.step-dot {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border);
  flex-shrink: 0; display: grid; place-items: center; font-size: 12px; transition: all 0.2s;
}
.step-label { flex: 1; font-size: 14px; color: var(--muted); }
.step-status { font-size: 12px; color: var(--muted); }
.step.active .step-dot { border-color: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.step.active .step-label { color: var(--text); }
.step.done .step-dot { border-color: var(--ok); background: var(--ok); color: #06210f; }
.step.done .step-dot::after { content: "✓"; }
.step.done .step-label { color: var(--text); }

.proc-progress-track { margin-top: 24px; height: 10px; border-radius: 999px; background: rgba(13,19,36,0.8); border: 1px solid var(--border); overflow: hidden; }
.proc-progress-bar { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--purple), var(--cyan)); transition: width 0.3s; }
.proc-percent { text-align: right; font-size: 13px; font-weight: 700; margin-top: 8px; color: var(--cyan); }

/* Message */
.message { margin: 20px auto 0; max-width: 760px; padding: 13px 18px; border-radius: 12px; font-size: 14px; text-align: center; }
.message.error { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.4); color: #fca5a5; }
.message.success { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.4); color: #86efac; }

/* ---- Sections ---- */
.section { padding: 56px 0 0; }
.section-title { display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 22px; font-weight: 800; }
.dot-line { width: 36px; height: 2px; background: linear-gradient(90deg, transparent, var(--cyan)); border-radius: 2px; }
.dot-line:last-child { background: linear-gradient(90deg, var(--cyan), transparent); }

.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; }
.how-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 24px; }
.how-ic {
  width: 50px; height: 50px; display: grid; place-items: center; border-radius: 12px;
  background: rgba(45,140,255,0.12); border: 1px solid var(--border-glow); font-size: 22px; margin-bottom: 14px;
}
.how-card h4 { font-size: 16px; font-weight: 700; }
.how-card p { color: var(--muted); font-size: 14px; line-height: 1.6; margin-top: 8px; }

.platforms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 30px; }
.platform-card { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.platform-ic { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; font-size: 20px; font-weight: 800; color: #fff; flex-shrink: 0; }
.platform-card.yt .platform-ic { background: var(--yt); } .platform-card.fb .platform-ic { background: var(--fb); }
.platform-card.tt .platform-ic { background: #000; color: var(--tt); } .platform-card.ig .platform-ic { background: linear-gradient(45deg,#f09433,#dc2743,#bc1888); }
.platform-card.xx .platform-ic { background: #000; }
.platform-card h4 { font-size: 15px; font-weight: 700; }
.platform-card p { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* FAQ */
.faq-head { text-align: center; }
.faq-head h2 { font-size: 24px; font-weight: 800; }
.faq-list { max-width: 760px; margin: 26px auto 0; display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 4px 18px; }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 16px 0; font-size: 15px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-arrow { transition: transform 0.2s; color: var(--cyan); font-size: 18px; }
.faq-item[open] .faq-arrow { transform: rotate(180deg); }
.faq-item p { color: var(--muted); font-size: 14px; line-height: 1.6; padding: 0 0 16px; }

/* Footer */
.footer {
  max-width: 1120px; margin: 70px auto 0; padding: 26px 24px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px;
}
.footer-brand { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.footer-copy { color: var(--muted); font-size: 13px; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--muted); font-size: 13px; transition: color 0.15s; }
.footer-links a:hover { color: var(--text); }

.disclaimer { text-align: center; color: var(--muted); font-size: 12px; padding: 16px 24px 40px; max-width: 760px; margin: 0 auto; line-height: 1.6; }

.hidden { display: none !important; }

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav { padding: 14px 18px; gap: 12px; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--panel-solid); border-bottom: 1px solid var(--border);
    margin-left: 0; padding: 8px 0; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 24px; }
  .nav-links a.active::after { display: none; }
  .btn-start { margin-left: auto; padding: 9px 16px; }
  .nav-toggle { display: flex; }
  .preview-card { grid-template-columns: 1fr; }
  .thumb-wrap { max-width: 360px; margin: 0 auto; width: 100%; }
  .search-box { flex-direction: column; align-items: stretch; padding: 14px; gap: 12px; }
  .search-icon { display: none; }
  .btn-analyze { width: 100%; padding: 14px; }
  .footer { flex-direction: column; text-align: center; }
}
