/* ==========================================================================
   Endpoint Pages — Shared styles for /sources/ endpoint documentation pages
   ========================================================================== */

/* Breadcrumbs */
.endpoint-page .breadcrumbs {
  padding: 1rem 0;
  font-size: 0.875rem;
  opacity: 0.6;
}
.endpoint-page .breadcrumbs a {
  color: inherit;
  text-decoration: none;
}
.endpoint-page .breadcrumbs a:hover {
  opacity: 1;
}
.endpoint-page .breadcrumbs .sep {
  margin: 0 0.5rem;
}

/* Hero */
.endpoint-hero {
  padding: 3rem 2rem 4rem;
  text-align: center;
  background: linear-gradient(to bottom, rgba(255, 107, 53, 0.02), transparent);
}

.endpoint-hero .page-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.endpoint-hero .page-subtitle {
  font-size: 1.125rem;
  line-height: 1.5;
  opacity: 0.8;
  max-width: 42rem;
  margin: 0 auto 2rem;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.trust-signals {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.trust-signal {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  opacity: 0.7;
}

.trust-signal::before {
  content: "\2713";
  color: var(--color-data, #2dd4bf);
  font-weight: 700;
}

/* Content sections */
.endpoint-page .content-section {
  padding: 4rem 0;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.endpoint-page .section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.endpoint-page .section-title {
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 1rem;
}

.endpoint-page .section-subtitle {
  font-size: 1.125rem;
  opacity: 0.7;
  max-width: 42rem;
  margin: 0 auto;
  line-height: 1.5;
}

.endpoint-page .section-text {
  max-width: 42rem;
  margin: 0 auto;
  line-height: 1.7;
  font-size: 1rem;
  opacity: 0.85;
}

.endpoint-page .section-text p {
  margin-bottom: 1.25rem;
}

/* Endpoint cards / data tables */
.endpoint-card {
  background: var(--bg-surface, #ffffff);
  border-radius: 8px;
  padding: 2rem;
  border: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 2rem;
}

.endpoint-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.endpoint-card .endpoint-url {
  background: #0c0c15;
  color: #9CDCFE;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.875rem;
  display: inline-block;
  margin: 0.5rem 0 1rem;
}

.endpoint-card p {
  line-height: 1.6;
  opacity: 0.85;
  margin-bottom: 1rem;
}

.endpoint-card .credit-cost {
  font-size: 0.875rem;
  color: var(--color-data, #2dd4bf);
  font-weight: 600;
  margin-top: 0.5rem;
}

/* Data tables */
.endpoint-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 1rem 0;
}

.endpoint-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid rgba(0,0,0,0.08);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.7;
}

.endpoint-table td {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  vertical-align: top;
}

.endpoint-table code {
  background: rgba(255, 107, 53, 0.1);
  color: var(--color-accent, #ff6b35);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.8125rem;
}

.endpoint-table tr:last-child td {
  border-bottom: none;
}

.endpoint-table tr:hover td {
  background: rgba(0,0,0,0.015);
}

/* Comparison table */
.comparison-table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 600px;
}

.comparison-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid rgba(0,0,0,0.1);
  font-weight: 600;
  font-size: 0.8125rem;
  white-space: nowrap;
  background: var(--bg-surface, #ffffff);
  position: sticky;
  top: 0;
}

.comparison-table th:first-child {
  min-width: 140px;
}

.comparison-table td {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  vertical-align: top;
}

.comparison-table tr:hover td {
  background: rgba(0,0,0,0.015);
}

.comparison-table strong {
  color: var(--color-accent, #ff6b35);
}

/* Code blocks */
.endpoint-page .code-example {
  background: #0c0c15;
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.endpoint-page .code-example pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: #eaeaf0;
  white-space: pre;
  overflow-x: auto;
}

.endpoint-page .code-example .comment { color: #6A9955; font-style: italic; }
.endpoint-page .code-example .keyword { color: #569CD6; font-weight: 500; }
.endpoint-page .code-example .string { color: #CE9178; }
.endpoint-page .code-example .function { color: #DCDCAA; }
.endpoint-page .code-example .class-name { color: #4EC9B0; }
.endpoint-page .code-example .number { color: #B5CEA8; }
.endpoint-page .code-example .key { color: #9CDCFE; }
.endpoint-page .code-example .flag { color: #DCDCAA; }
.endpoint-page .code-example .operator { color: #D4D4D4; }

.code-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.5;
  color: #eaeaf0;
  margin-bottom: 0.75rem;
  display: block;
}

/* Tab navigation */
.endpoint-page .tab-buttons {
  display: inline-flex;
  gap: 0.25rem;
  margin-bottom: 2rem;
  background: var(--bg-subtle, #f0f0f4);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.06);
}

.endpoint-page .tab-button {
  padding: 0.625rem 1.25rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9375rem;
  color: #666;
  transition: all 0.15s ease;
  border-radius: 8px;
  white-space: nowrap;
}

.endpoint-page .tab-button:hover {
  color: var(--text-secondary, #444);
}

.endpoint-page .tab-button.active {
  background: var(--bg-surface, #ffffff);
  color: var(--text, #0c0c14);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.endpoint-page .tab-content {
  display: none;
}

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

/* Use cases */
.use-cases-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin: 2rem 0;
}

.use-case {
  background: var(--bg-surface, #ffffff);
  border-radius: 8px;
  padding: 2.5rem;
  border: 1px solid rgba(0,0,0,0.06);
}

.use-case h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--color-accent, #ff6b35);
}

.use-case h4 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.6;
  margin: 1rem 0 0.5rem;
}

.use-case p {
  line-height: 1.6;
  opacity: 0.85;
  margin-bottom: 0.75rem;
}

/* FAQ */
.faq-list {
  max-width: 48rem;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 1.5rem 0;
}

.faq-item:first-child {
  border-top: 1px solid rgba(0,0,0,0.06);
}

.faq-question {
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  user-select: none;
}

.faq-question::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  opacity: 0.4;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-item.open .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  line-height: 1.6;
  opacity: 0.8;
}

.faq-item.open .faq-answer {
  max-height: 500px;
  padding-top: 1rem;
}

/* Related endpoints */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.related-link {
  display: block;
  padding: 1.25rem;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
}

.related-link:hover {
  border-color: var(--color-accent, #ff6b35);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.related-link h4 {
  font-size: 0.9375rem;
  margin-bottom: 0.375rem;
}

.related-link p {
  font-size: 0.8125rem;
  opacity: 0.6;
  line-height: 1.4;
}

/* CTA footer */
.endpoint-cta {
  padding: 4rem 2rem;
  text-align: center;
  background: linear-gradient(to top, rgba(255, 107, 53, 0.03), transparent);
  border-top: 1px solid rgba(0,0,0,0.05);
}

.endpoint-cta h2 {
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 1rem;
}

.endpoint-cta p {
  font-size: 1.125rem;
  opacity: 0.7;
  max-width: 36rem;
  margin: 0 auto 2rem;
  line-height: 1.5;
}

.endpoint-cta .cta-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  opacity: 0.6;
}

.endpoint-cta .cta-links a {
  color: inherit;
}

/* Pricing tables */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

/* Endpoint overview grid */
.endpoints-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

/* Pipeline / flow visualization */
.pipeline-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 2rem 0;
  font-size: 0.9375rem;
}

.pipeline-step {
  background: var(--bg-surface, #ffffff);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.08);
}

.pipeline-arrow {
  opacity: 0.3;
  font-size: 1.25rem;
}

/* Two-column layout for sections */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

/* Buttons */
.endpoint-page .btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all 0.15s ease;
  display: inline-block;
  text-align: center;
  font-family: inherit;
  cursor: pointer;
  border: none;
}

/* Responsive */
@media (max-width: 768px) {
  .endpoint-hero {
    padding: 2rem 1rem 3rem;
  }

  .trust-signals {
    flex-direction: column;
    gap: 0.75rem;
  }

  .endpoint-page .content-section {
    padding: 3rem 0;
  }

  .endpoint-page .section-title {
    font-size: 1.5rem;
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .endpoint-card {
    padding: 1.5rem;
  }

  .use-case {
    padding: 1.5rem;
  }

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

  .pipeline-steps {
    flex-direction: column;
  }

  .pipeline-arrow {
    transform: rotate(90deg);
  }

  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 576px) {
  .endpoint-table th,
  .endpoint-table td {
    padding: 0.5rem 0.625rem;
    font-size: 0.8125rem;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 0.5rem 0.625rem;
    font-size: 0.8125rem;
  }

  .endpoint-page .code-example {
    padding: 1rem;
    margin-left: -1rem;
    margin-right: -1rem;
    border-radius: 0;
  }
}
