/* CSS Variables & Theming */
:root {
  /* Dark Theme (Default - Trusted Mauve) */
  --bg-primary: #0f0b1e;
  /* Deep Mauve/Black */
  --bg-secondary: #0a0814;
  --bg-deep: #05040a;

  /* Text */
  --text-primary: #f0e6ff;
  --text-secondary: #b8b0cc;
  --text-accent: #d8b4fe;
  /* Soft Mauve */

  /* Accents & Glows */
  --primary-color: #8b5cf6;
  /* Violet */
  --primary-glow: rgba(139, 92, 246, 0.4);
  --secondary-color: #c084fc;
  /* Soft Purple */
  --secondary-glow: rgba(192, 132, 252, 0.3);

  /* Glassmorphism */
  --glass-bg: rgba(25, 20, 40, 0.6);
  --glass-border: rgba(139, 92, 246, 0.15);
  --glass-blur: 16px;

  /* Gradients */
  --gradient-main: linear-gradient(135deg, #7c3aed 0%, #c084fc 100%);
  --gradient-text: linear-gradient(90deg, #d8b4fe 0%, #8b5cf6 100%);
  --gradient-surface: linear-gradient(180deg, rgba(139, 92, 246, 0.08) 0%, rgba(0, 0, 0, 0) 100%);

  /* Spacing */
  --max-width: 1200px;
  --header-height: 80px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition-speed: 0.3s;
}

[data-theme="light"] {
  /* Light Theme - Clean but Modern */
  --bg-primary: #fbf7ff;
  --bg-secondary: #ffffff;
  --bg-deep: #f3e8ff;

  --text-primary: #2e1065;
  --text-secondary: #581c87;
  --text-accent: #7c3aed;

  --primary-color: #7c3aed;
  --primary-glow: rgba(124, 58, 237, 0.2);
  --secondary-color: #9333ea;
  --secondary-glow: rgba(147, 51, 234, 0.2);

  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(124, 58, 237, 0.1);

  --gradient-main: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
  --gradient-text: linear-gradient(90deg, #6d28d9 0%, #9333ea 100%);
  --gradient-surface: linear-gradient(180deg, #ffffff 0%, #f3e8ff 100%);
}

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

body {
  font-family: 'Outfit', 'Inter', system-ui, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.5s ease;
}

/* Ambient Background Glow */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: -10%;
  width: 50vw;
  height: 50vh;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 60%);
  filter: blur(100px);
  z-index: -1;
  opacity: 0.5;
  animation: floatOrb 12s infinite alternate;
}

@keyframes floatOrb {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(30px, 20px);
  }
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* Typography */
h1,
h2,
h3 {
  font-weight: 800;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 3.5rem;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 40px var(--primary-glow);
}

h2 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

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

.section {
  padding: 80px 0;
  position: relative;
}

.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

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

/* Header */
header {
  height: var(--header-height);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(15, 11, 30, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}

header .container {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -1px;
}

.logo span {
  color: var(--primary-color);
  text-shadow: 0 0 15px var(--primary-glow);
}

/* Navigation */
.nav-links {
  display: flex;
  gap: 2rem;
  background: var(--glass-bg);
  padding: 0.5rem 1.5rem;
  border-radius: 99px;
  border: 1px solid var(--glass-border);
}

.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: all 0.3s;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  text-shadow: 0 0 10px var(--primary-glow);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--primary-color);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--primary-color);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8em 2em;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.btn-primary {
  background: var(--gradient-main);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px -10px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px -10px var(--primary-glow);
}

.btn-secondary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  backdrop-filter: blur(4px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-primary);
}

/* Cards */
.card {
  background: var(--gradient-surface);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
  box-shadow: 0 15px 30px -15px var(--primary-glow);
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 15px var(--primary-glow));
}

/* Hero */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 100px;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 2.5rem;
}

/* Features */
.feature-row {
  display: flex;
  align-items: center;
  gap: 4rem;
  margin-bottom: 80px;
}

.feature-row.reverse {
  flex-direction: row-reverse;
}

.feature-image {
  flex: 1;
  background: var(--glass-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 40px -20px rgba(0, 0, 0, 0.5);
}

.feature-content {
  flex: 0.9;
}

/* Tutorials */
.step-card {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  background: var(--glass-bg);
  padding: 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.step-number {
  background: var(--gradient-main);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 0 15px var(--primary-glow);
}

/* Footer (Compact & Trustworthy) */
footer {
  border-top: 1px solid var(--glass-border);
  background: var(--bg-secondary);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-col h4 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col a {
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--primary-color);
  text-shadow: 0 0 10px var(--primary-glow);
}

.copyright {
  text-align: center;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  opacity: 0.6;
}

/* Code Blocks */
pre {
  background: #080612 !important;
  /* Very dark background */
  color: #e0d4fc !important;
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  border: 1px solid var(--glass-border);
  margin: 1rem 0;
}

code {
  font-family: 'Fira Code', monospace;
}

/* Theme Toggle */
.theme-toggle {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  .feature-row,
  .feature-row.reverse {
    flex-direction: column;
    gap: 2rem;
  }

  .nav-links {
    display: none;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
    gap: 2rem;
  }
}

/* Documentation Layout */
.doc-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  padding-top: 120px;
  min-height: 100vh;
}

.doc-sidebar {
  position: relative;
}

.sticky-sidebar {
  position: sticky;
  top: 100px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.doc-sidebar h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary-color);
  margin-bottom: 1.2rem;
  opacity: 0.9;
}

.doc-menu {
  list-style: none;
  padding: 0;
}

.doc-menu li {
  margin-bottom: 0.5rem;
}

.doc-menu a {
  display: block;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: all 0.2s;
}

.doc-menu a:hover {
  background: rgba(139, 92, 246, 0.1);
  color: var(--text-primary);
  transform: translateX(5px);
}

.doc-content {
  max-width: 900px;
}

.doc-content section {
  margin-bottom: 4rem;
  scroll-margin-top: 120px;
}

.doc-content h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

.doc-content h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
  display: inline-block;
  color: var(--primary-color);
}

.doc-content h3 {
  font-size: 1.4rem;
  margin: 2.5rem 0 1rem;
  color: var(--text-primary);
}

.doc-content p {
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  line-height: 1.8;
}

.doc-content ul,
.doc-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.doc-content li {
  margin-bottom: 0.6rem;
}

.doc-content strong {
  color: var(--text-primary);
}

.doc-content hr {
  border: 0;
  height: 1px;
  background: var(--glass-border);
  margin: 3rem 0;
}

/* Tutorial Cards in Docs */
.tutorial-card {
  background: var(--gradient-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  transition: all 0.3s;
}

.tutorial-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 10px 30px -15px rgba(139, 92, 246, 0.2);
}

.tutorial-card h3 {
  margin-top: 0;
  color: var(--text-primary);
}

.image-placeholder {
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 1.5rem 0;
  border: 1px solid var(--glass-border);
}

.image-placeholder img {
  width: 100%;
  display: block;
  opacity: 0.9;
}

/* Lang Switcher & Buttons */
.lang-switcher,
.install-switcher {
  background: var(--glass-bg);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  gap: 8px;
  border: 1px solid var(--glass-border);
  margin-bottom: 1rem;
}

.ffmpeg-accordion-arrow {
  transition: transform 0.2s;
  display: inline-block;
}

@media (max-width: 992px) {
  .doc-container {
    grid-template-columns: 1fr;
    padding: 100px 1.5rem;
  }

  .doc-sidebar {
    display: none;
  }
}