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

:root {
  --red:        #ff0000;
  --red-dark:   #cc0000;
  --red-light:  #fff0f0;
  --purple:     #7c3aed;
  --purple-bg:  #f5f0ff;
  --bg:         #f5f5f5;
  --card:       #ffffff;
  --text:       #0f0f0f;
  --muted:      #606060;
  --border:     #e5e5e5;
  --shadow-sm:  0 2px 8px rgba(0,0,0,.08);
  --shadow-md:  0 4px 24px rgba(0,0,0,.12);
  --radius:     14px;
  --font:       'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Top Partner Bar ───────────────────────────────────────── */
.top-bar {
  background: #1a1a1a;
  border-bottom: 1px solid #2e2e2e;
  padding: 7px clamp(16px, 4vw, 60px);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.top-bar-label {
  font-size: .72rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

.top-bar-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 2px;
}

.top-bar-links a {
  font-size: .76rem;
  color: #bbb;
  text-decoration: none;
  padding: 2px 10px;
  border-radius: 20px;
  border: 1px solid #333;
  transition: color .15s, border-color .15s, background .15s;
  white-space: nowrap;
}

.top-bar-links a:hover {
  color: #fff;
  border-color: var(--red);
  background: rgba(255,0,0,.08);
}

/* ── Header ────────────────────────────────────────────── */
header {
  background: #0f0f0f;
  padding: 0 clamp(16px, 4vw, 60px);
  border-bottom: 1px solid #2a2a2a;
  position: relative;
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  height: 60px;
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.01em;
  text-decoration: none;
  white-space: nowrap;
}

.logo-img {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  color: #ccc;
  text-decoration: none;
  font-size: .85rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color .15s, background .15s;
  white-space: nowrap;
}

.site-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}

/* ── Hero ──────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #0f0f0f 0%, #1c1c1c 100%);
  padding: 64px 24px 88px;
  text-align: center;
}

.hero h1 {
  color: #fff;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 12px;
}

.hero p {
  color: #aaa;
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.search-box {
  display: flex;
  align-items: center;
  max-width: 660px;
  margin: 0 auto;
  background: #fff;
  border-radius: 50px;
  padding: 14px 20px 14px 28px;
  box-shadow: 0 8px 40px rgba(0,0,0,.35);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text);
  background: transparent;
  min-width: 0;
}

.search-box input::placeholder { color: #aaa; }

.search-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid #e0e0e0;
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

/* ── Main wrapper ──────────────────────────────────────────────── */
.main {
  max-width: 760px;
  margin: -44px auto 56px;
  padding: 0 20px;
}

/* ── Skeleton loader ───────────────────────────────────────────── */
.loading-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 24px;
  animation: fadeSlideUp .3s ease both;
}

.skeleton {
  background: linear-gradient(90deg, #efefef 25%, #e2e2e2 50%, #efefef 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

@keyframes shimmer { to { background-position: -200% 0; } }

.skeleton-info {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.skeleton-thumb { width: 160px; height: 90px; border-radius: 10px; flex-shrink: 0; }

.skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.skeleton-line { height: 14px; }

.skeleton-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.skeleton-btn  { height: 36px; width: 100px; border-radius: 8px; }
.skeleton-dl   { height: 52px; border-radius: 10px; }

/* ── Video card ────────────────────────────────────────────────── */
.video-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: fadeSlideUp .3s ease both;
}

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

/* Thumbnail row */
.video-info {
  display: flex;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.thumbnail-wrap {
  flex-shrink: 0;
  position: relative;
  width: 180px;
  height: 102px;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

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

.duration-badge {
  position: absolute;
  bottom: 5px;
  right: 6px;
  background: rgba(0,0,0,.8);
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Meta */
.video-meta { flex: 1; min-width: 0; }

.video-title {
  font-size: .97rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-details { display: flex; flex-wrap: wrap; gap: 8px; }

.detail-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .8rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
}

/* Download section */
.download-section { padding: 20px; }

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

/* Quality buttons */
.quality-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

.quality-btn {
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: .84rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.quality-btn:hover         { border-color: var(--red); color: var(--red); }
.quality-btn.active        { background: var(--red); border-color: var(--red); color: #fff; }

.quality-btn.audio         { border-color: #d4bfff; color: var(--purple); }
.quality-btn.audio:hover   { border-color: var(--purple); background: var(--purple-bg); }
.quality-btn.audio.active  { background: var(--purple); border-color: var(--purple); color: #fff; }

/* Download button */
.btn-download {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 15px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s, transform .1s, box-shadow .18s;
  box-shadow: 0 4px 14px rgba(255,0,0,.3);
}

.btn-download:hover    { background: var(--red-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255,0,0,.35); }
.btn-download:active   { transform: translateY(0); }
.btn-download:disabled { background: #999; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Progress bar ──────────────────────────────────────────────── */
.progress-wrap {
  margin-bottom: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px 12px;
}

.progress-track {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red-dark), var(--red));
  border-radius: 99px;
  transition: width .4s ease;
}

.progress-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.progress-percent {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  min-width: 40px;
}

.progress-stat {
  font-size: .8rem;
  color: var(--muted);
}

.progress-label {
  font-size: .8rem;
  color: var(--muted);
}

/* ── Spinner ───────────────────────────────────────────────────── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

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

/* ── Toasts ────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
}

.toast {
  background: #212121;
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: .88rem;
  max-width: 360px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  animation: toastIn .25s ease both;
  border-left: 4px solid #555;
}

.toast.error   { background: #c62828; border-color: #ff5252; }
.toast.success { background: #1b5e20; border-color: #69f0ae; }
.toast.info    { background: #0d47a1; border-color: #82b1ff; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Features Section ──────────────────────────────────────────── */
.features-section,
.how-section,
.faq-section {
  padding: 64px clamp(24px, 5vw, 80px);
  background: var(--card);
}

.features-section { background: var(--bg); }
.how-section      { background: var(--card); }
.faq-section      { background: #fafafa; }

.features-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 4px;
}

.features-inner h2 {
  font-size: clamp(1.3rem, 3.5vw, 1.75rem);
  font-weight: 800;
  color: var(--text);
  text-align: center;
  margin-bottom: 40px;
  letter-spacing: -.02em;
}

/* Feature cards grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.feature-card {
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  transition: transform .18s, box-shadow .18s;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
  line-height: 1;
}

.feature-card h3 {
  font-size: .97rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.feature-card p {
  font-size: .85rem;
  line-height: 1.6;
  color: var(--muted);
}

/* How-it-works steps */
.how-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.how-steps li {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  font-weight: 800;
}

.how-steps h3 {
  font-size: .97rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.how-steps p {
  font-size: .85rem;
  line-height: 1.6;
  color: var(--muted);
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 16px 20px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

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

.faq-item summary::after {
  content: '+';
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--muted);
  flex-shrink: 0;
  margin-left: 12px;
  transition: transform .2s;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  padding: 0 20px 16px;
  font-size: .88rem;
  line-height: 1.7;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ── Footer ────────────────────────────────────────────────────── */
.site-footer {
  background: #0f0f0f;
  color: #aaa;
  padding: 40px 24px;
  text-align: center;
}

.footer-inner {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
}

.footer-logo {
  height: 16px;
  width: auto;
  display: block;
  object-fit: contain;
}

.footer-tagline {
  font-size: .9rem;
  color: #ccc;
}

.footer-note {
  font-size: .76rem;
  line-height: 1.6;
  max-width: 580px;
  color: #666;
}

.footer-copy {
  font-size: .78rem;
  color: #555;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 8px;
  margin: 4px 0;
}

.footer-nav a {
  color: #888;
  font-size: .8rem;
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color .15s;
}

.footer-nav a:hover { color: #ccc; }

/* ── Inner page content ───────────────────────────────────── */
.page-hero {
  background: linear-gradient(160deg, #0f0f0f 0%, #1c1c1c 100%);
  padding: 48px clamp(24px, 5vw, 80px) 56px;
  text-align: center;
}

.page-hero h1 {
  color: #fff;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 10px;
}

.page-hero p {
  color: #aaa;
  font-size: .95rem;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px clamp(20px, 5vw, 40px) 72px;
}

.page-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.page-content h2:first-of-type { border-top: none; margin-top: 0; }

.page-content p,
.page-content li {
  font-size: .9rem;
  line-height: 1.8;
  color: #444;
  margin-bottom: 10px;
}

.page-content ul {
  padding-left: 20px;
  margin-bottom: 10px;
}

.page-content li { margin-bottom: 6px; }

.page-content a {
  color: var(--red);
  text-decoration: none;
}

.page-content a:hover { text-decoration: underline; }

.page-content .last-updated {
  display: inline-block;
  font-size: .78rem;
  color: #999;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  margin-bottom: 28px;
}

.warning-box {
  background: #fff8e1;
  border: 1px solid #ffd54f;
  border-left: 4px solid #f9a825;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 20px 0;
  font-size: .88rem;
  line-height: 1.7;
  color: #5f4c00;
}

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

/* ── Sponsored Tools menu button (hidden on desktop) ─────── */
.tools-menu-btn {
  display: none;
}

/* ── Sponsored Tools dropdown panel ──────────────────────── */
.tools-dropdown {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: #1a1a1a;
  border-bottom: 1px solid #2e2e2e;
  z-index: 997;
  padding: 12px 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,.45);
  display: none;
}
.tools-dropdown.is-open {
  display: block;
  animation: toolsSlideDown .22s ease both;
}
@keyframes toolsSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.tool-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 4px;
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  text-decoration: none;
  color: #ccc;
  font-size: .78rem;
  font-weight: 600;
  transition: background .18s, color .18s;
}
.tool-item:hover {
  background: rgba(255,255,255,.16);
  color: #fff;
}

/* ── Hamburger button (hidden on desktop) ────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 10;
}
.ham-line {
  display: block;
  width: 24px;
  height: 2px;
  background: #999;
  border-radius: 2px;
  transition: transform .3s ease, opacity .3s ease;
}
body.menu-open .hamburger .ham-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.menu-open .hamburger .ham-line:nth-child(2) { opacity: 0; }
body.menu-open .hamburger .ham-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile overlay (hidden on desktop) ──────────────────── */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 998;
}
.mobile-overlay.is-open { display: block; }

/* ── Mobile slide-out menu (hidden on desktop) ───────────── */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  background: #1a1a1a;
  z-index: 999;
  transform: translateX(100%);
  transition: transform .25s ease;
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0,0,0,.4);
}
.mobile-menu.is-open { transform: translateX(0); }


.mobile-menu-content {
  display: flex;
  gap: 0;
  padding: 72px 20px 32px;
}

.mobile-menu-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mobile-menu-label {
  font-size: .68rem;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 0 0 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid #2a2a2a;
}

.mobile-menu-section a {
  color: #ccc;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 500;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: color .15s;
}
.mobile-menu-section a:hover { color: #fff; }

body.menu-open { overflow: hidden; }

/* ── Hero mobile/desktop text toggle ─────────────────────── */
.hero-title-mobile,
.hero-desc-mobile { display: none; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .top-bar { display: none; }
  .site-nav { display: none; }
  .hamburger { display: flex; }
  .tools-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.1);
    color: #999;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    margin-right: 8px;
    transition: background .18s, color .18s;
  }
  .tools-menu-btn:hover,
  .tools-menu-btn.is-active {
    background: rgba(255,255,255,.2);
    color: #fff;
  }
  .mobile-menu { display: block; }
  .hero   { padding: 36px 16px 56px; }
  .hero-title-full,
  .hero-desc-full { display: none; }
  .hero-title-mobile,
  .hero-desc-mobile { display: block; }
  .search-box { padding: 5px 5px 5px 16px; }
  .video-info   { flex-direction: column; }
  .thumbnail-wrap { width: 100%; height: 180px; }
  .btn-download { font-size: .95rem; }
}
