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

:root {
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --primary-light: #818CF8;
  --secondary: #1E293B;
  --text: #334155;
  --text-light: #64748B;
  --text-dark: #0F172A;
  --bg: #FFFFFF;
  --bg-alt: #F8FAFC;
  --border: #E2E8F0;
  --success: #10B981;
  --error: #EF4444;
  --gradient: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --radius: 8px;
  --radius-lg: 16px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-dark);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.5rem; }

@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg-alt);
  color: var(--text-dark);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-outline {
  background: transparent;
  color: var(--text-dark);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--bg-alt);
  border-color: var(--text-light);
}

.btn-white {
  background: white;
  color: var(--primary);
  border-color: white;
}

.btn-white:hover {
  background: var(--bg-alt);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

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

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

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

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

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

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
  .mobile-menu-btn {
    display: block;
  }
}

/* Hero Section */
.hero {
  padding: 140px 0 80px;
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

@media (max-width: 1000px) {
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.badge {
  display: inline-block;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(79, 70, 229, 0.1);
  border-radius: 50px;
  margin-bottom: 24px;
}

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

.hero-description {
  font-size: 1.25rem;
  color: var(--text-light);
  margin: 24px 0 32px;
  max-width: 500px;
}

@media (max-width: 1000px) {
  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

@media (max-width: 1000px) {
  .hero-cta {
    justify-content: center;
  }
}

.hero-stats {
  display: flex;
  gap: 48px;
  margin-top: 48px;
}

@media (max-width: 1000px) {
  .hero-stats {
    justify-content: center;
  }
}

@media (max-width: 500px) {
  .hero-stats {
    flex-direction: column;
    gap: 24px;
  }
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-dark);
}

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

/* Hero Demo */
.hero-demo {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.code-window {
  background: #1E293B;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: #0F172A;
}

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

.code-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #334155;
}

.code-dots span:first-child { background: #EF4444; }
.code-dots span:nth-child(2) { background: #F59E0B; }
.code-dots span:last-child { background: #10B981; }

.code-title {
  font-size: 13px;
  color: #64748B;
}

.code-content {
  padding: 24px;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.8;
  overflow-x: auto;
}

.code-content code {
  color: #E2E8F0;
}

.code-method { color: #10B981; font-weight: 600; }
.code-string { color: #F59E0B; }
.code-number { color: #60A5FA; }
.code-comment { color: #64748B; }
.code-keyword { color: #C084FC; }
.code-variable { color: #E2E8F0; }
.code-function { color: #60A5FA; }
.code-property { color: #34D399; }

.demo-result {
  background: white;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-lg);
}

.demo-image {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.demo-image-placeholder {
  width: 100%;
}

.browser-mockup {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.browser-header {
  background: #f1f3f4;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

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

.browser-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ddd;
}

.browser-dots span:first-child { background: #ff5f57; }
.browser-dots span:nth-child(2) { background: #ffbd2e; }
.browser-dots span:last-child { background: #28ca41; }

.browser-url {
  flex: 1;
  background: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  color: #666;
  border: 1px solid #e0e0e0;
}

.browser-content {
  padding: 32px;
  background: white;
  min-height: 180px;
}

/* Features Section */
.features {
  padding: 100px 0;
}

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

.section-header p {
  color: var(--text-light);
  font-size: 1.125rem;
  margin-top: 12px;
}

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

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

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

.feature-card {
  padding: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(79, 70, 229, 0.1);
  border-radius: var(--radius);
  color: var(--primary);
  margin-bottom: 20px;
}

.feature-card h3 {
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Pricing Section */
.pricing {
  padding: 100px 0;
  background: var(--bg-alt);
}

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

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

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

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

.pricing-card:hover {
  box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 50px;
}

.pricing-header {
  text-align: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.pricing-header h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.price-amount {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-dark);
}

.price-period {
  color: var(--text-light);
}

.pricing-description {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 8px;
}

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

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 0.95rem;
}

.pricing-features li svg {
  flex-shrink: 0;
  color: var(--success);
}

.pricing-features li.disabled {
  color: var(--text-light);
}

.pricing-features li.disabled svg {
  color: var(--text-light);
}

/* Documentation Section */
.docs {
  padding: 100px 0;
}

.docs-content {
  display: grid;
  gap: 48px;
}

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

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

.doc-step {
  display: flex;
  gap: 20px;
}

.step-number {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}

.step-content h3 {
  margin-bottom: 8px;
}

.step-content p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  padding: 10px 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tab:hover {
  background: var(--border);
}

.tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.docs-examples pre {
  background: #1E293B;
  border-radius: var(--radius-lg);
  padding: 24px;
  overflow-x: auto;
}

.docs-examples code {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.8;
  color: #E2E8F0;
}

/* API Table */
.api-reference {
  margin-top: 48px;
}

.api-reference h3 {
  margin-bottom: 24px;
}

.api-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.api-table th,
.api-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.api-table th {
  background: var(--bg-alt);
  font-weight: 600;
  color: var(--text-dark);
}

.api-table code {
  background: var(--bg-alt);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--primary);
}

/* CTA Section */
.cta {
  padding: 100px 0;
  background: var(--gradient);
  text-align: center;
}

.cta h2 {
  color: white;
  margin-bottom: 16px;
}

.cta p {
  color: rgba(255,255,255,0.9);
  font-size: 1.125rem;
  margin-bottom: 32px;
}

/* Footer */
.footer {
  padding: 80px 0 40px;
  background: var(--secondary);
  color: rgba(255,255,255,0.7);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

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

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

.footer-brand .logo {
  color: white;
  margin-bottom: 16px;
}

.footer-brand p {
  font-size: 0.95rem;
  max-width: 300px;
}

.footer-links h4 {
  color: white;
  font-size: 1rem;
  margin-bottom: 20px;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.9rem;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  margin: 24px;
  box-shadow: var(--shadow-xl);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-light);
}

.modal-body h2 {
  text-align: center;
  margin-bottom: 24px;
}

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

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.modal-switch {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-light);
}

.modal-switch a {
  color: var(--primary);
  font-weight: 500;
}

.auth-result {
  margin-top: 24px;
  padding: 16px;
  border-radius: var(--radius);
  display: none;
}

.auth-result.success {
  display: block;
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.auth-result.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.auth-result .api-key {
  margin-top: 12px;
  padding: 12px;
  background: #1E293B;
  border-radius: var(--radius);
  font-family: monospace;
  font-size: 12px;
  color: #E2E8F0;
  word-break: break-all;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-result .api-key code {
  flex: 1;
  word-break: break-all;
}

.copy-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 6px;
  cursor: pointer;
  color: #94A3B8;
  transition: all 0.2s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #E2E8F0;
  border-color: rgba(255, 255, 255, 0.3);
}

.copy-btn:active {
  transform: scale(0.95);
}

/* Dashboard modal adjustments */
.auth-result.success strong {
  font-size: 16px;
  color: var(--text-dark);
}

.auth-result.success .btn {
  text-decoration: none;
}

.auth-result.success .btn-primary {
  background: var(--primary);
  color: white;
}

.auth-result.success .btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dark);
}

.auth-result.success .btn-outline:hover {
  background: var(--bg-alt);
}
