/* ============================================
   EarningsAPI — Professional CSS
   ============================================ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #1e1e35;
  --bg-input: #16162a;
  --border: #2a2a45;
  --border-light: #3a3a55;
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a85;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-dark: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --green: #22c55e;
  --green-dark: #16a34a;
  --red: #ef4444;
  --yellow: #eab308;
  --orange: #f97316;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --transition: all 0.2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
  scroll-behavior: smooth;
}

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

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

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: var(--transition);
}
a:hover { color: var(--text-primary); }

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 0;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.25rem;
}
.logo:hover { color: var(--text-primary); }
.logo-icon { font-size: 1.5rem; display: inline-flex; align-items: center; }
.logo-icon svg { width: 22px; height: 22px; color: var(--accent-light); stroke-width: 2; }
.accent { color: var(--accent-light); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.btn-primary { color: white; }
.nav-links a.btn-primary:hover { color: white; }

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

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
  background: var(--accent-dark);
  color: white;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn-lg { padding: 16px 36px; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* ============ HERO ============ */
.hero {
  padding: 180px 0 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: 32px;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-light) 0%, #a78bfa 50%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 56px;
  line-height: 1.8;
}

.hero-cta {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 72px;
}

.hero-code {
  max-width: 700px;
  margin: 0 auto;
  text-align: left;
}

/* ============ CODE BLOCKS ============ */
.code-block, .hero-code {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.code-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.code-dot.red { background: #ff5f57; }
.code-dot.yellow { background: #febc2e; }
.code-dot.green { background: #28c840; }

.code-title {
  margin-left: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

pre {
  padding: 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
}

.code-keyword { color: #c792ea; }
.code-string { color: #c3e88d; }
.code-comment { color: #546e7a; }
.code-number { color: #f78c6c; }

.code-block.compact { margin: 12px 0; }
.code-block.compact pre { padding: 12px 16px; font-size: 0.8rem; }

/* ============ STATS BAR ============ */
.stats-bar {
  padding: 64px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 48px;
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 8px;
  letter-spacing: 0.02em;
}

/* ============ FEATURES ============ */
.features {
  padding: 140px 0;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.section-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 48px;
  line-height: 1.7;
}

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

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  transition: all 0.3s ease;
}
.feature-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.08);
}

.feature-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 16px;
  margin-bottom: 24px;
  color: var(--accent-light);
}

.feature-icon svg {
  width: 26px;
  height: 26px;
  stroke-width: 1.5;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
}

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

/* ============ CODE EXAMPLES ============ */
.examples {
  padding: 140px 0;
  background: var(--bg-primary);
}

.code-tabs {
  display: flex;
  width: fit-content;
  margin: 0 auto 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 0;
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 32px;
  min-width: 120px;
  text-align: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  background: var(--accent);
  color: white;
}

.code-example { display: none; max-width: 800px; margin: 0 auto; }
.code-example.active { display: block; }

/* ============ PRICING ============ */
.pricing {
  padding: 140px 0;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  align-items: start;
  max-width: 1080px;
  margin: 0 auto;
}

.price-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 36px;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
}
.price-card:hover {
  border-color: var(--border-light);
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.price-card.featured {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--bg-card-hover) 0%, var(--bg-card) 100%);
  box-shadow: 0 0 40px var(--accent-glow);
}

.price-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  padding: 4px 16px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.price-tier {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.price-amount {
  margin-bottom: 8px;
}

.price-currency {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
  vertical-align: top;
}

.price-number {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.price-period {
  font-size: 1rem;
  color: var(--text-muted);
}

.price-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.price-features {
  list-style: none;
  text-align: left;
  margin-bottom: 32px;
}

.price-features li {
  padding: 8px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.price-features li:last-child { border-bottom: none; }

.price-features .included { color: var(--text-primary); }
.price-features .excluded { color: var(--text-muted); }

/* ============ CTA ============ */
.cta {
  padding: 140px 0;
  text-align: center;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
}

.cta h2 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.cta p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 48px;
  line-height: 1.7;
}

/* ============ FOOTER ============ */
.footer {
  padding: 80px 0 48px;
  border-top: 1px solid var(--border);
}

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

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 12px;
  line-height: 1.6;
}

.footer-links h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.footer-links a {
  display: block;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 4px 0;
}
.footer-links a:hover { color: var(--text-primary); }

.footer-bottom {
  text-align: center;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============ AUTH PAGES ============ */
.auth-page {
  min-height: 100vh;
}

.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding: 100px 24px 40px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
}

.auth-card h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 8px;
  text-align: center;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

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

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

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

.optional {
  font-weight: 400;
  color: var(--text-muted);
}

.form-group 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-family: var(--font);
  font-size: 0.95rem;
  transition: var(--transition);
}

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

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

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

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

.auth-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-benefits {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.benefit {
  font-size: 0.8rem;
  color: var(--green);
  font-weight: 500;
}

/* ============ DASHBOARD ============ */
.dashboard-page {
  background: var(--bg-primary);
}

.dashboard-nav {
  position: relative;
  margin-bottom: 0;
}

.dashboard-container {
  padding: 32px 0 80px;
  min-height: calc(100vh - 64px);
}

.welcome-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(167, 139, 250, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 32px;
}

.welcome-banner h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.welcome-banner p {
  color: var(--text-secondary);
}

.dash-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
}

.dash-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
}

/* API Key Box */
.api-key-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.api-key-display {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  min-width: 0;
}

.api-key-display code {
  flex: 1;
  font-size: 0.9rem;
  color: var(--accent-light);
  word-break: break-all;
}

.hint {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hint code {
  background: var(--bg-primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.inline-form {
  display: inline;
}

/* Stats Cards */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}

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

.stat-card-value {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.stat-card-limit {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-card-limit a {
  color: var(--accent-light);
  font-weight: 600;
}

.tier-free { color: var(--text-secondary); }
.tier-pro { color: var(--accent-light); }
.tier-enterprise { color: var(--orange); }

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td code {
  font-size: 0.82rem;
  color: var(--accent-light);
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-free {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
}

.badge-pro {
  background: var(--accent-glow);
  color: var(--accent-light);
}

/* Quick Start */
.quickstart-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.step-number {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.step-content h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

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

/* Upgrade */
.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.upgrade-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
}

.upgrade-card h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.upgrade-card ul {
  list-style: none;
  margin-bottom: 20px;
}

.upgrade-card li {
  padding: 4px 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.upgrade-card li::before {
  content: '✓ ';
  color: var(--green);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 20px;
    gap: 12px;
  }
  .nav-toggle { display: block; }

  .hero h1 { font-size: 2.5rem; }
  .hero { padding: 140px 0 80px; }
  .hero-cta { flex-direction: column; align-items: center; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .stat-number { font-size: 1.5rem; }

  .features-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }

  .stats-cards { grid-template-columns: 1fr 1fr; }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; }

  .api-key-box { flex-direction: column; }
  .api-key-display { width: 100%; }

  .auth-card { padding: 32px 24px; }
  .auth-benefits { flex-direction: column; align-items: center; gap: 8px; }

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

@media (max-width: 480px) {
  .hero h1 { font-size: 1.75rem; }
  .stats-cards { grid-template-columns: 1fr; }
  .dash-section { padding: 20px; }
}
