@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@800&display=swap');

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #6366f1;
  --secondary: #059669;
  --accent: #d97706;
  --error: #dc2626;
  --success: #16a34a;
  --gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #9333ea 100%);
  --gradient-glow: linear-gradient(135deg, rgba(79, 70, 229, 0.4) 0%, rgba(124, 58, 237, 0.4) 100%);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --glass: rgba(255, 255, 255, 0.8);
  --background: #ffffff;
  --background-light: #f8fafc;
  --surface: #ffffff;
  --surface-light: #f1f5f9;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --header-bg: rgba(255, 255, 255, 0.9);
}

.light-mode {
  --background: #ffffff;
  --background-light: #f8fafc;
  --surface: #ffffff;
  --surface-light: #f1f5f9;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --header-bg: rgba(255, 255, 255, 0.9);
}

.dark-mode {
  --background: #0f0f23;
  --background-light: #1a1a2e;
  --surface: #16162a;
  --surface-light: #252542;
  --text: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border: rgba(255, 255, 255, 0.08);
  --header-bg: rgba(15, 15, 35, 0.85);
  --glass: rgba(22, 22, 42, 0.7);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 2rem;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5000;
  border-bottom: 1px solid var(--border);
  transition: all 0.4s ease;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

.header.scrolled {
  padding: 0.5rem 2rem;
  background: var(--glass);
}

.header-left,
.header-right {
  flex: 1;
  display: flex;
  align-items: center;
}

.header-right {
  justify-content: flex-end;
}

.header-center {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.language-dropdown {
  position: relative;
  display: inline-block;
}

.language-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 5001;
}

.language-btn * {
  pointer-events: none;
}

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

.globe-icon,
.dropdown-arrow {
  width: 16px;
  height: 16px;
}

.dropdown-arrow {
  transition: transform 0.3s ease;
}

.language-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.language-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  min-width: 140px;
  max-height: 350px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
}

.language-dropdown.open .language-menu {
  display: block;
}

/* Tools dropdown in header */

/* Header headlines (replaces tools dropdown) */
.header-headlines {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
}
.header-headlines .headline {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  transition: background-color 0.18s ease, color 0.18s ease;
  font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-weight: 800;
}
.header-headlines .headline:hover {
  background: var(--surface-light);
  color: var(--primary);
}

/* Footer tools — compact, centered list matching footer design */
.footer-tools{
  display:flex;
  flex-wrap:wrap;
  gap:16px 28px;
  justify-content:center;
  margin:12px 0 14px;
}
.tool-btn{
  color: #ffffff; /* Explicit white color */
  background: rgba(255, 255, 255, 0.05); /* Slight background for contrast */
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration:none;
  font-weight:700;
  border:1px solid rgba(255,255,255,0.1);
  transition: all 0.2s ease;
  font-size:0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tool-btn:hover{
  background:rgba(255,255,255,0.15);
  color:#fff;
  transform:translateY(-2px);
  border-color:rgba(255,255,255,0.3);
}
.tool-label{display:inline; color: #ffffff !important; } /* Force clear visibility */

@media (max-width:720px){
  .tool-btn{flex:1 1 calc(50% - 16px);text-align:center}
}
}

.language-dropdown.open .language-menu {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.lang-option:hover {
  background: var(--surface-light);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-img {
  width: 40px;
  height: 40px;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  border-color: var(--primary);
  background: var(--surface-light);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--text);
  transition: all 0.3s ease;
}

.light-mode .sun-icon {
  display: block;
}

.light-mode .moon-icon {
  display: none;
}

.dark-mode .sun-icon {
  display: none;
}

.dark-mode .moon-icon {
  display: block;
}

.platform-nav {
  position: fixed;
  top: 65px;
  left: 0;
  right: 0;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 999;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.platform-nav::-webkit-scrollbar {
  display: none;
}

.platform-buttons {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  min-width: max-content;
  padding: 0 1rem;
}

.platform-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 25px;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.platform-btn svg {
  width: 18px;
  height: 18px;
}

.platform-btn:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.platform-btn.active {
  background: var(--gradient);
  border-color: transparent;
  color: white;
}

.platform-btn .coming-soon {
  background: var(--accent);
  color: #000;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.platform-btn.active .coming-soon {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

main {
  flex: 1;
  margin-top: 120px;
}

.hero {
  position: relative;
  padding: 3rem 2rem 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  z-index: 1;
}

.light-mode .hero {
  background: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
              radial-gradient(ellipse at bottom right, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
}

.dark-mode .hero {
  background: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.15) 0%, transparent 60%),
              radial-gradient(ellipse at bottom right, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
}

.stars-badge {
  position: absolute;
  top: 2rem;
  right: 2rem;
  perspective: 1000px;
  z-index: 10;
}

.badge-3d {
  transform-style: preserve-3d;
  animation: badge-float 3s ease-in-out infinite;
}

@keyframes badge-float {
  0%, 100% { transform: translateY(0) rotateX(5deg) rotateY(-5deg); }
  50% { transform: translateY(-10px) rotateX(-5deg) rotateY(5deg); }
}

.badge-inner {
  background: var(--gradient);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3),
              0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  transform: translateZ(20px);
}

.stars-container {
  display: flex;
  gap: 2px;
  margin-bottom: 0.5rem;
}

.stars-container svg {
  width: 16px;
  height: 16px;
  color: #fbbf24;
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.5));
}

.star-count {
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
}

.star-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-content {
  max-width: 700px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

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

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.download-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.feature-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border-radius: 25px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.feature-tag svg {
  width: 16px;
  height: 16px;
  color: var(--secondary);
}

.download-box {
  display: flex;
  gap: 1rem;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .hero-title {
    font-size: 2.5rem;
  }
  .stars-badge {
    position: relative;
    top: 0;
    right: 0;
    margin-bottom: 2rem;
  }
  .hero {
    padding-top: 5rem;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 0.5rem 1rem;
  }
  .logo-text {
    font-size: 1.25rem;
  }
  .hero-title {
    font-size: 2rem;
  }
  .download-box {
    flex-direction: column;
    padding: 0 1rem;
  }
  .download-btn {
    width: 100%;
    justify-content: center;
  }
  .bark-buttons {
    justify-content: flex-start;
    padding-bottom: 8px;
  }
  .result-card {
    border-radius: 12px;
  }
  .video-preview {
    aspect-ratio: 9/16;
  }
  .option-btn {
    min-width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.75rem;
  }
  .hero-subtitle {
    font-size: 1rem;
  }
  .feature-tag {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
  .logo-img {
    width: 32px;
    height: 32px;
  }
}

/* Touch targets */
button, .lang-option, .headline, .tool-btn {
  min-height: 44px;
}
.bark {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.bark-inner {
  width: 100%;
  max-width: 720px;
  padding: 12px;
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.bark-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient);
  opacity: 0.5;
}

.bark-buttons {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 12px 4px;
}

.bark-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: #ffffff;
  border: none;
  border-radius: 16px;
  color: var(--text);
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  box-shadow: 
    0 4px 0 #e2e8f0,
    0 8px 15px rgba(0, 0, 0, 0.05);
  transform: translateZ(0);
  text-decoration: none;
}

.bark-btn:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 8px 0 #cbd5e1,
    0 15px 25px rgba(99, 102, 241, 0.15);
  color: #ffffff;
  background: var(--gradient);
}

.bark-btn:active {
  transform: translateY(2px);
  box-shadow: 
    0 2px 0 #94a3b8,
    0 5px 10px rgba(0, 0, 0, 0.1);
}

.bark-icon {
  font-size: 1.4rem;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1));
}

.bark-label {
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
}

.bark-btn:hover .bark-label {
  -webkit-text-fill-color: #ffffff;
}

.bark-inner {
  width: 100%;
  max-width: 900px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
  .bark-inner {
    border-radius: 16px;
    padding: 10px;
  }
  
  .bark-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
}

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

.input-icon {
  position: absolute;
  left: 1.25rem;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
}

.url-input {
  width: 100%;
  padding: 1rem 3rem 1rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--background);
  color: var(--text);
  font-size: 1rem;
  font-weight: 400;
  transition: all 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

.url-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.clear-btn {
  position: absolute;
  right: 1rem;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
  padding: 0;
}

.clear-btn:hover {
  color: var(--text);
}

.clear-btn svg {
  width: 16px;
  height: 16px;
}

.download-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  border: none;
  border-radius: 14px;
  background: var(--gradient);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
  position: relative;
  overflow: hidden;
}

.download-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s ease;
}

.download-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.5);
}

.download-btn:hover::before {
  left: 100%;
}

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

.btn-icon {
  width: 20px;
  height: 20px;
}

.error-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  border-radius: 8px;
  color: var(--error);
  font-size: 0.9rem;
  display: none;
}

.error-message.show {
  display: block;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading-overlay.show {
  display: flex;
}

.loader {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
  position: absolute;
}

.loader-ring:nth-child(2) {
  width: 50px;
  height: 50px;
  border-top-color: var(--primary-light);
  animation-delay: 0.15s;
  animation-direction: reverse;
}

.loader-ring:nth-child(3) {
  width: 40px;
  height: 40px;
  border-top-color: #a855f7;
  animation-delay: 0.3s;
}

.loader-text {
  position: absolute;
  bottom: -3rem;
  white-space: nowrap;
  color: white;
  font-size: 1rem;
}

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

.result-section {
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.result-card {
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.video-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--background);
  overflow: hidden;
}

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

.video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-preview:hover .video-overlay {
  opacity: 1;
}

.play-icon {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.play-icon svg {
  width: 32px;
  height: 32px;
  margin-left: 4px;
}

.video-info {
  padding: 1.5rem;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.author-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.author-username {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.video-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.stat svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.download-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.option-btn {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.option-btn svg {
  width: 20px;
  height: 20px;
}

.option-btn.primary {
  background: var(--gradient);
  border: none;
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.option-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.option-btn.secondary {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text);
}

.option-btn.secondary:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.download-success-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 10px 40px rgba(16, 185, 129, 0.4);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
}

.download-success-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.download-success-toast svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.download-success-toast span {
  font-weight: 600;
  font-size: 1rem;
}

.new-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  width: 100%;
  padding: 1rem;
  background: transparent;
  border: 2px dashed var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.new-download-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.new-download-btn svg {
  width: 20px;
  height: 20px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
}

.how-it-works {
  padding: 5rem 2rem;
  background: var(--surface);
}

.steps-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.step {
  flex: 1;
  min-width: 200px;
  max-width: 250px;
  text-align: center;
}

.step-icon, .feature-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: #ffffff;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 
    0 6px 0 #e2e8f0,
    0 12px 24px rgba(0, 0, 0, 0.05);
  transform: translateZ(0);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.step:hover .step-icon, .feature-card:hover .feature-icon {
  transform: translateY(-8px) rotate(3deg);
  box-shadow: 
    0 12px 0 #cbd5e1,
    0 24px 40px rgba(99, 102, 241, 0.15);
  background: var(--gradient);
}

.step-icon svg, .feature-icon svg {
  width: 36px;
  height: 36px;
  color: var(--primary);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  transition: all 0.4s ease;
}

.step:hover .step-icon svg, .feature-card:hover .feature-icon svg {
  color: #ffffff;
  transform: scale(1.15);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.feature-card {
  background: #ffffff;
  padding: 2.5rem 2rem;
  border-radius: 28px;
  text-align: center;
  transition: all 0.4s ease;
  border: 1px solid #f1f5f9;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.06);
  border-color: var(--primary-light);
}

.feature-icon {
  width: 70px;
  height: 70px;
  border-radius: 20px;
  margin-bottom: 1.25rem;
}

.feature-icon svg {
  width: 32px;
  height: 32px;
}

.feature-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.faq {
  padding: 5rem 2rem;
  background: var(--surface);
}

.faq-container {
  max-width: 700px;
  margin: 0 auto;
}

.faq-page .faq-item {
  background: #ffffff;
  padding: 2rem;
  border-radius: 24px;
  border: 1px solid #f1f5f9;
  box-shadow: 
    0 4px 0 #e2e8f0,
    0 10px 25px rgba(0, 0, 0, 0.03);
  margin-bottom: 1.5rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.faq-page .faq-item:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 8px 0 #cbd5e1,
    0 15px 35px rgba(99, 102, 241, 0.1);
  border-color: var(--primary-light);
}

.faq-page .faq-item h3 {
  font-size: 1.35rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.faq-page .faq-item p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.reviews {
  padding: 5rem 2rem;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

/* Extra articles before reviews */
.extra-articles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 2.5rem 0;
}
.extra-article {
  background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(250,250,255,0.6));
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 6px 20px rgba(20,30,60,0.06);
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.extra-article .thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  flex: 0 0 72px;
  display:flex;align-items:center;justify-content:center;font-size:28px;background:linear-gradient(180deg,#fff,#f7f9ff);
}
.extra-article .content h3{margin:0 0 .4rem;font-size:1.05rem}
.extra-article .content p{margin:0 0 .6rem;color:var(--text-secondary)}
.extra-article .sticker{font-size:22px;margin-left:auto}
.extra-article .btn{margin-top:6px}

@media (max-width:720px){
  .extra-articles{grid-template-columns:1fr}
  .extra-article{align-items:center}
}


.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

.review-stars {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.review-stars svg {
  width: 20px;
  height: 20px;
  color: #fbbf24;
}

.review-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.review-author {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.footer {
  background: #1a1a3e;
  padding: 0;
}

.footer-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  padding: 2.5rem 2rem 1.5rem;
}

.footer-language {
  margin-bottom: 1.5rem;
}

.footer-lang-select {
  padding: 0.5rem 2rem 0.5rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: #252550;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.footer-lang-select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
}

.footer-links-primary {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 1.25rem;
}

.footer-links-primary a {
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-links-primary a:hover {
  color: #a5b4fc;
}

.footer-links-secondary {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.footer-links-secondary a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.3s ease;
}

.footer-links-secondary a:hover {
  color: #fff;
}

.footer-disclaimer {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  margin: 0;
}

.footer-bottom {
  background: #0f0f2d;
  padding: 1rem 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.copyright {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.scroll-top-btn {
  position: absolute;
  right: 2rem;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  background: #6366f1;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.scroll-top-btn:hover {
  background: #4f46e5;
}

.scroll-top-btn svg {
  width: 18px;
  height: 18px;
}

.ad-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none !important; /* keep hidden by default; allowed only when .show is added by app code */
  align-items: center;
  justify-content: center;
  z-index: 3000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
}

.ad-container {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

/* Responsive ad-slot rules to avoid covering content */
.ad-slot {
  margin: 16px auto;
  max-width: 980px;
  width: calc(100% - 24px);
  text-align: center;
  position: relative;
  z-index: 10;
}

.ad-slot ins.adsbygoogle {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  margin: 0 auto;
}

/* Header ad should be limited so header doesn't expand and hide content */
.header .header-ad {
  max-width: 320px;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ensure under-header and above-footer do not use absolute positioning */
.under-header-ad, .above-footer-ad, .download-ad {
  margin-top: 12px;
  margin-bottom: 12px;
}

/* When overlay is intentionally shown via app code, add this class */
.ad-overlay.show {
  display: flex !important;
  pointer-events: auto;
  opacity: 1;
}

/* Ad reserve/fallback placeholder when auto-ads don't inject */
.ad-reserve {
  display: block;
  width: 100%;
  max-width: 980px;
  margin: 12px auto;
  min-height: 90px; /* reserve typical banner height */
  box-sizing: border-box;
  text-align: center;
  position: relative;
}

.ad-reserve .placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.01));
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 8px;
  border: 1px dashed var(--border);
}

/* smaller reserve for header */
.header .ad-reserve.header-ad { min-height: 60px; max-width: 320px; }

@media (max-width: 480px) {
  .ad-reserve { min-height: 60px; }
}

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

.ad-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.ad-timer {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.ad-timer span:nth-child(2) {
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
}

.ad-content {
  padding: 2rem;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-placeholder {
  text-align: center;
  color: var(--text-muted);
}

.ad-placeholder p:first-child {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.ad-note {
  font-size: 0.875rem;
}

.skip-ad-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem;
  background: var(--gradient);
  border: none;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.skip-ad-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.skip-ad-btn:not(:disabled):hover {
  opacity: 0.9;
}

.skip-ad-btn svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 768px) {
  .header {
    padding: 0.75rem 1rem;
  }
  
  .logo-text {
    font-size: 1.25rem;
  }
  
  .logo-img {
    width: 32px;
    height: 32px;
  }
  
  .platform-nav {
    top: 57px;
  }
  
  main {
    margin-top: 110px;
  }
  
  .stars-badge {
    position: relative;
    top: 0;
    right: 0;
    margin-bottom: 1.5rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .download-box {
    flex-direction: column;
  }

  .ad-slot { width: calc(100% - 16px); }
  
  .download-btn {
    width: 100%;
    justify-content: center;
  }
  
  .download-features {
    gap: 0.5rem;
  }
  
  .feature-tag {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }
  
  .step-arrow {
    display: none;
  }
  
  .steps-container {
    flex-direction: column;
    gap: 2rem;
  }
  
  .step {
    max-width: 100%;
  }
  
  .download-options {
    flex-direction: column;
  }
  
  .option-btn {
    width: 100%;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 2rem 1rem 3rem;
  }
  
  .hero-title {
    font-size: 1.75rem;
  }
  
  .result-section {
    padding: 1rem;
  }
  
  .video-info {
    padding: 1rem;
  }
  
  .video-stats {
    gap: 1rem;
  }
  
  .badge-inner {
    padding: 0.75rem 1rem;
  }
  
  .star-count {
    font-size: 1rem;
  }
}

/* TikTok article styles */
.article-tiktok {
  padding: 3rem 2rem;
  background: linear-gradient(120deg, rgba(99,102,241,0.06), rgba(168,85,247,0.04));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.article-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.article-hero {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(168,85,247,0.06));
  box-shadow: var(--shadow);
}
.article-badge {
  font-size: 2.25rem;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--gradient);
  color: white;
  box-shadow: 0 8px 30px rgba(99,102,241,0.12);
}
.article-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-left: 1rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.article-sub {
  color: var(--text-secondary);
  margin-top: 0.5rem;
}
.article-cta-row { display:flex; gap:0.75rem; margin-left:auto; }
.article-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  margin-top: 1.25rem;
}
.article-content { background: transparent; padding: 1rem 0; }
.article-content h3 { font-size: 1.125rem; margin-bottom:0.5rem; }
.feature-list { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0.75rem; margin: 1rem 0 1.25rem; }
.feature { background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)); padding:0.85rem; border-radius:10px; border:1px solid var(--border); }
.feature h4 { margin-bottom:0.25rem; font-size:0.95rem; }
.how-to { margin:0.5rem 0 1rem 1.25rem; }
.uses { margin-left: 1.25rem; }
.article-side .side-card { background: var(--surface); padding:1rem; border-radius:10px; border:1px solid var(--border); box-shadow: var(--shadow); }
.side-card h4 { margin-bottom:0.5rem; }
.side-card ul { list-style: none; padding-left: 0; }
.side-card ul li { padding: 0.25rem 0; }
.side-faq { margin-top: 1rem; background: transparent; padding:0.5rem 0; color: var(--text-secondary); }

.btn { display:inline-flex; align-items:center; gap:0.5rem; padding:0.6rem 0.9rem; border-radius:10px; text-decoration:none; font-weight:700; }
.btn-primary { background:var(--gradient); color:white; box-shadow: 0 8px 24px rgba(99,102,241,0.12); }
.btn-outline { background:transparent; border:1px solid var(--border); color:var(--text); }
.btn-ghost { display:block; margin-top:0.75rem; padding:0.5rem 0.75rem; border-radius:8px; border:1px dashed var(--border); text-align:center; }

@media (max-width: 920px) {
  .article-grid { grid-template-columns: 1fr; }
  .article-hero { flex-direction: column; align-items: flex-start; }
  .article-cta-row { margin-left:0; }
}

