/* ==========================================================================
   YTSav - Modern Electric Blue & Responsive UI Design System (v10.0)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700;800;900&display=swap');

:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Color Palette - Light Theme Default */
  --primary-blue: #2563eb;
  --primary-blue-hover: #1d4ed8;
  --primary-blue-light: #eff6ff;
  --primary-blue-border: #bfdbfe;

  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  --bg-subtle: #f8fafc;
  --bg-hover: #f1f5f9;

  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #94a3b8;

  --color-green: #10b981;
  --color-green-light: #ecfdf5;
  --color-purple: #8b5cf6;
  --color-purple-light: #f5f3ff;
  --color-orange: #f97316;
  --color-orange-light: #fff7ed;
  --color-gold: #eab308;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.08);
  --shadow-blue: 0 8px 20px -4px rgba(37, 99, 235, 0.35);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-page: #0b0f19;
  --bg-card: #111827;
  --bg-input: #1f2937;
  --bg-subtle: #182234;
  --bg-hover: #1f2937;

  --border-color: #1f2937;
  --border-hover: #374151;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --primary-blue-light: rgba(37, 99, 235, 0.15);
  --primary-blue-border: rgba(37, 99, 235, 0.4);

  --color-green-light: rgba(16, 185, 129, 0.15);
  --color-purple-light: rgba(139, 92, 246, 0.15);
  --color-orange-light: rgba(249, 115, 22, 0.15);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
}

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

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

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

.text-center {
  text-align: center;
}

.text-blue { color: var(--primary-blue); }
.text-green { color: var(--color-green); }
.text-purple { color: var(--color-purple); }
.text-orange { color: var(--color-orange); }
.text-gold { color: var(--color-gold); }

.gradient-text {
  background: linear-gradient(135deg, var(--primary-blue) 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* App Outer Wrapper */
.app-page-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* ==========================================================================
   Header Navigation
   ========================================================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 50;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.logo-icon-box {
  width: 38px;
  height: 38px;
  background-color: var(--primary-blue);
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: var(--shadow-blue);
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.header-center-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition-fast);
  position: relative;
  padding: 0.4rem 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-blue);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary-blue);
  border-radius: var(--radius-full);
}

.header-right-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition-fast);
}

.theme-toggle-btn:hover {
  color: var(--primary-blue);
  border-color: var(--primary-blue);
}

.auth-nav-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-auth-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-auth-outline:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-hover);
}

.btn-auth-solid {
  background-color: var(--primary-blue);
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.35rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-blue);
  transition: var(--transition-fast);
}

.btn-auth-solid:hover {
  background-color: var(--primary-blue-hover);
  transform: translateY(-1px);
}

/* User Profile Nav */
.user-profile-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-subtle);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.user-avatar-badge {
  width: 32px;
  height: 32px;
  background-color: var(--primary-blue);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
}

.user-name {
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.1;
}

.user-plan-badge {
  font-size: 0.7rem;
  color: var(--color-gold);
  font-weight: 600;
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.2rem;
  transition: var(--transition-fast);
}

.logout-btn:hover {
  color: #ef4444;
}

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 4px;
}

.hamburger-line {
  width: 22px;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 2px;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-banner-section {
  padding: 2.5rem 1rem 1rem 1rem;
}

.hero-content {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--primary-blue-light);
  color: var(--primary-blue);
  border: 1px solid var(--primary-blue-border);
  padding: 0.4rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
}

.hero-main-title {
  font-family: var(--font-heading);
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.hero-lead-subtext {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 680px;
}

/* ==========================================================================
   Main Downloader Card Container
   ========================================================================== */
.downloader-main-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  position: relative;
}

.downloader-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* Left Panel: Controls */
.downloader-left-panel {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Tab Switcher */
.download-type-switcher {
  display: inline-flex;
  background-color: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  width: fit-content;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.tab-btn input {
  display: none;
}

.tab-btn.active {
  background-color: var(--bg-card);
  color: var(--primary-blue);
  box-shadow: var(--shadow-sm);
}

/* Step Groups */
.step-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.step-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

/* URL Input Box */
.url-input-container {
  display: flex;
  gap: 0.75rem;
}

.input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1.1rem;
  color: var(--text-subtle);
  font-size: 0.95rem;
}

.input-wrapper input {
  width: 100%;
  padding: 0.85rem 5rem 0.85rem 2.6rem;
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-main);
  transition: var(--transition-fast);
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 4px var(--primary-blue-light);
}

.clear-btn, .paste-btn {
  position: absolute;
  background: none;
  border: none;
  color: var(--text-subtle);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.4rem;
  transition: var(--transition-fast);
}

.clear-btn { right: 2.5rem; }
.paste-btn { right: 0.75rem; }

.clear-btn:hover, .paste-btn:hover {
  color: var(--primary-blue);
}

.btn-primary-blue {
  background-color: var(--primary-blue);
  color: #ffffff;
  border: none;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-blue);
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-primary-blue:hover {
  background-color: var(--primary-blue-hover);
  transform: translateY(-1px);
}

/* Sample Links */
.sample-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.sample-label {
  color: var(--text-subtle);
}

.sample-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.sample-btn:hover {
  color: var(--primary-blue);
  border-color: var(--primary-blue-border);
}

/* Quality Choice Grid */
.quality-grid-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
}

.quality-card-btn {
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.quality-card-btn input {
  display: none;
}

.quality-card-btn .q-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.quality-card-btn .q-sub {
  font-size: 0.72rem;
  color: var(--text-subtle);
  font-weight: 500;
}

.quality-card-btn:hover {
  border-color: var(--primary-blue-border);
  background-color: var(--primary-blue-light);
}

.quality-card-btn.active {
  border-color: var(--primary-blue);
  background-color: var(--primary-blue-light);
  box-shadow: 0 0 0 1px var(--primary-blue);
}

.quality-card-btn.active .q-title {
  color: var(--primary-blue);
}

/* Format Toggle Pills */
.format-toggle-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.format-pill-btn {
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
}

.format-pill-btn:hover {
  border-color: var(--primary-blue-border);
}

.format-pill-btn.active {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  background-color: var(--primary-blue-light);
  box-shadow: 0 0 0 1px var(--primary-blue);
}

/* Tip Banner Box */
.tip-banner-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background-color: var(--primary-blue-light);
  border: 1px solid var(--primary-blue-border);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--primary-blue);
}

.tip-star-icon {
  font-size: 0.95rem;
}

/* Status Loading & Error Cards */
.status-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-top: 0.5rem;
}

.loading-card {
  background-color: var(--primary-blue-light);
  border: 1px solid var(--primary-blue-border);
}

.blue-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--primary-blue-border);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.error-card {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.error-icon {
  font-size: 1.25rem;
}

.status-heading {
  font-size: 0.9rem;
  font-weight: 700;
}

.status-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Right Panel: Preview & Details
   ========================================================================== */
.downloader-right-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.panel-preview-heading {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.preview-card-box {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

/* Thumbnail Box */
.preview-thumbnail-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: #000;
}

.thumbnail-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-icon-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  background-color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  border: none;
  color: #1e293b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  padding-left: 3px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.play-icon-overlay:hover {
  background-color: #ffffff;
  color: var(--primary-blue);
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.duration-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background-color: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.resolution-tag-badge {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background-color: rgba(15, 23, 42, 0.9);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  letter-spacing: 0.05em;
  backdrop-filter: blur(4px);
}

/* Info Block */
.preview-info-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.video-display-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.video-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Spec Grid Table */
.preview-spec-table {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  background-color: var(--bg-subtle);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.spec-col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.spec-label {
  font-size: 0.75rem;
  color: var(--text-subtle);
  font-weight: 500;
}

.spec-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.spec-blue { color: var(--primary-blue); }
.spec-purple { color: var(--color-purple); }

/* Download Main Button */
.btn-download-now-blue {
  width: 100%;
  background-color: var(--primary-blue);
  color: #ffffff;
  border: none;
  padding: 0.95rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: var(--shadow-blue);
  transition: var(--transition-fast);
}

.btn-download-now-blue:hover {
  background-color: var(--primary-blue-hover);
  transform: translateY(-1px);
}

.security-guarantee-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);

  .divider {
    color: var(--border-color);
  }
}

/* Empty state */
.preview-empty-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
  gap: 1rem;
}

.empty-graphic {
  width: 120px;
  opacity: 0.8;
}

.empty-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Animated Cosmic Black Hole Loading State */
.preview-loading-box {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.black-hole-container {
  position: relative;
  width: 100%;
  min-height: 360px;
  background: radial-gradient(circle at center, #091224 0%, #030712 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--primary-blue-border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Outer Accretion Disk (Spinning Swirl) */
.black-hole-accretion-disk {
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(37, 99, 235, 0.95),
    rgba(6, 182, 212, 0.95),
    rgba(147, 51, 234, 0.85),
    rgba(59, 130, 246, 0.25),
    rgba(37, 99, 235, 0.95)
  );
  filter: blur(8px);
  animation: rotateAccretion 4s linear infinite;
}

@keyframes rotateAccretion {
  from { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.08); }
  to { transform: rotate(360deg) scale(1); }
}

/* Secondary Event Horizon Vortex Ring */
.black-hole-event-horizon {
  position: absolute;
  width: 175px;
  height: 175px;
  border-radius: 50%;
  border: 2px dashed rgba(6, 182, 212, 0.7);
  box-shadow: 0 0 35px rgba(6, 182, 212, 0.6), inset 0 0 25px rgba(37, 99, 235, 0.8);
  animation: pulseEventHorizon 3s ease-in-out infinite alternate;
}

@keyframes pulseEventHorizon {
  0% { transform: scale(0.9) rotate(0deg); opacity: 0.7; }
  100% { transform: scale(1.15) rotate(180deg); opacity: 1; }
}

/* Pitch Black Core Void */
.black-hole-core {
  position: absolute;
  width: 115px;
  height: 115px;
  background-color: #000000;
  border-radius: 50%;
  z-index: 3;
  box-shadow: 
    0 0 30px 10px rgba(37, 99, 235, 0.9),
    0 0 60px 20px rgba(6, 182, 212, 0.6),
    inset 0 0 15px #000000;
}

/* Star Particles */
.black-hole-stars {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 50px 80px, rgba(59, 130, 246, 0.8), rgba(0,0,0,0)),
    radial-gradient(1px 1px at 100px 40px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 180px 130px, rgba(6, 182, 212, 0.9), rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 250px 200px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 320px 70px, rgba(147, 51, 234, 0.8), rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 320px 240px;
  opacity: 0.75;
  animation: starTwinkle 4s ease-in-out infinite alternate;
}

@keyframes starTwinkle {
  0% { opacity: 0.4; }
  100% { opacity: 0.9; }
}

/* Loading Overlay Text */
.loading-text-overlay {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(10px);
  padding: 1rem 1.75rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.loading-main-text {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: #38bdf8;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
  letter-spacing: -0.01em;
}

.loading-sub-text {
  font-size: 0.78rem;
  color: var(--text-subtle);
  font-weight: 500;
}

.animated-dots {
  display: inline-block;
  animation: dotsBlink 1.5s infinite steps(4, start);
}

@keyframes dotsBlink {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

/* Playlist State */
.playlist-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.playlist-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
}

.playlist-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.playlist-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
}

.playlist-item-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.6rem;
  border-radius: var(--radius-md);
}

.playlist-item-thumb {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

.playlist-item-info {
  flex: 1;
}

.playlist-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
}

/* ==========================================================================
   Feature Badges Strip (4 Columns)
   ========================================================================== */
.feature-badges-section {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.feature-badge-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.feature-badge-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.feature-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.box-blue {
  background-color: var(--primary-blue-light);
  color: var(--primary-blue);
}

.box-green {
  background-color: var(--color-green-light);
  color: var(--color-green);
}

.box-purple {
  background-color: var(--color-purple-light);
  color: var(--color-purple);
}

.box-orange {
  background-color: var(--color-orange-light);
  color: var(--color-orange);
}

.feature-text h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.feature-text p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ==========================================================================
   "How It Works" Section
   ========================================================================== */
.how-it-works-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1rem 0;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
}

.section-header p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.steps-4-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.step-process-card {
  flex: 1;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

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

.step-icon-wrapper {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.step-num-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  background-color: var(--text-main);
  color: var(--bg-card);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

.step-process-card h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.step-process-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.step-connector-arrow {
  color: var(--text-subtle);
  font-size: 0.9rem;
}

/* ==========================================================================
   FAQ Section
   ========================================================================== */
.faq-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem 0 2rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.faq-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.faq-question {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
}

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

.faq-question::after {
  content: "+";
  float: right;
  color: var(--primary-blue);
  font-weight: 700;
}

.faq-item[open] .faq-question::after {
  content: "−";
}

.faq-answer {
  margin-top: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* ==========================================================================
   Statistics Strip
   ========================================================================== */
.stats-counter-strip {
  width: 100%;
}

.stats-counter-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  box-shadow: var(--shadow-md);
}

.stat-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
}

.stat-icon {
  font-size: 1.5rem;
  margin-bottom: 0.2rem;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   Footer Section (5 Columns)
   ========================================================================== */
.app-footer {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.footer-top-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr) 2fr;
  gap: 2rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-bio-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.social-links-row {
  display: flex;
  gap: 0.6rem;
}

.social-btn {
  width: 34px;
  height: 34px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  text-decoration: none;
  transition: var(--transition-fast);
}

.social-btn:hover {
  background-color: var(--primary-blue);
  color: #ffffff;
  border-color: var(--primary-blue);
}

.footer-col-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links-list a {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer-links-list a:hover {
  color: var(--primary-blue);
}

.subscribe-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.newsletter-input {
  padding: 0.75rem 1rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-main);
}

.newsletter-input:focus {
  outline: none;
  border-color: var(--primary-blue);
}

.btn-subscribe-blue {
  background-color: var(--primary-blue);
  color: #ffffff;
  border: none;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-subscribe-blue:hover {
  background-color: var(--primary-blue-hover);
}

.footer-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-subtle);
}

.footer-disclaimer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ==========================================================================
   Modals & Overlays
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.modal-body {
  padding: 1.5rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input {
  padding: 0.75rem 1rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-main);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-blue);
}

.btn-full {
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
}

.auth-switch-text {
  font-size: 0.8rem;
  text-align: center;
  color: var(--text-muted);
}

.auth-switch-text a {
  color: var(--primary-blue);
  font-weight: 600;
  text-decoration: none;
}

/* Download Progress Modal */
.modal-progress-card {
  max-width: 440px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
}

.modal-banner-wrapper {
  position: relative;
  width: 100%;
  height: 130px;
  overflow: hidden;
  background-color: #060b18;
}

.modal-banner-img {
  width: 200%;
  height: 100%;
  object-fit: cover;
  animation: bannerWaveFlow 14s linear infinite;
  opacity: 0.85;
}

@keyframes bannerWaveFlow {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

.flowing-waves-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.wave-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  background-repeat: repeat-x;
  background-position: left center;
  background-size: 50% 100%;
}

.wave-layer-1 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,30 C150,90 350,-20 500,50 C650,120 900,-10 1200,40 L1200,120 L0,120 Z' fill='none' stroke='rgba(59,130,246,0.65)' stroke-width='2.5'/%3E%3C/svg%3E");
  animation: waveSlide 10s linear infinite, wavePulse 4s ease-in-out infinite alternate;
  opacity: 0.8;
}

.wave-layer-2 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,50 C200,-20 450,100 700,30 C950,-50 1100,70 1200,20 L1200,120 L0,120 Z' fill='none' stroke='rgba(147,197,253,0.75)' stroke-width='2'/%3E%3C/svg%3E");
  animation: waveSlide 15s linear infinite reverse, wavePulse 5s ease-in-out infinite alternate-reverse;
  opacity: 0.85;
}

@keyframes waveSlide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes wavePulse {
  0% { opacity: 0.6; filter: drop-shadow(0 0 2px rgba(59, 130, 246, 0.4)); }
  100% { opacity: 0.9; filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.9)); }
}

.progress-close-btn {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 32px;
  height: 32px;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  color: #ffffff;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  z-index: 10;
}

.progress-close-btn:hover {
  background-color: #ef4444;
  color: #ffffff;
}

.download-progress-content {
  padding: 1.75rem 1.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: -1.5rem;
  position: relative;
  z-index: 2;
}

.progress-visual-wrapper {
  position: relative;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blue-glowing-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid var(--primary-blue-border);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.blue-icon-circle {
  width: 60px;
  height: 60px;
  background-color: var(--primary-blue);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-blue);
}

.progress-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.progress-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 0.25rem 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-blue) 0%, #3b82f6 100%);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.progress-stats {
  display: flex;
  gap: 0.75rem;
}

.progress-stat-pill {
  background-color: var(--primary-blue-light);
  border: 1px solid var(--primary-blue-border);
  color: var(--primary-blue);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastIn 0.3s ease-out;
}

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

.toast-success {
  border-left: 4px solid #22c55e;
  color: #16a34a;
}
.toast-success i { color: #22c55e; }

.toast-error {
  border-left: 4px solid #ef4444;
  color: #dc2626;
}
.toast-error i { color: #ef4444; }

.toast-info {
  border-left: 4px solid var(--primary-blue);
  color: var(--primary-blue);
}
.toast-info i { color: var(--primary-blue); }


/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Laptop & Tablet (max 1024px) */
@media (max-width: 1024px) {
  .header-center-nav, .auth-nav-group {
    display: none !important;
  }

  .hamburger-btn {
    display: flex !important;
  }

  .downloader-card-grid {
    grid-template-columns: 1fr;
  }

  .feature-badges-section {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps-4-container {
    grid-template-columns: repeat(2, 1fr);
    display: grid;
  }

  .step-connector-arrow {
    display: none;
  }

  .stats-counter-card {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-top-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-col-brand, .footer-col-subscribe {
    grid-column: span 2;
  }
}

/* Mobile (max 640px) */
@media (max-width: 640px) {
  .app-page-wrapper {
    padding: 1rem 0.85rem 2rem 0.85rem;
    gap: 1.75rem;
  }

  .hero-main-title {
    font-size: 2.25rem;
  }

  .hero-lead-subtext {
    font-size: 0.95rem;
  }

  .downloader-main-card {
    padding: 1.25rem;
  }

  .quality-grid-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-badges-section {
    grid-template-columns: 1fr;
  }

  .steps-4-container {
    grid-template-columns: 1fr;
  }

  .stats-counter-card {
    grid-template-columns: 1fr;
  }

  .footer-top-grid {
    grid-template-columns: 1fr;
  }

  .footer-col-brand, .footer-col-subscribe {
    grid-column: span 1;
  }

  .footer-bottom-bar {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}

/* Mobile Fullscreen Menu */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
}

.mobile-menu-overlay.active,
.mobile-menu-overlay.open {
  display: flex !important;
  justify-content: flex-end;
}

.mobile-menu-panel {
  position: absolute;
  right: 0;
  top: 0;
  width: 85%;
  max-width: 320px;
  height: 100%;
  background-color: var(--bg-card);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-menu-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-main);
}

.mobile-menu-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-menu-btn {
  width: 100%;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.mobile-btn-outline {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.mobile-btn-blue {
  background-color: var(--primary-blue);
  color: #fff;
  border: none;
}

.mobile-btn-subtle {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}