/* ═══════════════════════════════════════════════════════════════════
   YTownloaded — style.css
   Blue glassmorphism dark theme with animated gradients
═══════════════════════════════════════════════════════════════════ */

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

:root {
  --blue-50:  #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-900: #1e3a8a;
  --indigo:   #6366f1;
  --cyan:     #06b6d4;

  --bg-dark:  #050a18;
  --bg-card:  rgba(10, 25, 60, 0.6);
  --bg-glass: rgba(15, 35, 80, 0.45);
  --border:   rgba(96, 165, 250, 0.18);
  --border-hover: rgba(96, 165, 250, 0.45);

  --text-primary:   #f0f6ff;
  --text-secondary: #94a3b8;
  --text-muted:     #4a5a7a;

  --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.25);
  --shadow-card: 0 8px 32px rgba(0, 0, 30, 0.6);

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  22px;
  --radius-xl:  32px;

  --font: 'Inter', system-ui, sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ── Animated Background Orbs ───────────────────────────────────── */
.bg-orbs {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
}
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.18;
  animation: drift 18s ease-in-out infinite alternate;
}
.orb-1 { width: 600px; height: 600px; background: #2563eb; top: -150px; left: -100px; animation-duration: 20s; }
.orb-2 { width: 500px; height: 500px; background: #6366f1; bottom: -100px; right: -80px; animation-duration: 24s; animation-delay: -8s; }
.orb-3 { width: 400px; height: 400px; background: #06b6d4; top: 40%; left: 40%; animation-duration: 16s; animation-delay: -4s; }

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(60px, 40px) scale(1.12); }
}

/* ── Layout ─────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }

/* ── Glass Card ─────────────────────────────────────────────────── */
.glass {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* ── Header ─────────────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5, 10, 24, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 1.4rem; font-weight: 800; text-decoration: none; color: var(--text-primary); }
.logo-icon { font-size: 1.5rem; }
.logo-accent { color: var(--blue-400); }
.nav-links { display: flex; gap: 28px; }
.nav-link { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color var(--transition); }
.nav-link:hover { color: var(--blue-400); }

/* ── Hero ───────────────────────────────────────────────────────── */
.hero { padding: 80px 20px 60px; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(59, 130, 246, 0.12); border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 999px; padding: 6px 18px; font-size: 0.82rem; font-weight: 600;
  color: var(--blue-400); margin-bottom: 28px; letter-spacing: 0.02em;
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px #22c55e; animation: pulse-dot 2s ease infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.hero-title {
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 900; line-height: 1.1; margin-bottom: 18px;
  letter-spacing: -0.03em;
}
.gradient-text {
  background: linear-gradient(135deg, var(--blue-400), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 40px; font-weight: 400; letter-spacing: 0.04em; }

/* ── Tabs ───────────────────────────────────────────────────────── */
.tab-group {
  display: inline-flex; background: rgba(10, 25, 60, 0.6);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 5px; gap: 4px; margin-bottom: 28px;
}
.tab {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 26px; border: none; border-radius: 10px;
  background: transparent; color: var(--text-secondary);
  font-family: var(--font); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  background: linear-gradient(135deg, var(--blue-600), var(--indigo));
  color: #fff; box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

/* ── Search Card ────────────────────────────────────────────────── */
.search-card { padding: 24px 28px; margin-bottom: 16px; }
.search-wrap { display: flex; align-items: center; gap: 12px; }
.search-icon { color: var(--blue-400); flex-shrink: 0; display: flex; align-items: center; }
.search-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-family: var(--font); font-size: 1rem; color: var(--text-primary);
  padding: 8px 0; caret-color: var(--blue-400);
}
.search-input::placeholder { color: var(--text-muted); }
.btn-fetch {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 12px 28px; font-family: var(--font); font-size: 0.95rem;
  font-weight: 700; cursor: pointer; transition: all var(--transition);
  flex-shrink: 0; box-shadow: 0 4px 20px rgba(37, 99, 235, 0.5);
}
.btn-fetch:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(37, 99, 235, 0.6); }
.btn-fetch:active { transform: translateY(0); }
.search-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 10px; }

/* ── Spinner ────────────────────────────────────────────────────── */
.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); } }
.hidden { display: none !important; }

/* ── Error Box ──────────────────────────────────────────────────── */
.error-box {
  background: rgba(220, 38, 38, 0.12); border: 1px solid rgba(220, 38, 38, 0.4);
  color: #fca5a5; border-radius: var(--radius-md); padding: 14px 20px;
  font-size: 0.9rem; margin-bottom: 16px; text-align: left;
}

/* ── Result Card ────────────────────────────────────────────────── */
.result-card {
  display: flex; gap: 28px; padding: 28px; margin-bottom: 16px;
  text-align: left; animation: fadeUp 0.4s ease;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.result-media { position: relative; flex-shrink: 0; }
.result-thumb {
  width: 280px; height: 165px; object-fit: cover;
  border-radius: var(--radius-md); display: block;
}
.result-overlay { position: absolute; bottom: 8px; right: 8px; }
.result-duration {
  background: rgba(0,0,0,0.75); color: #fff;
  font-size: 0.78rem; font-weight: 700; padding: 3px 8px;
  border-radius: 6px; backdrop-filter: blur(4px);
}
.result-info { flex: 1; min-width: 0; }
.result-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; line-height: 1.3; }
.result-author { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 20px; }

/* ── Format Grid ────────────────────────────────────────────────── */
.format-label { font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px; }
.format-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.format-btn {
  padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: rgba(10, 25, 60, 0.5);
  color: var(--text-secondary); font-family: var(--font); font-size: 0.82rem;
  font-weight: 600; cursor: pointer; transition: all var(--transition);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.format-btn:hover { border-color: var(--blue-400); color: var(--blue-400); }
.format-btn.selected {
  border-color: var(--blue-400); background: rgba(59, 130, 246, 0.18);
  color: var(--blue-400); box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
}
.format-btn .format-tag {
  font-size: 0.68rem; font-weight: 700; padding: 1px 5px;
  border-radius: 4px; background: rgba(59, 130, 246, 0.2); color: var(--cyan);
}
.format-btn.audio-btn .format-tag { background: rgba(99, 102, 241, 0.2); color: var(--indigo); }

/* ── Download Button ─────────────────────────────────────────────── */
.btn-download {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--blue-500), var(--indigo));
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 14px 32px; font-family: var(--font); font-size: 1rem;
  font-weight: 700; cursor: pointer; transition: all var(--transition);
  box-shadow: 0 4px 24px rgba(59, 130, 246, 0.45);
}
.btn-download:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 36px rgba(59, 130, 246, 0.6); }
.btn-download:active:not(:disabled) { transform: translateY(0); }
.btn-download:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Ad Container ───────────────────────────────────────────────── */
.ad-container { margin: 32px auto; max-width: 900px; }
.ad-banner { border-radius: var(--radius-md); overflow: hidden; }

/* ── Features ───────────────────────────────────────────────────── */
.features { padding: 80px 20px; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-title { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 800; margin-bottom: 12px; }
.section-sub { color: var(--text-secondary); font-size: 1rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.feature-card { padding: 28px; transition: all var(--transition); }
.feature-card:hover { border-color: var(--border-hover); transform: translateY(-4px); box-shadow: var(--shadow-glow); }
.feature-icon { font-size: 2.2rem; margin-bottom: 14px; }
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; }

/* ── How it Works ────────────────────────────────────────────────── */
.how-it-works { padding: 80px 20px; }
.steps-grid { display: flex; align-items: center; justify-content: center; gap: 0; flex-wrap: wrap; }
.step-card { flex: 1; min-width: 200px; max-width: 280px; text-align: center; padding: 32px 24px; }
.step-number {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 900;
  background: linear-gradient(135deg, var(--blue-500), var(--indigo));
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}
.step-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.step-card p { font-size: 0.85rem; color: var(--text-secondary); }
.step-arrow { font-size: 2rem; color: var(--blue-600); padding: 0 8px; }

/* ── FAQ ────────────────────────────────────────────────────────── */
.faq { padding: 80px 20px; }
.faq-list { display: flex; flex-direction: column; gap: 12px; max-width: 720px; margin: 0 auto; }
.faq-item { padding: 0; overflow: hidden; }
.faq-q {
  padding: 18px 24px; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; list-style: none; display: flex; justify-content: space-between;
  align-items: center; transition: color var(--transition);
}
.faq-q:hover { color: var(--blue-400); }
.faq-q::after { content: '+'; font-size: 1.3rem; color: var(--blue-400); flex-shrink: 0; margin-left: 12px; }
details[open] .faq-q::after { content: '−'; }
.faq-a { padding: 0 24px 18px; font-size: 0.88rem; color: var(--text-secondary); line-height: 1.7; }

/* ── Footer ─────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); padding: 40px 20px; margin-top: 40px; }
.footer-inner { text-align: center; }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 1.3rem; font-weight: 800; margin-bottom: 16px; }
.footer-disclaimer { font-size: 0.8rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 12px; line-height: 1.6; }
.footer-copy { font-size: 0.78rem; color: var(--text-muted); }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .result-card { flex-direction: column; }
  .result-thumb { width: 100%; height: auto; }
  .step-arrow { display: none; }
  .nav-links { display: none; }
  .search-wrap { flex-wrap: wrap; }
  .btn-fetch { width: 100%; justify-content: center; }
}
