/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0a;
  --surface: #111113;
  --card: #18181b;
  --border: #27272a;
  --text: #fafafa;
  --muted: #71717a;
  --c1: #6366f1;
  --c2: #8b5cf6;
  --gradient: linear-gradient(135deg, var(--c1), var(--c2));
  --radius: 14px;
}

[data-platform="tiktok"]    { --c1: #25f4ee; --c2: #fe2c55; }
[data-platform="instagram"] { --c1: #c13584; --c2: #fd1d1d; }
[data-platform="twitter"]   { --c1: #1da1f2; --c2: #0d8bd9; }
[data-platform="facebook"]  { --c1: #1877f2; --c2: #0b60cc; }
[data-platform="snapchat"]  { --c1: #FFFC00; --c2: #f5c518; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── Navigation ── */
.nav {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover { color: var(--text); background: var(--card); }

.nav-links a.active {
  color: #fff;
  background: var(--gradient);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ── Nav Dropdown ── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown > .nav-drop-toggle {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.2s, background 0.2s;
}

.nav-dropdown > .nav-drop-toggle:hover { color: var(--text); background: var(--card); }

.nav-drop-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  min-width: 180px;
  z-index: 200;
  flex-direction: column;
}

.nav-dropdown:hover .nav-drop-menu,
.nav-dropdown.open .nav-drop-menu { display: flex; }

.nav-drop-menu a {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.nav-drop-menu a:hover { color: var(--text); background: var(--card); }

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ── Download Another Button ── */
.btn-reset {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 10px;
  transition: color 0.2s, border-color 0.2s;
}

.btn-reset:hover { color: var(--text); border-color: var(--c1); }

/* ── Container ── */
.container {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px;
  flex: 1;
}

.container-wide {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px;
  flex: 1;
}

/* ── Hero / Header ── */
.hero {
  text-align: center;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
  line-height: 1.2;
}

.hero p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto;
}

/* ── Input Group / Tool ── */
.input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.input-group input {
  flex: 1;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus { border-color: var(--c1); }
.input-group input::placeholder { color: #52525b; }

.btn-primary {
  padding: 14px 28px;
  border-radius: var(--radius);
  border: none;
  background: var(--gradient);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Feature Badges ── */
.badges {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  min-width: 105px;
}

.badge .badge-icon { font-size: 1.3rem; }
.badge .badge-label { font-size: 0.82rem; font-weight: 600; }
.badge .badge-caption { font-size: 0.68rem; color: var(--muted); }

/* ── Error / Loading ── */
.error-box {
  background: #1c0a0e;
  border: 1px solid #7f1d1d;
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: none;
  font-size: 0.9rem;
}

.loading {
  display: none;
  text-align: center;
  padding: 40px;
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--border);
  border-top-color: var(--c1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading p { color: var(--muted); font-size: 0.9rem; }

/* ── Result Card ── */
.result {
  display: none;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.video-info {
  display: flex;
  gap: 16px;
  padding: 20px;
}

.video-info img {
  width: 120px;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--border);
}

.video-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.video-details .title {
  font-size: 0.92rem;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-details .author {
  font-size: 0.85rem;
  font-weight: 500;
}

.video-details .author span {
  color: var(--c1);
}

.video-details .duration {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 4px;
}

.download-buttons {
  display: flex;
  gap: 10px;
  padding: 0 20px 20px;
}

.btn-dl {
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.btn-dl:hover { opacity: 0.88; }
.btn-dl:active { transform: scale(0.97); }
.btn-dl-normal { background: #27272a; color: #fff; }
.btn-dl-hd { background: var(--gradient); color: #fff; }
.btn-dl .sub { font-size: 0.72rem; opacity: 0.65; }

/* ── Multi-item results (Instagram etc.) ── */
.results-grid {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.results-header {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.media-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.media-card-inner {
  display: flex;
  gap: 16px;
  padding: 16px;
  align-items: center;
}

.media-card img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--border);
}

.media-card .no-thumb {
  width: 100px;
  height: 100px;
  border-radius: 10px;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #52525b;
  flex-shrink: 0;
}

.media-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.media-type {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--c1);
}

.btn-sm {
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  background: var(--gradient);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  transition: opacity 0.2s;
}

.btn-sm:hover { opacity: 0.88; }

/* ── Ad Slot Placeholder ── */
.ad-slot {
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  color: #3f3f46;
  font-size: 0.75rem;
  margin-bottom: 32px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── How-to Section ── */
.how-to {
  margin-bottom: 40px;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.how-to h2 {
  font-size: 1.15rem;
  margin-bottom: 24px;
  text-align: center;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.steps { display: flex; flex-direction: column; gap: 18px; }

.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.step-text { padding-top: 4px; }
.step-text h3 { font-size: 0.92rem; margin-bottom: 3px; }
.step-text p { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }

/* ── FAQ Accordion ── */
.faq {
  margin-bottom: 40px;
}

.faq h2 {
  font-size: 1.15rem;
  margin-bottom: 16px;
  text-align: center;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item:first-child {
  border-top: 1px solid var(--border);
}

.faq-q {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  color: var(--text);
  padding: 16px 4px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.faq-q:hover { color: var(--c1); }

.faq-arrow {
  font-size: 1.1rem;
  transition: transform 0.2s;
  color: var(--muted);
}

.faq-item.open .faq-arrow { transform: rotate(90deg); }

.faq-a {
  display: none;
  padding: 0 4px 16px;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.7;
}

.faq-item.open .faq-a { display: block; }

/* ── Also Try ── */
.also-try {
  margin-bottom: 40px;
}

.also-try h3 {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 12px;
  text-align: center;
}

.also-try-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.also-try-links a {
  padding: 8px 18px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
}

.also-try-links a:hover {
  color: var(--text);
  border-color: var(--c1);
}

/* ── Platform Grid (Homepage) ── */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 50px;
}

.platform-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  transition: border-color 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.platform-card:hover {
  border-color: var(--c1);
  transform: translateY(-2px);
}

.platform-card .p-icon { font-size: 2rem; }
.platform-card .p-name { font-size: 0.92rem; font-weight: 600; }
.platform-card .p-desc { font-size: 0.75rem; color: var(--muted); }

/* ── Why Us (Homepage) ── */
.why-us {
  margin-bottom: 50px;
}

.why-us h2 {
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 24px;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.why-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.why-card .why-icon { font-size: 1.5rem; margin-bottom: 8px; }
.why-card h3 { font-size: 0.92rem; margin-bottom: 6px; }
.why-card p { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }

/* ── Legal Pages ── */
.legal {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px;
  flex: 1;
}

.legal h1 {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.legal .updated {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 32px;
}

.legal h2 {
  font-size: 1.05rem;
  margin-top: 28px;
  margin-bottom: 10px;
}

.legal p, .legal li {
  font-size: 0.88rem;
  color: #a1a1aa;
  line-height: 1.7;
  margin-bottom: 12px;
}

.legal ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.legal a {
  color: var(--c1);
  text-decoration: underline;
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 24px 20px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.8rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--text); }

.footer p {
  color: #3f3f46;
  font-size: 0.75rem;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .nav { padding: 12px 16px; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 8px;
  }

  .nav-links.open { display: flex; }
  .nav-links a,
  .nav-links .nav-drop-toggle { padding: 12px 16px; font-size: 0.9rem; }
  .nav-dropdown .nav-drop-menu {
    position: static;
    border: none;
    padding: 0 0 0 16px;
    min-width: auto;
    background: transparent;
  }
  .nav-dropdown.open .nav-drop-menu { display: flex; }
  .nav-divider { display: none; }
  .mobile-toggle { display: block; }

  .hero h1 { font-size: 1.6rem; }
  .input-group { flex-direction: column; }
  .video-info img { width: 90px; height: 120px; }
  .download-buttons { flex-direction: column; }
  .media-card-inner { flex-direction: column; align-items: stretch; }
  .media-card img, .media-card .no-thumb { width: 100%; height: 180px; }
  .platform-grid { grid-template-columns: repeat(2, 1fr); }
}
