/* Root variables for color system */
:root {
  --bg-color: #0c0d12;
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.07);
  --text-primary: #ffffff;
  --text-secondary: #a0aec0;
  --accent-cyan: #00f2fe;
  --accent-pink: #fe0979;
  --accent-gradient: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-pink) 100%);
  --accent-hover-gradient: linear-gradient(135deg, #00d2da 0%, #e0076a 100%);
  --success-color: #4ade80;
  --error-color: #f87171;
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Ambient Background Glows */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.15;
  pointer-events: none;
}

.bg-glow-1 {
  width: 400px;
  height: 400px;
  background: var(--accent-cyan);
  top: -100px;
  right: -50px;
}

.bg-glow-2 {
  width: 400px;
  height: 400px;
  background: var(--accent-pink);
  bottom: 10%,;
  left: -150px;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header {
  border-bottom: 1px solid var(--card-border);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 13, 18, 0.7);
}

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

.logo {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 800;
  text-decoration: none;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

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

/* Language Selector */
.lang-selector {
  position: relative;
}

.lang-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  transition: var(--transition);
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.lang-btn .icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #141620;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  min-width: 160px;
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

.lang-dropdown.show {
  display: flex;
}

.lang-dropdown a {
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
}

.lang-dropdown a:hover, .lang-dropdown a.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 64px 0 24px;
}

.hero-title {
  font-family: var(--font-title);
  font-size: 54px;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -1px;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 800px;
  margin: 0 auto 36px;
  line-height: 1.5;
}

/* Glassmorphic Downloader Input Box */
.downloader-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  max-width: 800px;
  margin: 0 auto;
}

.input-group {
  display: flex;
  gap: 16px;
  width: 100%;
}

.input-wrapper {
  position: relative;
  flex-grow: 1;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.input-wrapper:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.input-icon {
  width: 24px;
  height: 24px;
  fill: var(--text-secondary);
  position: absolute;
  left: 16px;
}

.input-wrapper input {
  width: 100%;
  height: 56px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 16px;
  font-family: var(--font-body);
  padding: 0 80px 0 52px;
}

.input-wrapper input::placeholder {
  color: var(--text-secondary);
}

.btn-paste {
  position: absolute;
  right: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  outline: none;
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-paste:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-submit {
  background: var(--accent-gradient);
  border: none;
  color: #000;
  font-weight: 700;
  font-family: var(--font-title);
  font-size: 16px;
  padding: 0 32px;
  height: 58px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-submit:hover {
  background: var(--accent-hover-gradient);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 242, 254, 0.3);
}

.btn-submit .icon-arrow {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: var(--transition);
}

.btn-submit:hover .icon-arrow {
  transform: translateX(4px);
}

/* Secondary Button */
.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-full {
  width: 100%;
}

.icon-refresh {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Advertisement Layouts */
.ad-container {
  display: none !important;
  margin: 32px auto;
  max-width: 728px;
}

.ad-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ad-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--card-border);
  border-radius: var(--radius-md);
  height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-secondary);
  font-size: 12px;
  letter-spacing: 2px;
}

/* Loading Spinner */
.loading-section {
  padding: 48px 0;
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--accent-cyan);
  border-bottom-color: var(--accent-pink);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}

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

.loading-section p {
  color: var(--text-secondary);
}

/* Error Card */
.error-section {
  padding: 32px 0;
}

.error-card {
  max-width: 500px;
  margin: 0 auto;
  background: rgba(248, 113, 113, 0.04);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.error-icon {
  width: 48px;
  height: 48px;
  fill: var(--error-color);
  margin-bottom: 16px;
}

.error-card h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.error-card p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.5;
}

/* Result Section */
.result-section {
  padding: 24px 0;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.result-preview-card, .result-actions-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(20px);
}

.thumbnail-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 125%; /* 4:5 aspect ratio */
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
  background: #181922;
}

.thumbnail-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-duration {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.8);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.video-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-author {
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: 14px;
}

.result-actions-card {
  display: flex;
  flex-direction: column;
}

.result-actions-card h3 {
  font-family: var(--font-title);
  font-size: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 12px;
}

.download-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: auto;
  padding-bottom: 24px;
}

.btn-download {
  background: var(--accent-gradient);
  border: none;
  color: #000;
  font-weight: 700;
  padding: 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  font-family: var(--font-title);
  font-size: 16px;
  transition: var(--transition);
  display: block;
}

.btn-download:hover {
  background: var(--accent-hover-gradient);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 242, 254, 0.2);
}

.btn-download.btn-audio {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
}

.btn-download.btn-audio:hover {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.btn-download.btn-subtitle {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
}

.btn-download.btn-subtitle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  box-shadow: none;
}

/* Info & SEO Content Section */
.info-section {
  max-width: 900px;
  margin: 64px auto 32px;
}

.info-section h2 {
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 40px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 64px;
}

.step-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  transition: var(--transition);
}

.step-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
}

.step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 18px;
  margin: 0 auto 20px;
}

.step-card h3 {
  font-size: 18px;
  margin-bottom: 12px;
  font-weight: 600;
}

.step-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

/* FAQ Accordion */
.faq-container {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.faq-container h2 {
  margin-bottom: 32px;
}

.faq-item {
  border-bottom: 1px solid var(--card-border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 24px 0;
  text-align: left;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font-body);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

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

.faq-arrow {
  width: 24px;
  height: 24px;
  fill: var(--text-secondary);
  transition: var(--transition);
}

.faq-item.active .faq-arrow {
  transform: rotate(180deg);
  fill: var(--accent-cyan);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.faq-answer p {
  padding-bottom: 24px;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 15px;
}

.faq-item.active .faq-answer {
  max-height: 200px;
}

/* Footer */
footer {
  margin-top: auto;
  border-top: 1px solid var(--card-border);
  background: #090a0d;
  padding: 40px 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

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

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

/* Media Queries (Responsive) */
@media (max-width: 768px) {
  .hero-title {
    font-size: 38px;
  }
  
  .input-group {
    flex-direction: column;
  }
  
  .btn-submit {
    width: 100%;
    justify-content: center;
  }
  
  .result-grid {
    grid-template-columns: 1fr;
  }
  
  .steps-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

/* --- Light Theme Overrides (SnapSave Inspired) --- */
[data-theme="light"] {
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  
  /* Vibrant emerald green theme */
  --accent-cyan: #10b981;
  --accent-pink: #059669;
  --accent-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --accent-hover-gradient: linear-gradient(135deg, #059669 0%, #047857 100%);
  --success-color: #10b981;
  --error-color: #ef4444;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
}

[data-theme="light"] header {
  background: rgba(248, 250, 252, 0.8);
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] footer {
  background: #f1f5f9;
  border-top-color: #e2e8f0;
}

[data-theme="light"] .lang-btn {
  background: #ffffff;
  border-color: #cbd5e1;
}

[data-theme="light"] .lang-btn:hover {
  background: #f1f5f9;
}

[data-theme="light"] .lang-dropdown {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .lang-dropdown a {
  color: #475569;
}

[data-theme="light"] .lang-dropdown a:hover,
[data-theme="light"] .lang-dropdown a.active {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .input-wrapper {
  background: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .input-wrapper:focus-within {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

[data-theme="light"] .btn-paste {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .btn-paste:hover {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .btn-submit {
  color: #ffffff;
}

[data-theme="light"] .btn-submit:hover {
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.2);
}

[data-theme="light"] .thumbnail-wrapper {
  background: #f1f5f9;
}

[data-theme="light"] .btn-download {
  color: #ffffff;
}

[data-theme="light"] .btn-download:hover {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

[data-theme="light"] .btn-download.btn-audio {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .btn-download.btn-audio:hover {
  background: #e2e8f0;
}

[data-theme="light"] .btn-download.btn-subtitle {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}

[data-theme="light"] .btn-download.btn-subtitle:hover {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .step-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .step-num {
  color: #ffffff;
}

[data-theme="light"] .faq-question:hover {
  color: #10b981;
}

[data-theme="light"] .faq-item.active .faq-arrow {
  fill: #10b981;
}

[data-theme="light"] .spinner {
  border-color: rgba(16, 185, 129, 0.1);
  border-top-color: #10b981;
  border-bottom-color: #059669;
}

[data-theme="light"] .bg-glow {
  opacity: 0.05;
}

/* Theme Toggle Button Style */
.theme-toggle-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .theme-toggle-btn {
  background: #ffffff;
  border-color: #cbd5e1;
}

[data-theme="light"] .theme-toggle-btn:hover {
  background: #f1f5f9;
}

.theme-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Switcher Dropdown Style */
.nav-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.platform-dropdown {
  position: relative;
}

.platform-btn {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.platform-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .platform-btn:hover {
  background: #f1f5f9;
}

.platform-btn .arrow-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: var(--transition);
}

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

.platform-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #141620;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  min-width: 200px;
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 110;
}

[data-theme="light"] .platform-menu {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
}

.platform-menu.show {
  display: flex;
}

.platform-menu a {
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.platform-menu a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

[data-theme="light"] .platform-menu a {
  color: #475569;
}

[data-theme="light"] .platform-menu a:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.platform-menu a.active {
  color: var(--accent-cyan);
  font-weight: 600;
}

[data-theme="light"] .platform-menu a.active {
  color: #10b981;
}
