/* ===== FlixAI Design System ===== */

:root {
  /* Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #22223a;
  --bg-input: #16162a;
  --border: #2a2a4a;
  --border-focus: #6366f1;
  --text-primary: #f0f0f5;
  --text-secondary: #9999b0;
  --text-muted: #666680;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --success: #22c55e;
  --warning: #f59e0b;
  --gradient-hero: linear-gradient(135deg, #0a0a0f 0%, #1a1a3e 50%, #0a0a0f 100%);
  --gradient-card: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(99,102,241,0.02) 100%);
  --gradient-accent: linear-gradient(135deg, #6366f1, #8b5cf6);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --section-padding: 100px 0;
  --container-width: 1100px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
}

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

/* ===== Navigation ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background 0.3s, box-shadow 0.3s;
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border);
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switcher {
  position: relative;
}

.lang-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.lang-toggle:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  min-width: 120px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 200;
}

.lang-switcher.open .lang-dropdown {
  display: block;
}

.lang-option {
  display: block;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
}

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

.lang-option.active {
  color: var(--accent-hover);
  background: rgba(99, 102, 241, 0.08);
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
  padding: 120px 24px 80px;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(99,102,241,0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(139,92,246,0.06) 0%, transparent 50%);
  animation: heroGlow 15s ease-in-out infinite alternate;
  z-index: 1;
}

.matrix-rain {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center,
    transparent 0%,
    rgba(10, 10, 15, 0.4) 50%,
    rgba(10, 10, 15, 0.85) 100%);
  pointer-events: none;
  z-index: 2;
}

@keyframes heroGlow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-3%, -3%); }
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 720px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--accent-hover);
  margin-bottom: 28px;
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

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

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.7;
}

.hero-search-demo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  margin-bottom: 40px;
  min-width: min(420px, 90vw);
  max-width: 90vw;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.08);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.hero-search-demo:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 30px rgba(99, 102, 241, 0.15);
}

.hero-search-demo .search-icon {
  width: 18px;
  height: 18px;
  color: var(--accent-hover);
  flex-shrink: 0;
}

.hero-search-demo .search-text {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text-primary);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  font-weight: 500;
}

.hero-search-demo .search-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent-hover);
  animation: blink 1s step-end infinite;
  flex-shrink: 0;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.25s;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px var(--accent-glow);
  color: #fff;
}

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

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.btn-large {
  padding: 16px 36px;
  font-size: 1.05rem;
  border-radius: var(--radius);
}

.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== Section Common ===== */
section {
  padding: var(--section-padding);
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}

/* ===== Features ===== */
.features {
  background: var(--bg-primary);
}

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

.feature-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  transition: all 0.3s;
}

.feature-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 8px 40px rgba(99, 102, 241, 0.08);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(99, 102, 241, 0.12);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.65;
}

/* ===== How It Works ===== */
.how-it-works {
  background: var(--bg-secondary);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  top: 36px;
  left: calc(33.33% / 2 + 36px);
  right: calc(33.33% / 2 + 36px);
  height: 2px;
  background: var(--border);
}

.step {
  text-align: center;
}

.step-number {
  width: 72px;
  height: 72px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 auto 20px;
  position: relative;
  z-index: 1;
}

.step h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.step p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 260px;
  margin: 0 auto;
}

/* ===== Pricing ===== */
.pricing {
  background: var(--bg-primary);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 780px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  position: relative;
  transition: all 0.3s;
}

.pricing-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 40px var(--accent-glow);
}

.pricing-card.featured::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: var(--gradient-accent);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  pointer-events: none;
}

.pricing-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--gradient-accent);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.pricing-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.pricing-price {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.pricing-price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.pricing-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.pricing-features {
  list-style: none;
  margin-bottom: 32px;
}

.pricing-features li {
  padding: 8px 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-features li::before {
  content: '\2713';
  color: var(--success);
  font-weight: 700;
  font-size: 0.85rem;
}

.pricing-card .btn {
  width: 100%;
  justify-content: center;
}

/* ===== Configure ===== */
.configure {
  background: var(--bg-secondary);
}

.config-wrapper {
  max-width: 600px;
  margin: 0 auto;
}

.config-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.form-group .form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.form-group .form-hint a {
  color: var(--accent);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: var(--font-sans);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* Password input wrapper */
.input-wrapper {
  position: relative;
}

.input-wrapper .form-input {
  padding-right: 48px;
}

.input-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px;
  transition: color 0.2s;
}

.input-toggle:hover {
  color: var(--text-primary);
}

/* Radio group */
.radio-group {
  display: flex;
  gap: 12px;
}

.radio-option {
  flex: 1;
  position: relative;
}

.radio-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.radio-option input:checked + label {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-hover);
}

.radio-option label:hover {
  border-color: var(--accent);
}

/* Conditional field */
.form-group.hidden {
  display: none;
}

/* Install card */
.install-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.install-card-inner {
  padding: 48px 36px;
  text-align: center;
}

.install-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.install-card h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.install-card-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 28px;
}

.install-card .btn-primary {
  padding: 16px 48px;
  font-size: 1.1rem;
}

.install-alt {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.install-alt .result-label {
  margin-bottom: 10px;
}

.install-alt .btn-secondary {
  margin-top: 12px;
}

.install-note {
  padding: 14px 36px;
  background: rgba(99, 102, 241, 0.06);
  border-top: 1px solid rgba(99, 102, 241, 0.12);
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

.result-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.result-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-url {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  word-break: break-all;
  line-height: 1.5;
}

.result-actions {
  display: flex;
  gap: 12px;
}

.result-actions .btn {
  flex: 1;
  justify-content: center;
}

.result-note {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== Footer ===== */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

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

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 0.2s;
}

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

/* ===== Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  :root {
    --section-padding: 64px 0;
  }

  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .hero {
    padding: 100px 20px 60px;
    min-height: auto;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .steps::before {
    display: none;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .config-form {
    padding: 24px;
  }

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

  .footer .container {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .hero-examples {
    gap: 8px;
  }

  .hero-examples .example-tag {
    font-size: 0.78rem;
    padding: 5px 10px;
  }

  .radio-group {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }
}
