/* SnapCode Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Backgrounds */
  --bg-base: #09090b;
  --bg-surface: #18181b;
  --bg-elevated: #27272a;

  /* Text */
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  /* Accent Dual */
  --accent: #818cf8;
  --accent-strong: #4f46e5;
  --accent-hover: #4338ca;

  /* States */
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --border-subtle: #3f3f46;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  width: 28px;
  height: 28px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s ease;
  outline: none;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent-strong);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-surface);
  border-color: var(--accent);
}

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

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  border-radius: 0.625rem;
}

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 1.5rem;
}

.card-elevated {
  background: var(--bg-elevated);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-accent {
  background: rgba(79, 70, 229, 0.15);
  color: var(--accent);
  border: 1px solid rgba(129, 140, 248, 0.3);
}

.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-pro {
  background: linear-gradient(135deg, rgba(79,70,229,0.3), rgba(129,140,248,0.2));
  color: var(--accent);
  border: 1px solid rgba(129, 140, 248, 0.4);
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--accent);
  border-radius: 1rem;
  background: rgba(79, 70, 229, 0.04);
  transition: all 0.2s ease;
  cursor: pointer;
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--accent-strong);
  background: rgba(79, 70, 229, 0.08);
}

/* Code blocks */
.code-block {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8125rem;
  line-height: 1.7;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1.25rem;
  overflow: auto;
  color: var(--text-primary);
  white-space: pre;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-elevated);
  padding: 0.25rem;
  border-radius: 0.625rem;
  border: 1px solid var(--border-subtle);
}

.tab {
  padding: 0.375rem 0.875rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.tab:hover {
  color: var(--text-secondary);
}

.tab.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

/* Inputs */
.input {
  width: 100%;
  padding: 0.625rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(129, 140, 248, 0.2);
  outline-offset: 0;
}

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

/* Section layout */
.section {
  padding: 5rem 1.5rem;
}

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

.container-sm {
  max-width: 720px;
  margin: 0 auto;
}

/* Grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

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

@media (max-width: 768px) {
  .grid-3, .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Prose (blog) */
.prose h1, .prose h2, .prose h3 {
  color: var(--text-primary);
  margin: 2rem 0 1rem;
  line-height: 1.3;
}

.prose h1 { font-size: 2.25rem; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }

.prose p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  max-width: 65ch;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
}

.prose code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875em;
  background: var(--bg-elevated);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  color: var(--accent);
}

.prose pre {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.prose pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
  font-size: 0.8125rem;
}

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

.prose li {
  margin-bottom: 0.375rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2rem 1.5rem;
  text-align: center;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px -5px rgba(79, 70, 229, 0.4); }
  50% { box-shadow: 0 0 40px -5px rgba(79, 70, 229, 0.7); }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease forwards;
}

.glow-pro {
  animation: pulse-glow 3s ease-in-out infinite;
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
  max-width: 360px;
}

.toast-success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.toast-error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  padding: 2rem;
  max-width: 440px;
  width: 100%;
  animation: fadeIn 0.2s ease;
}

/* Language toggle */
.lang-toggle {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-elevated);
  padding: 0.25rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-subtle);
}

.lang-btn {
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.lang-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* Pricing cards */
.pricing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 1.25rem;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 40px -10px rgba(79, 70, 229, 0.4);
}

.check-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.check-item svg {
  flex-shrink: 0;
  color: var(--success);
}

.check-item.muted svg {
  color: var(--text-muted);
}

.check-item.muted {
  color: var(--text-muted);
}

/* FAQ accordion */
.faq-item {
  border-bottom: 1px solid var(--border-subtle);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 1rem;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}

.faq-question:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.faq-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
  color: var(--text-muted);
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding-bottom: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-item.open .faq-answer {
  display: block;
}

/* Utility */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-center { text-align: center; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.w-full { width: 100%; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
