/* CSS Variables */
:root {
  /* Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a24;
  --accent-purple: #635bff;
  --accent-cyan: #80e9ff;
  --accent-mint: #00d4aa;
  --text-primary: #f6f9fc;
  --text-secondary: #a3acb9;
  --text-muted: #6b7280;
  --gradient-main: linear-gradient(135deg, #635bff 0%, #80e9ff 50%, #00d4aa 100%);

  /* Typography */
  --font-display: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'General Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Sizing */
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 6rem 2rem 4rem;
}

.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 91, 255, 0.3) 0%, rgba(128, 233, 255, 0.1) 40%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  filter: blur(60px);
  pointer-events: none;
}

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

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

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

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: var(--gradient-main);
  color: var(--bg-primary);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(99, 91, 255, 0.3);
}

/* Demo Section */
.demo-section {
  padding: 6rem 2rem;
  background: var(--bg-secondary);
}

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

.section-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 3rem;
}

.input-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.payment-input {
  flex: 1;
  padding: 1rem 1.5rem;
  background: var(--bg-tertiary);
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.payment-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 4px rgba(99, 91, 255, 0.2);
}

.generate-button {
  padding: 1rem 2rem;
  background: var(--gradient-main);
  border: none;
  border-radius: var(--border-radius);
  color: var(--bg-primary);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  min-width: 140px;
}

.generate-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 91, 255, 0.3);
}

.generate-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.generate-button.loading .btn-text {
  opacity: 0;
}

.generate-button.loading .btn-loader {
  display: block;
}

.btn-loader {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: var(--bg-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Example Chips */
.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 2rem;
}

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

.example-chip {
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.example-chip:hover {
  background: rgba(99, 91, 255, 0.1);
  border-color: var(--accent-purple);
  color: var(--text-primary);
}

/* Results Panel */
.results-panel {
  margin-top: 2rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.results-panel.hidden {
  display: none;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

.result-card {
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.entities-container {
  padding: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  min-height: 120px;
}

.entity-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
}

.entity-pill.amount {
  background: rgba(0, 212, 170, 0.15);
  color: var(--accent-mint);
  border: 1px solid rgba(0, 212, 170, 0.3);
}

.entity-pill.type {
  background: rgba(99, 91, 255, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(99, 91, 255, 0.3);
}

.entity-pill.interval,
.entity-pill.duration {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.entity-pill.trial {
  background: rgba(128, 233, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(128, 233, 255, 0.3);
}

.entity-pill.currency,
.entity-pill.description,
.entity-pill.condition,
.entity-pill.split {
  background: rgba(163, 172, 185, 0.15);
  color: var(--text-secondary);
  border: 1px solid rgba(163, 172, 185, 0.3);
}

/* Code Block */
.code-block {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.result-card .code-block {
  margin: 1rem;
  border-radius: var(--border-radius-sm);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.code-lang {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-block pre {
  padding: 1.25rem;
  margin: 0;
  overflow-x: auto;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-primary);
}

#json-output code {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Compare Section */
.compare-section {
  padding: 6rem 2rem;
  background: var(--bg-primary);
}

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

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
}

@media (max-width: 900px) {
  .compare-grid {
    grid-template-columns: 1fr;
  }
}

.compare-card {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  position: relative;
}

.compare-card.traditional {
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.compare-card.ai-way {
  border: 1px solid rgba(99, 91, 255, 0.3);
  box-shadow: 0 0 40px rgba(99, 91, 255, 0.1);
}

.compare-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.compare-badge {
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.compare-badge.old {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.compare-badge.new {
  background: var(--gradient-main);
  color: var(--bg-primary);
}

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

.code-traditional {
  font-size: 0.75rem;
  line-height: 1.5;
}

.code-ai {
  font-size: 1.125rem;
  color: var(--accent-cyan);
}

.ai-arrow {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
  color: var(--accent-purple);
}

.ai-result {
  background: var(--bg-tertiary);
  border-radius: var(--border-radius);
  padding: 1rem;
}

.result-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.75rem;
}

.mini-entities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mini-entities .entity-pill {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
}

/* Footer */
.footer {
  padding: 3rem 2rem;
  background: var(--bg-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-content p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.footer-sub {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

/* Error state */
.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  margin-top: 1rem;
  text-align: center;
}

/* Syntax highlighting for JSON */
.json-key { color: var(--accent-cyan); }
.json-string { color: var(--accent-mint); }
.json-number { color: #fbbf24; }
.json-boolean { color: var(--accent-purple); }
.json-null { color: var(--text-muted); }

/* Mobile Responsive */
@media (max-width: 640px) {
  .navbar-content {
    padding: 1rem;
  }

  .nav-links {
    gap: 1rem;
    font-size: 0.875rem;
  }

  .hero {
    padding: 5rem 1rem 3rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .demo-section,
  .compare-section {
    padding: 4rem 1rem;
  }

  .input-container {
    flex-direction: column;
  }

  .generate-button {
    width: 100%;
  }

  .examples {
    justify-content: center;
  }

  .section-title {
    font-size: 2rem;
  }
}
