/* ========================================
   API Documentation Styles
======================================== */

.api-main {
  min-height: calc(100vh - 80px);
  padding: 2rem 0 4rem;
}

/* API Header */
.api-header {
  text-align: center;
  margin-bottom: 4rem;
  padding: 2rem 0;
}

.api-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(168, 85, 247, 0.15);
  color: var(--gold-1);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  border: 1px solid rgba(168, 85, 247, 0.3);
  margin-bottom: 1.5rem;
}

.api-header h1 {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 1rem;
  background: linear-gradient(135deg, #fff, var(--gold-1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.api-subtitle {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.api-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* API Features Grid */
.api-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.api-feature-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s;
}

.api-feature-card:hover {
  border-color: rgba(168, 85, 247, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(168, 85, 247, 0.15);
}

.feature-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(168, 85, 247, 0.1);
  border-radius: 12px;
  color: var(--gold-1);
}

.api-feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.api-feature-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

/* API Sections */
.api-section {
  margin-bottom: 4rem;
}

.api-section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.section-desc {
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* Code Blocks */
.code-block {
  background: #0a0a0a;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--panel-border);
}

.code-lang {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-copy {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.code-copy:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.code-block pre {
  margin: 0;
  padding: 1.25rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
}

.code-block code {
  font-family: inherit;
}

/* Syntax Highlighting */
.code-block .keyword { color: #c678dd; }
.code-block .string { color: #98c379; }
.code-block .number { color: #d19a66; }
.code-block .comment { color: #5c6370; font-style: italic; }

/* API Note */
.api-note {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 10px;
  color: var(--gold-1);
}

.api-note svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.api-note strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.api-note p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* API Keys Card */
.api-keys-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  overflow: hidden;
}

.api-keys-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--panel-border);
}

.api-keys-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.api-keys-list {
  padding: 0.5rem;
}

.api-key-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

.api-key-item:last-child {
  margin-bottom: 0;
}

.key-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.key-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.key-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.key-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: right;
}

.key-created {
  font-size: 0.75rem;
  color: var(--muted);
}

.key-status {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

.key-status.active {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.key-status.test {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.key-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text);
  color: var(--text);
}

.connect-prompt-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--panel-border);
}

.connect-prompt-mini svg {
  color: var(--muted);
}

.connect-prompt-mini p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Endpoints List */
.endpoints-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.endpoint-group h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--panel-border);
}

.endpoint-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: all 0.2s;
}

.endpoint-item:hover {
  border-color: rgba(168, 85, 247, 0.3);
}

.method {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  min-width: 50px;
  text-align: center;
}

.method.get {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.method.post {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}

.method.put {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.method.delete {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.endpoint-item code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text);
}

.endpoint-desc {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Rate Limits Table */
.rate-limits-table {
  overflow-x: auto;
}

.rate-limits-table table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border-radius: 12px;
  overflow: hidden;
}

.rate-limits-table th,
.rate-limits-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--panel-border);
}

.rate-limits-table th {
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rate-limits-table td {
  font-size: 0.95rem;
  color: var(--text);
}

.rate-limits-table tbody tr:last-child td {
  border-bottom: none;
}

.rate-limits-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.plan-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

.plan-badge.free {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.plan-badge.developer {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}

.plan-badge.pro {
  background: rgba(168, 85, 247, 0.15);
  color: var(--gold-1);
}

.plan-badge.enterprise {
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
}

/* SDK Grid */
.sdk-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.sdk-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s;
}

.sdk-card:hover {
  border-color: rgba(168, 85, 247, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.sdk-card.coming-soon {
  opacity: 0.6;
  pointer-events: none;
}

.sdk-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  color: var(--text);
}

.sdk-info h4 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.sdk-info code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
}

.coming-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* Demo Banner */
.demo-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 12px;
  color: #fbbf24;
  font-size: 0.9rem;
  margin-top: 2rem;
}

.demo-banner svg {
  flex-shrink: 0;
}

.demo-banner strong {
  color: #fbbf24;
}

/* Footer */
.footer {
  background: var(--panel);
  border-top: 1px solid var(--panel-border);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-brand img {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
}

.footer-brand p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.footer-links h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--gold-1);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--panel-border);
}

.footer-bottom p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-disclaimer {
  font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .api-features {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .sdk-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .api-header h1 {
    font-size: 2rem;
  }
  
  .api-features {
    grid-template-columns: 1fr;
  }
  
  .api-key-item {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .key-meta {
    text-align: left;
    flex-direction: row;
    gap: 1rem;
  }
  
  .endpoint-item {
    flex-wrap: wrap;
  }
  
  .endpoint-desc {
    width: 100%;
    margin-left: 0;
    margin-top: 0.5rem;
  }
  
  .sdk-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .api-ctas {
    flex-direction: column;
  }
  
  .api-ctas .btn {
    width: 100%;
    justify-content: center;
  }
}
