/* ============================================================
   DownloadAnyVideo — Ultra Premium Design System v3.0
   Aesthetic: Cosmic Dark · Aurora · Glassmorphism
   ============================================================ */

/* ======================== CSS VARIABLES ======================== */
:root {
  /* Core palette */
  --bg-void: #06060e;
  --bg-deep: #0a0a18;
  --bg-surface: #0e0e1c;
  --bg-elevated: #141428;
  
  /* Glass system */
  --glass-bg: rgba(14, 14, 30, 0.6);
  --glass-bg-hover: rgba(20, 20, 42, 0.7);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-border-hover: rgba(255, 255, 255, 0.12);
  --glass-shine: rgba(255, 255, 255, 0.03);
  
  /* Text hierarchy */
  --text-primary: #f0f0f8;
  --text-secondary: #9494b0;
  --text-muted: #5a5a78;
  
  /* Accent spectrum */
  --accent-1: #818cf8;
  --accent-2: #a78bfa;
  --accent-3: #c084fc;
  --accent-4: #f0abfc;
  --accent-5: #67e8f9;
  
  /* Status */
  --success: #34d399;
  --error: #fb7185;
  --warning: #fbbf24;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #818cf8, #a78bfa, #c084fc);
  --gradient-hero: linear-gradient(135deg, #818cf8 0%, #a78bfa 30%, #c084fc 60%, #f0abfc 100%);
  --gradient-glow: linear-gradient(135deg, rgba(129, 140, 248, 0.4), rgba(167, 139, 250, 0.4), rgba(192, 132, 252, 0.4));
  --gradient-card: linear-gradient(135deg, rgba(129, 140, 248, 0.08), rgba(192, 132, 252, 0.08));
  --gradient-border: linear-gradient(135deg, rgba(129, 140, 248, 0.3), rgba(192, 132, 252, 0.15), rgba(129, 140, 248, 0.05));
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 60px rgba(129, 140, 248, 0.1);
  --shadow-glow-intense: 0 0 80px rgba(167, 139, 250, 0.15), 0 0 160px rgba(129, 140, 248, 0.08);
  
  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  /* Typography */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  
  --container-max: 1200px;
}

/* ======================== RESET & GLOBAL ======================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background: var(--bg-void);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

::selection {
  background: rgba(167, 139, 250, 0.4);
  color: #fff;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; cursor: pointer; background: none; color: inherit; }
img { max-width: 100%; display: block; }
input { font-family: inherit; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ======================== ANIMATED CANVAS BACKGROUND ======================== */
#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* Aurora background — multi-layered animated gradient */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(129, 140, 248, 0.12), transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(192, 132, 252, 0.1), transparent 50%),
    radial-gradient(ellipse 70% 50% at 50% 80%, rgba(103, 232, 249, 0.06), transparent 50%),
    radial-gradient(ellipse 90% 60% at 40% 50%, rgba(167, 139, 250, 0.05), transparent 60%);
  animation: aurora-shift 20s ease-in-out infinite alternate;
}

@keyframes aurora-shift {
  0% { opacity: 1; filter: hue-rotate(0deg); }
  50% { opacity: 0.8; filter: hue-rotate(15deg); }
  100% { opacity: 1; filter: hue-rotate(-10deg); }
}

/* Mesh grid overlay */
.mesh-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(129, 140, 248, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129, 140, 248, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at center, black 30%, transparent 80%);
}

/* Film grain noise */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}

/* Floating geometric shapes */
.geo-shapes {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.geo {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: geo-float 25s ease-in-out infinite;
}

.geo-1 {
  width: 300px; height: 300px;
  border: 1px solid rgba(129, 140, 248, 0.08);
  top: 10%; left: 5%;
  animation-delay: 0s;
  animation-duration: 30s;
}

.geo-2 {
  width: 200px; height: 200px;
  border: 1px solid rgba(192, 132, 252, 0.06);
  top: 60%; right: 10%;
  animation-delay: -5s;
  animation-duration: 25s;
}

.geo-3 {
  width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(103, 232, 249, 0.03), transparent 70%);
  top: 30%; right: 25%;
  animation-delay: -10s;
  animation-duration: 35s;
}

.geo-4 {
  width: 400px; height: 400px;
  border: 1px solid rgba(167, 139, 250, 0.04);
  bottom: 10%; left: 20%;
  animation-delay: -8s;
  animation-duration: 28s;
}

.geo-5 {
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.05), transparent 70%);
  top: 15%; right: 15%;
  animation-delay: -15s;
  animation-duration: 22s;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}

.geo-6 {
  width: 250px; height: 250px;
  border: 1px solid rgba(240, 171, 252, 0.04);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -12s;
  animation-duration: 40s;
}

@keyframes geo-float {
  0%, 100% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(0.8); }
  20% { opacity: 1; }
  50% { opacity: 0.6; transform: translate(40px, -30px) rotate(60deg) scale(1.1); }
  80% { opacity: 1; }
}

/* ======================== GLASS CARD BASE ======================== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.glass-card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-md);
}

/* ======================== NAVIGATION ======================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(6, 6, 14, 0.6);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  transition: all var(--transition);
}

.navbar.scrolled {
  background: rgba(6, 6, 14, 0.92);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(129, 140, 248, 0.08);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

/* Modern app-icon logo */
.nav-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s var(--ease-spring);
  position: relative;
}

.nav-logo-icon::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 16px;
  background: var(--gradient-primary);
  opacity: 0;
  filter: blur(12px);
  transition: opacity var(--transition);
  z-index: -1;
}

.nav-brand:hover .nav-logo-icon {
  transform: scale(1.08) translateY(-1px);
}

.nav-brand:hover .nav-logo-icon::after {
  opacity: 0.3;
}

.brand-text-group {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.nav-name {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.nav-name-bold {
  font-weight: 800;
  color: var(--text-primary);
}

.nav-name-light {
  font-weight: 400;
  color: var(--text-secondary);
}

.nav-by {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 2px;
}

/* Nav right section */
.nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
  padding: 4px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 1px;
  transition: width 0.3s var(--ease-out);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link:hover::after {
  width: 100%;
}

/* Status pill */
.nav-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(52, 211, 153, 0.06);
  border: 1px solid rgba(52, 211, 153, 0.15);
  border-radius: var(--radius-full);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.4); }
}

.status-text {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--success);
  letter-spacing: 0.04em;
}

/* ======================== HERO SECTION ======================== */
.hero {
  position: relative;
  z-index: 1;
  padding: 160px 0 80px;
  text-align: center;
}

.hero-inner {
  max-width: 820px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  background: rgba(129, 140, 248, 0.08);
  border: 1px solid rgba(129, 140, 248, 0.15);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--accent-1);
  font-weight: 500;
  margin-bottom: 32px;
  animation: fadeInDown 0.8s var(--ease-out);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-1);
  animation: pulse-dot 2s ease-in-out infinite;
}

.hero-title {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.04em;
  animation: fadeInUp 0.8s var(--ease-out) 0.1s both;
}

.gradient-text-animated {
  background: var(--gradient-hero);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 6s ease-in-out infinite;
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-secondary);
  margin-bottom: 48px;
  font-weight: 400;
  line-height: 1.8;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeInUp 0.8s var(--ease-out) 0.2s both;
}

.hero-subtitle strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ======================== INPUT GROUP ======================== */
.input-group {
  display: flex;
  gap: 12px;
  align-items: stretch;
  max-width: 720px;
  margin: 0 auto 20px;
  animation: fadeInUp 0.8s var(--ease-out) 0.3s both;
}

.input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(14, 14, 30, 0.7);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  min-height: 64px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.input-wrapper:focus-within {
  border-color: var(--accent-2);
  box-shadow:
    0 0 0 4px rgba(167, 139, 250, 0.1),
    0 0 40px rgba(167, 139, 250, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  background: rgba(20, 20, 40, 0.8);
}

.input-icon {
  position: absolute;
  left: 20px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color var(--transition);
}

.input-wrapper:focus-within .input-icon {
  color: var(--accent-2);
}

.url-input {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 64px;
  padding: 0 120px 0 54px;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 400;
}

.url-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.paste-btn {
  position: absolute;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}

.paste-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--glass-border-hover);
  transform: translateY(-1px);
}

.fetch-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 32px;
  min-height: 64px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(129, 140, 248, 0.25);
}

.fetch-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
}

.fetch-btn:hover:not(:disabled)::before {
  opacity: 1;
}

.fetch-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 32px rgba(129, 140, 248, 0.4), 0 0 60px rgba(167, 139, 250, 0.15);
}

.fetch-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
}

.fetch-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.fetch-btn .fetch-icon {
  transition: transform var(--transition);
}

.fetch-btn:hover:not(:disabled) .fetch-icon {
  transform: scale(1.1) rotate(-5deg);
}

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

/* ======================== PLATFORM DETECTED ======================== */
.platform-detected {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 16px;
  padding: 8px 20px 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  backdrop-filter: blur(12px);
  animation: platformPillIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.platform-detected::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 100px;
  background: radial-gradient(ellipse at center, currentColor, transparent 70%);
  opacity: 0.06;
  pointer-events: none;
}

@keyframes platformPillIn {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.platform-detected-icon {
  display: flex;
  align-items: center;
  position: relative;
}

.platform-detected-icon::before {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  top: -2px;
  right: -4px;
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.platform-detected-name {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
}

/* ======================== PLATFORM ICONS ROW ======================== */
.platform-icons-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
  opacity: 0.5;
  transition: opacity var(--transition);
  animation: fadeInUp 0.8s var(--ease-out) 0.5s both;
}

.platform-icons-row:hover { opacity: 0.85; }

.platform-icon-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  transition: all var(--transition);
}

.platform-icon-mini:hover {
  transform: translateY(-4px) scale(1.1);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--glass-border-hover);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ======================== STATS ROW ======================== */
.stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-top: 48px;
  animation: fadeInUp 0.8s var(--ease-out) 0.6s both;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-number {
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--glass-border);
}

/* ======================== VIDEO PREVIEW ======================== */
.video-preview-section {
  position: relative;
  z-index: 1;
  padding: 20px 0 40px;
}

.video-preview-section:not([hidden]) {
  animation: slide-up 0.5s var(--ease-out);
}

.preview-card {
  padding: 28px;
  box-shadow: var(--shadow-glow);
}

.preview-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-hero);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Skeleton */
.preview-skeleton { display: flex; gap: 24px; }
.skeleton-thumb {
  width: 280px; height: 158px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}
.skeleton-info { flex: 1; display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.skeleton-line {
  height: 18px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
}

.skeleton-shimmer { position: relative; overflow: hidden; }
.skeleton-shimmer::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  animation: shimmer 1.8s ease-in-out infinite;
}

/* Error */
.preview-error { text-align: center; padding: 48px 24px; }
.error-icon { margin-bottom: 16px; }
.error-title {
  font-size: 1.2rem; font-weight: 700; color: var(--error);
  margin-bottom: 8px;
}
.error-message {
  color: var(--text-secondary); font-size: 0.95rem;
  margin-bottom: 24px; max-width: 400px;
  margin-left: auto; margin-right: auto;
}
.retry-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; font-size: 0.9rem; font-weight: 600;
  color: #fff; background: var(--gradient-primary);
  border-radius: var(--radius-sm); transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(129, 140, 248, 0.25);
}
.retry-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(129, 140, 248, 0.35);
}

/* Preview content */
.preview-layout { display: flex; gap: 24px; margin-bottom: 28px; }
.preview-thumb-wrap {
  position: relative; flex-shrink: 0; width: 320px;
  border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-md);
}
.preview-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.preview-duration {
  position: absolute; bottom: 8px; right: 8px;
  padding: 3px 10px; font-size: 0.73rem; font-weight: 600;
  background: rgba(0, 0, 0, 0.85); color: #fff;
  border-radius: 6px; letter-spacing: 0.02em;
  font-family: var(--font-mono);
}
.preview-info { flex: 1; display: flex; flex-direction: column; }
.preview-badges { display: flex; gap: 8px; margin-bottom: 12px; }

.badge {
  font-size: 0.7rem; font-weight: 600;
  padding: 4px 14px; border-radius: var(--radius-full);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-platform {
  background: rgba(129, 140, 248, 0.12);
  color: var(--accent-1);
  border: 1px solid rgba(129, 140, 248, 0.2);
}
.badge-type {
  background: rgba(103, 232, 249, 0.1);
  color: var(--accent-5);
  border: 1px solid rgba(103, 232, 249, 0.2);
}
.preview-title {
  font-size: 1.25rem; font-weight: 700; line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.preview-uploader {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-secondary); font-size: 0.9rem; margin-top: auto;
}

/* Format selector */
.format-selector {
  border-top: 1px solid var(--glass-border);
  padding-top: 24px; margin-bottom: 24px;
}
.format-type-toggle {
  display: flex; gap: 6px; margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.02);
  padding: 4px; border-radius: var(--radius-md);
  border: 1px solid var(--glass-border); width: fit-content;
}
.type-toggle-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px; font-size: 0.85rem; font-weight: 500;
  color: var(--text-secondary); border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.type-toggle-btn:hover { color: var(--text-primary); }
.type-toggle-btn.active {
  background: var(--gradient-primary); color: #fff;
  box-shadow: 0 2px 12px rgba(129, 140, 248, 0.3);
}

.quality-options { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.quality-btn {
  padding: 8px 18px; font-size: 0.84rem; font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); transition: all var(--transition);
}
.quality-btn:hover {
  color: var(--text-primary);
  border-color: var(--glass-border-hover);
  background: rgba(255, 255, 255, 0.06);
}
.quality-btn.active {
  color: #fff;
  background: rgba(129, 140, 248, 0.2);
  border-color: var(--accent-1);
  box-shadow: 0 0 16px rgba(129, 140, 248, 0.15);
}

.file-size-estimate {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; color: var(--text-muted);
}

/* Download button */
.download-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; width: 100%;
  padding: 18px 32px; font-size: 1.05rem; font-weight: 700;
  color: #fff; background: var(--gradient-primary);
  border-radius: var(--radius-md); transition: all var(--transition);
  position: relative; overflow: hidden;
  box-shadow: 0 4px 24px rgba(129, 140, 248, 0.3);
  letter-spacing: 0.01em;
}
.download-btn .btn-glow {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 50%);
  opacity: 0; transition: opacity var(--transition);
}
.download-btn:hover .btn-glow { opacity: 1; }
.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(129, 140, 248, 0.4), 0 0 60px rgba(167, 139, 250, 0.15);
}
.download-btn:active { transform: translateY(0) scale(0.99); }

/* ======================== DOWNLOAD PROGRESS ======================== */
.download-progress-section { position: relative; z-index: 1; padding: 20px 0 40px; }
.download-progress-section:not([hidden]) { animation: slide-up 0.4s var(--ease-out); }
.progress-card { padding: 32px; }
.progress-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.progress-spinner {
  width: 22px; height: 22px;
  border: 2.5px solid rgba(129, 140, 248, 0.2);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.progress-status { font-size: 0.95rem; font-weight: 500; color: var(--text-secondary); }
.progress-bar-wrap { display: flex; flex-direction: column; gap: 10px; }
.progress-bar {
  position: relative; height: 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-full); overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  position: relative;
}
.progress-bar-shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s ease-in-out infinite;
}
.progress-details { display: flex; justify-content: space-between; align-items: center; }
.progress-percent {
  font-size: 0.9rem; font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.progress-speed { font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ======================== AD SLOTS ======================== */
.ad-slot {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  min-height: 90px; margin: 40px 0;
  border: 1px dashed rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.01);
}
.ad-label {
  font-size: 0.72rem; font-weight: 500;
  color: var(--text-muted); letter-spacing: 0.1em;
  text-transform: uppercase; opacity: 0.4;
}

/* ======================== SECTION HEADERS ======================== */
.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-2);
  padding: 4px 16px;
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

/* ======================== PLATFORMS GRID ======================== */
.platforms-section { position: relative; z-index: 1; padding: 80px 0; }

.platforms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.platform-card {
  padding: 28px;
  text-align: center;
  transition: all var(--transition);
  cursor: default;
}

.platform-card-glow {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, var(--glow-color, var(--accent-1)), transparent 70%);
  opacity: 0;
  filter: blur(40px);
  transition: opacity var(--transition-slow);
  pointer-events: none;
  z-index: -1;
}

.platform-card:hover {
  transform: translateY(-8px);
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-lg);
}

.platform-card:hover .platform-card-glow {
  opacity: 0.12;
}

.platform-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  transition: all var(--transition);
}

.platform-card:hover .platform-card-icon {
  transform: scale(1.1);
  border-color: var(--glass-border-hover);
  box-shadow: 0 0 24px rgba(var(--accent), 0.15);
}

.platform-card-name {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.platform-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ======================== HOW IT WORKS ======================== */
.how-it-works { position: relative; z-index: 1; padding: 80px 0; }

.steps-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.step-card {
  flex: 1;
  min-width: 220px;
  max-width: 300px;
  text-align: center;
  padding: 36px 28px 32px;
  overflow: visible;
}

.step-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  background: var(--gradient-primary);
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(129, 140, 248, 0.35);
  font-family: var(--font-mono);
  margin-bottom: 20px;
  position: relative;
}

.step-number::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(129, 140, 248, 0.15);
}

.step-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(129, 140, 248, 0.05);
  border: 1px solid rgba(129, 140, 248, 0.1);
}

.step-title {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.step-connector {
  display: flex;
  align-items: center;
  padding: 0 8px;
  opacity: 0.4;
}

/* ======================== FAQ SECTION ======================== */
.faq-section { position: relative; z-index: 1; padding: 80px 0; }

.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  overflow: hidden;
  transition: all var(--transition);
}

.faq-item:hover { border-color: var(--glass-border-hover); }

.faq-item.open {
  border-color: rgba(129, 140, 248, 0.15);
  box-shadow: 0 4px 20px rgba(129, 140, 248, 0.06);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 20px 24px;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  transition: color var(--transition);
}

.faq-question:hover { color: var(--accent-2); }

.faq-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.35s var(--ease-out), color var(--transition);
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  color: var(--accent-2);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease-out), padding 0.35s ease;
  padding: 0 24px;
}

.faq-item.open .faq-answer {
  max-height: 300px;
  padding: 0 24px 20px;
}

.faq-answer p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ======================== FOOTER ======================== */
.footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--glass-border);
  padding: 48px 0 32px;
  margin-top: 40px;
}

.footer-inner { display: flex; flex-direction: column; gap: 24px; }
.footer-top {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand-name {
  font-size: 1.1rem; font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-link {
  font-size: 0.85rem; color: var(--text-muted);
  transition: color var(--transition);
}
.footer-link:hover { color: var(--accent-2); }

.footer-disclaimer {
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.footer-disclaimer p {
  font-size: 0.82rem; color: var(--text-muted); text-align: center;
}
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.footer-copyright { font-size: 0.8rem; color: var(--text-muted); }
.footer-made-with { font-size: 0.8rem; color: var(--text-muted); }

.heart {
  display: inline-block;
  color: var(--error);
  animation: pulse-heart 1.5s ease-in-out infinite;
}
@keyframes pulse-heart {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ======================== TOAST NOTIFICATIONS ======================== */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}

.toast {
  display: flex; align-items: center; gap: 12px;
  min-width: 300px; max-width: 420px;
  padding: 16px 20px;
  background: rgba(14, 14, 30, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: slide-in-right 0.4s var(--ease-out);
}
.toast.dismissing { animation: slide-out-right 0.3s ease forwards; }
.toast-icon { flex-shrink: 0; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.toast-message { flex: 1; font-size: 0.88rem; font-weight: 500; line-height: 1.4; }
.toast-close {
  flex-shrink: 0; padding: 4px; color: var(--text-muted);
  transition: color var(--transition); pointer-events: auto; cursor: pointer;
}
.toast-close:hover { color: var(--text-primary); }
.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error { border-left: 3px solid var(--error); }
.toast.toast-warning { border-left: 3px solid var(--warning); }
.toast.toast-info { border-left: 3px solid var(--accent-1); }

/* ======================== LEGAL MODALS ======================== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(6, 6, 14, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
  pointer-events: none;
}
.modal-backdrop.active { opacity: 1; pointer-events: auto; }

.legal-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -45%) scale(0.95);
  width: 90%; max-width: 600px; max-height: 80vh;
  background: rgba(14, 14, 30, 0.92);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  z-index: 9999;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s var(--ease-spring), opacity 0.3s var(--ease-out);
}
.legal-modal.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 16px; margin-bottom: 20px;
}
.modal-header h3 {
  font-size: 1.4rem; font-weight: 800; letter-spacing: -0.01em;
  background: var(--gradient-hero);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.modal-close {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 1.5rem; width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); line-height: 1; padding-bottom: 4px;
}
.modal-close:hover {
  background: rgba(167, 139, 250, 0.1);
  border-color: var(--accent-2);
  color: var(--text-primary);
  transform: rotate(90deg);
}
.modal-body { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.7; }
.modal-body h4 { color: var(--text-primary); font-weight: 700; margin: 20px 0 8px; font-size: 1.05rem; }
.modal-body p { margin-bottom: 12px; }
.modal-body a { color: var(--accent-2); text-decoration: underline; transition: var(--transition); }
.modal-body a:hover { color: var(--accent-4); }

.legal-modal::-webkit-scrollbar { width: 6px; }
.legal-modal::-webkit-scrollbar-track { background: transparent; }
.legal-modal::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 3px; }
.legal-modal::-webkit-scrollbar-thumb:hover { background: rgba(167, 139, 250, 0.2); }

/* ======================== KEYFRAMES ======================== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

@keyframes slide-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slide-out-right {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100%); }
}

/* ======================== UTILITIES ======================== */
[hidden] { display: none !important; }

/* ======================== SCROLLBAR ======================== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-void); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }

/* ======================== RESPONSIVE ======================== */
@media (max-width: 968px) {
  .platforms-grid { grid-template-columns: repeat(2, 1fr); }
  .step-connector { display: none; }
  .steps-grid { gap: 16px; }
  .step-card { min-width: 0; }
  .preview-layout { flex-direction: column; }
  .preview-thumb-wrap { width: 100%; max-width: 480px; }
  .skeleton-thumb { width: 100%; }
  .skeleton-info { width: 100%; }
  .preview-skeleton { flex-direction: column; }
  .stats-row { gap: 20px; }
  .stat-number { font-size: 1.3rem; }
}

@media (max-width: 768px) {
  .nav-link { display: none; }
  .nav-right { gap: 0; }
}

@media (max-width: 480px) {
  .nav-status-pill { display: none; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .hero { padding: 120px 0 60px; }
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 0.95rem; margin-bottom: 32px; }
  .input-group { flex-direction: column; gap: 10px; }
  .url-input { min-height: 56px; font-size: 0.95rem; padding-right: 100px; }
  .fetch-btn { min-height: 56px; justify-content: center; }
  .platforms-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .platform-card { padding: 20px 12px; }
  .platform-card-icon { width: 52px; height: 52px; margin-bottom: 12px; }
  .platform-card-icon svg { width: 26px; height: 26px; }
  .steps-grid { flex-direction: column; gap: 14px; }
  .step-card { max-width: 100%; width: 100%; }
  .preview-card { padding: 20px; }
  .preview-thumb-wrap { width: 100%; }
  .format-type-toggle { width: 100%; }
  .type-toggle-btn { flex: 1; justify-content: center; font-size: 0.82rem; padding: 10px 12px; }
  .faq-question { padding: 16px 18px; font-size: 0.9rem; }
  .faq-answer { padding: 0 18px; }
  .faq-item.open .faq-answer { padding: 0 18px 16px; }
  .footer-top { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; gap: 16px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .section-title { font-size: 1.5rem; margin-bottom: 8px; }
  .toast { min-width: unset; max-width: calc(100vw - 48px); }
  .toast-container { left: 24px; right: 24px; bottom: 16px; }
  .platform-icons-row { gap: 8px; }
  .platform-icon-mini { width: 38px; height: 38px; }
  .platform-icon-mini svg { width: 20px; height: 20px; }
  .nav-inner { height: 56px; }
  .nav-logo svg { width: 30px; height: 30px; }
  .nav-name { font-size: 1.15rem; }
  .progress-card { padding: 24px; }
  .ad-slot { min-height: 70px; margin: 24px 0; }
  .stats-row { flex-direction: column; gap: 16px; }
  .stat-divider { width: 40px; height: 1px; }
  .hero-badge { font-size: 0.7rem; padding: 5px 14px; }
}

@media (max-width: 380px) {
  .platforms-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.7rem; }
  .paste-btn span { display: none; }
  .url-input { padding-right: 60px; }
}