/* ===========================
   VideoDownloader — Styles
   Dark theme, glassmorphism
   =========================== */

:root {
  --bg: #0a0a0f;
  --bg2: #12121a;
  --bg3: #1a1a28;
  --accent: #6c5ce7;
  --accent2: #a29bfe;
  --accent3: #00cec9;
  --text: #e4e4ef;
  --text2: #8888aa;
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ---- Animated Background ---- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(108,92,231,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108,92,231,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.bg-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
  animation: float 20s ease-in-out infinite alternate;
}

.bg-glow.glow1 {
  top: -200px;
  right: -100px;
  background: var(--accent);
}

.bg-glow.glow2 {
  bottom: -200px;
  left: -100px;
  background: var(--accent3);
  animation-delay: -10s;
}

@keyframes float {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(40px, 30px) scale(1.1); }
  100% { transform: translate(-20px, -40px) scale(0.95); }
}

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

/* ---- Navbar ---- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(10, 10, 15, 0.7);
  border-bottom: 1px solid var(--glass-border);
  transition: padding 0.3s, background 0.3s;
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.92);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text2);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

.lang-switch {
  display: flex;
  gap: 4px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 3px;
}

.lang-btn {
  padding: 4px 12px;
  border: none;
  background: transparent;
  color: var(--text2);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ---- Hero ---- */
.hero {
  padding: 140px 0 80px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(108, 92, 231, 0.1);
  border: 1px solid rgba(108, 92, 231, 0.2);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 0.85rem;
  color: var(--accent2);
  margin-bottom: 24px;
  font-weight: 500;
}

.hero-dot {
  width: 6px;
  height: 6px;
  background: var(--accent3);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 206, 201, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 8px rgba(0, 206, 201, 0); }
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

.hero h1 .gradient {
  background: linear-gradient(135deg, var(--accent2), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text2);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* ---- Download Form ---- */
.dl-card {
  max-width: 640px;
  margin: 0 auto;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 8px;
  display: flex;
  gap: 8px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s, border-color 0.3s;
}

.dl-card:focus-within {
  border-color: rgba(108, 92, 231, 0.3);
  box-shadow: var(--shadow), 0 0 0 3px rgba(108, 92, 231, 0.08);
}

.dl-card input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1rem;
  padding: 14px 16px;
  font-family: inherit;
}

.dl-card input::placeholder {
  color: var(--text2);
  opacity: 0.6;
}

.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.3s, opacity 0.3s;
  font-family: inherit;
  white-space: nowrap;
}

.dl-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(108, 92, 231, 0.35);
}

.dl-btn:active {
  transform: translateY(0);
}

.dl-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.dl-btn .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

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

.dl-btn.loading .spinner { display: inline-block; }
.dl-btn.loading .btn-text { opacity: 0.6; }

/* ---- Result ---- */
.result-card {
  max-width: 640px;
  margin: 20px auto 0;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: none;
  animation: slideUp 0.3s ease;
}

.result-card.show { display: block; }

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

.result-status {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(108, 92, 231, 0.05);
  border-bottom: 1px solid var(--glass-border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent2);
  animation: pulse 1.5s infinite;
}

.status-dot.success { background: #00b894; animation: none; }
.status-dot.error { background: #ff6b6b; animation: none; }

.status-text {
  font-size: 0.9rem;
  color: var(--text2);
  flex: 1;
}

.progress-bar-wrap {
  padding: 12px 20px;
  border-bottom: 1px solid var(--glass-border);
}

.progress-bar {
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent3));
  border-radius: 2px;
  width: 0%;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.8rem;
  color: var(--text2);
  margin-top: 8px;
  text-align: center;
}

.result-actions {
  padding: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-btn {
  flex: 1;
  min-width: 140px;
  padding: 12px 16px;
  background: var(--bg3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}

.action-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-color: transparent;
}

.action-btn.primary:hover {
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.35);
}

/* ---- Supported Sites ---- */
.sites {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.section-sub {
  text-align: center;
  color: var(--text2);
  margin-bottom: 40px;
  font-size: 1rem;
}

.sites-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.site-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  font-size: 0.9rem;
  color: var(--text2);
  font-weight: 500;
  transition: all 0.2s;
}

.site-chip:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(108, 92, 231, 0.08);
}

.site-chip .icon {
  font-size: 1.1rem;
}

/* ---- Features ---- */
.features {
  padding: 80px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.feature-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.3s;
}

.feature-card:hover {
  border-color: rgba(108, 92, 231, 0.2);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
  background: rgba(108, 92, 231, 0.1);
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

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

/* ---- Pricing ---- */
.pricing {
  padding: 80px 0;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  max-width: 680px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  transition: all 0.3s;
  position: relative;
}

.pricing-card.popular {
  border-color: var(--accent);
  background: rgba(108, 92, 231, 0.06);
}

.pricing-card.popular::before {
  content: attr(data-badge);
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  color: #fff;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text2);
}

.price {
  font-size: 2.4rem;
  font-weight: 800;
  margin: 16px 0;
  letter-spacing: -0.03em;
}

.price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text2);
}

.price-features {
  list-style: none;
  margin: 24px 0;
  text-align: left;
}

.price-features li {
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--text2);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.price-features li:last-child { border: none; }

.price-features .check { color: #00b894; }

/* ---- Footer ---- */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--glass-border);
  text-align: center;
  color: var(--text2);
  font-size: 0.85rem;
}

.footer a {
  color: var(--accent2);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* ---- Mobile ---- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero { padding: 120px 0 60px; }
  .dl-card { flex-direction: column; }
  .dl-btn { justify-content: center; width: 100%; }
  .pricing-grid { grid-template-columns: 1fr; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--bg3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
