/* API Documentation Specific Styles */

/* Layout */
.docs-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 70px);
}

/* Sidebar */
.docs-sidebar {
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  overflow-y: auto;
}

.sidebar-content {
  padding: 24px;
}

.sidebar-section {
  margin-bottom: 32px;
}

.sidebar-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-section li {
  margin-bottom: 4px;
}

.sidebar-section a {
  display: block;
  padding: 8px 12px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.sidebar-section a:hover {
  color: var(--text);
  background: var(--surface);
}

.sidebar-section a.active {
  color: var(--brand-2);
  background: rgba(124, 140, 247, 0.12);
}

/* Main Content */
.docs-main {
  overflow-x: hidden;
}

.docs-content {
  max-width: 900px;
  padding: 40px;
  margin: 0 auto;
}

/* API Badge */
.api-badge {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
}

/* Hero Section */
.docs-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.hero-content h1 {
  font-size: 42px;
  margin: 0 0 16px 0;
  background: linear-gradient(135deg, var(--text), var(--brand-2));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  gap: 24px;
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--brand-2);
}

.stat-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.hero-code {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  height: fit-content;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
}

.copy-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  color: var(--text);
  background: var(--glass);
}

/* Code Blocks */
.code-block {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 16px 0;
}

.code-block pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
}

.code-block code {
  color: var(--text);
}

/* Sections */
.docs-section {
  margin-bottom: 60px;
}

.docs-section h2 {
  font-size: 32px;
  margin: 0 0 16px 0;
  color: var(--text);
}

.docs-section h3 {
  font-size: 24px;
  margin: 32px 0 16px 0;
  color: var(--text);
}

.docs-section h4 {
  font-size: 18px;
  margin: 24px 0 12px 0;
  color: var(--text);
}

.docs-section p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

/* Info Cards */
.info-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
}

.info-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.info-header .icon {
  font-size: 20px;
}

.info-header h3 {
  margin: 0;
  font-size: 18px;
}

.info-card ul {
  margin: 12px 0 0 0;
  color: var(--muted);
}

.info-card li {
  margin-bottom: 8px;
}

/* Authentication Methods */
.auth-methods {
  display: grid;
  gap: 16px;
  margin: 20px 0;
}

.method-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.method-card h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
}

/* Permissions Grid */
.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.permission-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 8px;
}

.permission-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--brand-2);
}

.permission-desc {
  font-size: 13px;
  color: var(--muted);
}

/* Quick Start Steps */
.quickstart-steps {
  margin: 32px 0;
}

.step {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.step:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.step-number {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.step-content h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
}

.step-content p {
  margin-bottom: 16px;
}

/* Workflow */
.workflow-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.workflow-step {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
}

.workflow-arrow {
  color: var(--brand-2);
  font-weight: 600;
}

.workflow-container {
  margin: 32px 0;
}

.workflow-step-detailed {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.step-icon {
  font-size: 24px;
}

.step-header h3 {
  margin: 0;
  font-size: 20px;
}

.step-tag {
  background: var(--brand);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-left: auto;
}

/* Endpoints */
.endpoint-group {
  margin: 32px 0;
}

.endpoint {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 24px;
  overflow: hidden;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
}

.method {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  min-width: 60px;
  text-align: center;
}

.method.get { background: var(--success); color: white; }
.method.post { background: var(--brand); color: white; }
.method.put { background: var(--accent); color: black; }
.method.delete { background: #ef4444; color: white; }

.path {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  padding: 6px 10px;
  border-radius: 4px;
}

.description {
  color: var(--muted);
  font-size: 14px;
}

.endpoint-body {
  padding: 20px;
}

/* Parameters Table */
.params-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 16px 0;
}

.param-row {
  display: grid;
  grid-template-columns: 1fr 80px 2fr;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.param-row:last-child {
  border-bottom: none;
}

.param-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--brand-2);
}

.param-type {
  font-size: 12px;
  color: var(--muted);
  background: var(--glass);
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
}

.param-desc {
  font-size: 14px;
  color: var(--muted);
}

/* Error Codes */
.error-codes {
  margin: 20px 0;
}

.error-code {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}

.error-code .code {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--brand-2);
  min-width: 40px;
}

.error-code .meaning {
  color: var(--muted);
}

/* Rate Limit Tiers */
.rate-limit-tiers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}

.tier-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.tier-card h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
}

.tier-limit {
  font-size: 24px;
  font-weight: 800;
  color: var(--brand-2);
  margin-bottom: 8px;
}

/* Support Grid */
.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.support-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.support-icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
}

.support-card h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
}

.support-card p {
  margin-bottom: 16px;
  font-size: 14px;
}

/* Utility Classes */
.btn-sm {
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 6px;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .docs-layout {
    grid-template-columns: 260px 1fr;
  }
  
  .docs-content {
    padding: 32px;
  }
}

@media (max-width: 968px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
  
  .docs-sidebar {
    display: none;
  }
  
  .docs-hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .hero-content h1 {
    font-size: 36px;
  }
  
  .docs-content {
    padding: 24px;
  }
  
  .rate-limit-tiers {
    grid-template-columns: 1fr;
  }
  
  .param-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .support-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero-stats {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  
  .workflow-preview {
    flex-wrap: wrap;
  }
  
  .permissions-grid {
    grid-template-columns: 1fr;
  }
  
  .step {
    flex-direction: column;
    gap: 12px;
  }
  
  .step-number {
    align-self: flex-start;
  }
}

/* Code Syntax Highlighting Overrides */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #6a737d;
}

.token.punctuation {
  color: var(--muted);
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: var(--brand-2);
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: var(--accent);
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: var(--text);
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: var(--success);
}

.token.function,
.token.class-name {
  color: #f8c555;
}

.token.regex,
.token.important,
.token.variable {
  color: #fd7e14;
}
