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

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #818cf8;
  --secondary: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-dark: #0f172a;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --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);
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* Header */
.home-header {
  text-align: center;
  padding: 60px 20px 40px;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1e293b 100%);
  color: white;
  margin-bottom: 40px;
}

.home-header h1 {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.home-header .subtitle {
  font-size: 1.2rem;
  color: #94a3b8;
  margin-bottom: 30px;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.main-nav a {
  display: inline-block;
  padding: 10px 20px;
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all 0.2s;
  background: rgba(255,255,255,0.1);
}

.main-nav a:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

/* Breadcrumb */
.breadcrumb {
  padding: 20px;
  max-width: 1000px;
  margin: 0 auto;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Main layout */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* Page headers */
header {
  padding: 30px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
  text-align: center;
}

header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.page-subtitle {
  color: #64748b;
  font-size: 0.95rem;
  margin-top: 12px;
  line-height: 1.5;
}

.breadcrumb {
  margin-bottom: 16px;
}

/* Intro section */
.intro {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 40px;
  box-shadow: var(--shadow);
}

.intro h2 {
  font-size: 1.8rem;
  margin-bottom: 16px;
  color: var(--text);
}

.intro p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Category list */
.categories-section, .featured-section {
  margin-bottom: 50px;
}

.categories-section h2, .featured-section h2 {
  font-size: 1.4rem;
  margin-bottom: 20px;
  color: var(--text);
}

.category-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  list-style: none;
}

.category-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  box-shadow: var(--shadow);
  transition: all 0.2s;
  border: 1px solid var(--border-light);
}

.category-list a:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.category-list .count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 12px;
}

/* Category grid (all categories page) */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.category-card {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  transition: all 0.2s;
}

.category-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.category-card h3 {
  margin-bottom: 8px;
}

.category-card h3 a {
  color: var(--primary);
  text-decoration: none;
}

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

/* API Grid */
.api-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* API Card */
.api-card {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

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

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

.api-card h3 a {
  color: var(--primary);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 600;
}

.api-card h3 a:hover {
  color: var(--primary-dark);
}

.api-card .description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.api-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.category-tag {
  background: var(--primary);
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge.free {
  background: #dcfce7;
  color: #166534;
}

.badge.auth {
  background: #fef3c7;
  color: #92400e;
}

.works-in {
  font-size: 0.8rem;
  color: var(--text-light);
  width: 100%;
}

.card-links {
  display: flex;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.card-links .view-btn {
  flex: 1;
  padding: 10px 16px;
  background: var(--primary);
  color: white;
  text-align: center;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.card-links .view-btn:hover {
  background: var(--primary-dark);
}

.card-links a:not(.view-btn) {
  padding: 10px 16px;
  background: var(--bg);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.card-links a:not(.view-btn):hover {
  background: var(--border);
  color: var(--text);
}

/* API Detail Page */
.api-detail-page {
  max-width: 800px;
}

.api-overview {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.api-overview h2 {
  font-size: 1.3rem;
  margin-bottom: 16px;
  color: var(--text);
}

.overview-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.notes {
  margin-top: 20px;
  padding: 16px 20px;
  background: #fef3c7;
  border-radius: var(--radius-sm);
  color: #92400e;
  font-size: 0.95rem;
}

.quick-links {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.quick-links h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.link-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}

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

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

.btn:not(.primary) {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

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

.api-details {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.api-details h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.example-request {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.example-request h2 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.example-request pre {
  background: var(--bg-dark);
  color: #e2e8f0;
  padding: 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 16px 0;
}

.example-request-url {
  background: var(--bg);
  padding: 16px;
  border-radius: var(--radius-sm);
  margin: 16px 0;
  border-left: 3px solid var(--primary);
}

.example-request-url code {
  word-break: break-all;
  font-size: 0.85rem;
}

.example-response {
  margin: 20px 0;
}

.example-response strong,
.example-request-url strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

.example-note {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.live-example-box {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
  border: 2px solid var(--primary);
}

.example-breakdown {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: var(--radius);
  padding: 24px;
  margin: 20px 0;
  color: #e2e8f0;
}

.example-breakdown h3 {
  color: #60a5fa;
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.what-it-means {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 16px;
  color: #e2e8f0;
}

.field-explanations {
  list-style: none;
  padding: 0;
  margin: 0;
}

.field-explanations li {
  background: rgba(255,255,255,0.1);
  padding: 12px 16px;
  margin: 8px 0;
  border-radius: var(--radius-sm);
  border-left: 3px solid #60a5fa;
}

.field-explanations strong {
  color: #60a5fa;
}

.how-to-use {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.how-to-use h2 {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.how-to-use h3 {
  font-size: 1rem;
  color: var(--text);
  margin: 20px 0 10px;
}

.how-to-use pre {
  background: var(--bg-dark);
  color: #e2e8f0;
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 12px 0;
}

.how-to-use p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.use-cases {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.use-cases h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.use-cases ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.use-cases li {
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
}

.related-apis {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.related-apis h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.page-nav {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.back-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.example-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.response-format {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.response-format h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.response-format pre {
  background: var(--bg-dark);
  color: #a5f3fc;
  padding: 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

.example-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }

.other-categories {
  margin-top: 50px;
  padding: 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.other-categories h3 {
  margin-bottom: 16px;
  color: var(--text);
}

.other-categories ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.other-categories a {
  padding: 8px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
}

.view-all {
  text-align: center;
  margin-top: 24px;
}

.view-all a {
  color: var(--primary);
  font-weight: 500;
}

/* Footer */
footer {
  margin-top: 60px;
  padding: 30px 20px;
  background: var(--bg-dark);
  color: #94a3b8;
  text-align: center;
}

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

footer p {
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 600px) {
  .home-header h1 {
    font-size: 2rem;
  }
  
  .category-list, .category-grid, .api-grid {
    grid-template-columns: 1fr;
  }
  
  .api-card {
    padding: 20px;
  }
  
  .link-buttons {
    flex-direction: column;
  }
  
  .btn {
    text-align: center;
  }
  
  .details-grid {
    grid-template-columns: 1fr;
  }
}

/* Floating Donate Button */
.floating-donate {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  background: #fff;
  padding: 10px 15px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  border: 2px solid #0070ba;
  transition: transform 0.2s, box-shadow 0.2s;
}

.floating-donate:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.floating-donate input[type="image"] {
  display: block;
  height: 43px;
  width: auto;
}

.floating-donate form {
  margin: 0;
}

/* ============================================
   API DETAIL PAGE - Static, SEO-optimized
   ============================================ */

.api-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* API Header */
.api-header {
  text-align: center;
  padding: 40px 20px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 40px;
}

.api-header .breadcrumb {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.api-header .breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.api-header .breadcrumb a:hover {
  text-decoration: underline;
}

.api-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}

.api-meta {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Section headings */
.api-page section {
  margin-bottom: 48px;
}

.api-page h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}

.api-page h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 10px;
}

/* TL;DR Section */
.tldr {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  padding: 32px;
  border-radius: var(--radius);
  margin-bottom: 48px;
}

.tldr h2 {
  color: white;
  border-bottom: 2px solid rgba(255,255,255,0.3);
  margin-bottom: 20px;
}

.tldr-content p {
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.tldr-content code {
  background: rgba(0,0,0,0.2);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.95em;
}

.no-key-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  margin-top: 8px;
}

/* Overview */
.overview p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text);
}

/* Live Example Section */
.live-example {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.example-intro {
  margin-bottom: 24px;
  font-size: 1rem;
  color: var(--text-secondary);
}

.example-box {
  display: grid;
  gap: 24px;
}

.example-request, .example-response {
  background: var(--bg);
  padding: 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.example-request h3, .example-response h3 {
  margin-top: 0;
  color: var(--primary);
  font-size: 1rem;
}

.example-request pre, .example-response pre {
  background: var(--bg-dark);
  color: #e2e8f0;
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 12px 0;
}

.try-btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s;
  text-align: center;
}

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

/* Field Explanations */
.fields-intro {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.fields-list {
  display: grid;
  gap: 12px;
}

.fields-list dt {
  font-weight: 600;
  color: var(--text);
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-left: 4px solid var(--primary);
}

.fields-list dd {
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  margin: 0;
  color: var(--text-secondary);
  border-left: 4px solid var(--primary);
  border-top: 1px solid var(--border-light);
}

/* Code Examples */
/* Code blocks - make long URLs/code wrap on mobile */
.code-examples pre,
.example-request pre, 
.example-response pre,
.tldr pre {
  background: var(--bg-dark);
  color: #e2e8f0;
  padding: 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 16px 0;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: break-word;
}

.code-examples code,
.example-request code,
.example-response code {
  white-space: pre-wrap;
}

/* Long URLs in text need to break */
.api-page code,
.tldr-content code {
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  display: inline-block;
}

.code-examples h3 {
  margin-top: 24px;
}

/* FAQ Section */
.faq-list {
  display: grid;
  gap: 16px;
}

.faq-list dt {
  font-weight: 700;
  color: var(--text);
  font-size: 1.05rem;
}

.faq-list dd {
  color: var(--text-secondary);
  line-height: 1.7;
  padding-left: 16px;
  border-left: 3px solid var(--secondary);
}

.faq-list pre {
  background: var(--bg-dark);
  color: #e2e8f0;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-top: 8px;
  display: inline-block;
}

/* API Details */
.details-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.details-grid dt {
  background: var(--bg);
  padding: 16px 20px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.details-grid dd {
  padding: 16px 20px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.details-grid dt:last-of-type, .details-grid dd:last-of-type {
  border-bottom: none;
}

.details-grid a {
  color: var(--primary);
}

/* Related APIs */
.related-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.related-list li {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.related-list a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.related-list a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .api-header h1 {
    font-size: 1.8rem;
  }
  
  .tldr {
    padding: 24px;
  }
  
  .details-grid {
    grid-template-columns: 1fr;
  }
  
  .details-grid dt {
    background: var(--bg);
    padding: 8px 16px;
    border-bottom: none;
  }
  
  .details-grid dd {
    padding: 8px 16px 16px;
  }
  
  .example-request pre, .example-response pre {
    font-size: 0.8rem;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .api-page {
    padding: 0 12px 40px;
  }
  
  .api-header {
    padding: 24px 12px;
  }
  
  .api-header h1 {
    font-size: 1.5rem;
  }
  
  .tldr {
    padding: 20px;
  }
  
  .live-example,
  .code-examples pre {
    padding: 16px;
  }
  
  .floating-donate {
    right: 8px;
    bottom: 8px;
    padding: 6px 10px;
  }
  
  .floating-donate input[type="image"] {
    height: 36px;
  }
}

/* Print styles */
@media print {
  .skip-link { display: none; }
}

/* Accessibility: focus styles */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  z-index: 10000;
}

.skip-link:focus {
  top: 0;
}

/* Search section */
.search-section {
  max-width: 960px;
  margin: 0 auto 40px;
  padding: 0 20px;
}

.search-form {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.search-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.search-row input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.search-row input[type="text"]:focus {
  border-color: var(--primary);
  outline: none;
}

.search-row select {
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: white;
  cursor: pointer;
}

.search-btn {
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

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

.result-count {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.loading, .no-results {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.api-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.api-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

.api-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.api-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.api-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.api-card-title a {
  color: var(--text);
  text-decoration: none;
}

.api-card-title a:hover {
  color: var(--primary);
}

.favorite-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 2px 6px;
  transition: color 0.2s, transform 0.2s;
}

.favorite-btn.active {
  color: var(--warning);
}

.favorite-btn:hover {
  transform: scale(1.2);
}

.api-card-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.api-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.api-card-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.api-card-links a {
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.api-card-links a:hover {
  text-decoration: underline;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding: 16px;
}

.pagination-btn {
  padding: 8px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--primary-dark);
}

.pagination-btn:disabled {
  background: var(--border);
  color: var(--text-light);
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Favorites bar */
.favorites-section {
  max-width: 960px;
  margin: 0 auto 20px;
  padding: 0 20px;
}

.favorites-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 0.95rem;
  color: #92400e;
}

.clear-btn {
  background: none;
  border: 1px solid #d97706;
  color: #92400e;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.clear-btn:hover {
  background: #fde68a;
}

@media (max-width: 600px) {
  .search-row {
    flex-direction: column;
  }
  .search-row input[type="text"],
  .search-row select,
  .search-btn {
    width: 100%;
  }
  .api-grid {
    grid-template-columns: 1fr;
  }
  .code-tabs { flex-direction: column; }
  .details-table { font-size: 0.9rem; }
  .details-table th, .details-table td { padding: 8px; }
}

/* Hand-crafted page styles */
.tldr-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 24px;
  margin: 16px 0;
}
.tldr-box p { margin-bottom: 8px; }
.tldr-box p:last-child { margin-bottom: 0; }
.tldr-box code {
  background: #dcfce7;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9em;
}
.example-url {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.example-url code {
  flex: 1;
  word-break: break-all;
  font-size: 0.85rem;
}
.example-samples {
  margin-top: 16px;
}
.example-samples h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.example-samples ul {
  list-style: none;
  padding: 0;
}
.example-samples li {
  padding: 4px 0;
}
.example-samples a {
  color: var(--primary);
  text-decoration: none;
}
.example-samples a:hover {
  text-decoration: underline;
}
.code-tabs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.code-tab {
  background: #1e293b;
  border-radius: var(--radius);
  overflow: hidden;
}
.code-tab h3 {
  background: #334155;
  color: #e2e8f0;
  font-size: 0.85rem;
  padding: 8px 16px;
  margin: 0;
}
.code-tab pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  background: transparent;
}
.code-tab code {
  color: #e2e8f0 !important;
  background: transparent !important;
  font-size: 0.85rem;
  line-height: 1.5;
}
.details-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.details-table th {
  background: var(--border-light);
  text-align: left;
  padding: 10px 16px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 180px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.details-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.details-table tr:last-child th,
.details-table tr:last-child td {
  border-bottom: none;
}
.use-case-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.use-case-list li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 0.95rem;
}
.faq-section {
  margin: 32px 0;
}
.faq-section .faq-list dt {
  font-weight: 600;
  color: var(--primary-dark);
  margin-top: 20px;
  padding: 12px 16px;
  background: #eef2ff;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid #e0e7ff;
  border-bottom: none;
}
.faq-section .faq-list dd {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  line-height: 1.6;
}
.faq-section .faq-list a {
  color: var(--primary);
}
.note {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-style: italic;
}

/* End of styles */