/* TrenchFeed Documentation Styles
   This CSS defines a modern, responsive layout inspired by professional API docs
   like financialdatasets.ai. It uses CSS variables for colours to support
   automatic light/dark theming via the `prefers‑color‑scheme` media query.  */

/* Base colour palette (light mode) */
:root {
  --primary: #10B981; /* emerald green from Mintlify config */
  --primary-dark: #059669; /* darker accent */
  --background: #F9FAFB; /* light background */
  --surface: #FFFFFF; /* card background */
  --text: #1F2937; /* dark text */
  --muted: #6B7280; /* muted text */
  --border: #E5E7EB; /* light borders */
  --nav-height: 64px;
  --radius: 8px;
  --shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  font-family: 'Inter', sans-serif;
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
  :root {
    --background: #0F172A;
    --surface: #111827;
    --text: #F3F4F6;
    --muted: #9CA3AF;
    --border: #374151;
    --shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  }
}

/* Global reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--background);
  color: var(--text);
  font-family: inherit;
  line-height: 1.6;
  scroll-behavior: smooth;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* Header navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 1000;
  box-shadow: var(--shadow);
}

header .logo img {
  height: 32px;
  width: auto;
}

nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

/* Hero section */
.hero {
  padding-top: calc(var(--nav-height) + 3rem);
  padding-bottom: 4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
  max-width: 1280px;
  margin: 0 auto;
}

.hero .text {
  flex: 1 1 400px;
}

.hero h1 {
  font-size: 2.75rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: var(--muted);
  max-width: 600px;
}

.hero .cta {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  font-weight: 600;
  transition: background 0.2s ease;
}

.hero .cta:hover {
  background: var(--primary-dark);
}

.hero .image {
  flex: 1 1 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero picture,
.hero img {
  width: 100%;
  max-width: 550px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Section container */
section {
  padding: 4rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

section h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  margin-top: 2rem;
  font-weight: 600;
  color: var(--primary);
}

/* Rate limits table */
.rate-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.rate-table th,
.rate-table td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
  font-size: 0.95rem;
}

.rate-table th {
  background: var(--surface);
  font-weight: 600;
}

.rate-table tr:nth-child(even) {
  background: rgba(0,0,0,0.02);
}

/* API playground styles */
.playground {
  background: var(--surface);
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 1rem;
}

.playground label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.playground input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--text);
  margin-top: 0.25rem;
}

.playground button {
  margin-right: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.playground button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.playground button:hover:not([disabled]) {
  background: var(--primary-dark);
}

.output {
  height: 200px;
  overflow-y: auto;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-top: 0.5rem;
  font-family: monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  color: var(--text);
}

/* Sample code and response blocks */
.sample {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
}

.sample h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
}

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

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.pricing-card h3 {
  margin-top: 0;
}

.pricing-card .price {
  font-size: 2rem;
  margin: 0.5rem 0;
  font-weight: 700;
}

.pricing-card ul {
  list-style: none;
  margin: 1rem 0;
  padding-left: 0;
}

.pricing-card ul li {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pricing-card ul li::before {
  content: '✓';
  color: var(--primary);
}

.pricing-card a {
  margin-top: auto;
  background: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  text-align: center;
  font-weight: 600;
}

.pricing-card a:hover {
  background: var(--primary-dark);
}

/* Footer */
footer {
  margin-top: 4rem;
  padding: 2rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

footer a {
  color: var(--primary);
  margin: 0 0.5rem;
}

footer a:hover {
  color: var(--primary-dark);
}

/* Code example and error blocks */
.code-examples,
.error-examples {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.code-examples h3,
.error-examples h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  color: var(--primary);
}

.lang-example {
  margin-bottom: 1.5rem;
}

.lang-example pre,
.error-examples pre {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  overflow-x: auto;
  font-family: monospace;
  font-size: 0.85rem;
  white-space: pre;
}

.trial {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}