/* API Documentation Page Styles - Shared between Admin and User GUIs */

body.api-page {
  overflow: hidden;
  height: 100%;
}

body.api-page .app-content {
  overflow: hidden;
}

.api-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  padding: 0;
}

.api-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* API Docs Layout - Sidebar + Content */
.api-wrapper {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.api-sidebar {
  width: 240px;
  min-width: 240px;
  padding: 20px;
  overflow-y: auto;
  background: rgba(17, 24, 39, 0.8);
  border-right: 1px solid rgba(56, 189, 248, 0.18);
}

.api-sidebar h4 {
  color: #7dd3fc;
  margin-bottom: 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.api-sidebar a {
  display: block;
  color: #cbd5e1;
  text-decoration: none;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 4px;
  margin-bottom: 2px;
  transition: all 0.2s;
}

.api-sidebar a:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
}

.api-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 40px;
}

/* Support panel */
.donate-panel {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

/* API Section */
.api-section {
  background: linear-gradient(180deg, rgba(24, 32, 48, 0.8) 0%, rgba(12, 18, 28, 0.9) 100%);
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid rgba(56, 189, 248, 0.12);
}

.api-section h2 {
  color: #7dd3fc;
  margin-bottom: 16px;
  font-size: 22px;
  border-bottom: 2px solid rgba(125, 211, 252, 0.2);
  padding-bottom: 8px;
}

.api-section h3 {
  color: #e2e8f0;
  margin: 20px 0 12px 0;
  font-size: 18px;
}

.api-section p {
  color: #cbd5e1;
  line-height: 1.7;
  margin-bottom: 12px;
}

.base-url,
.auth-header {
  color: #cbd5e1;
  font-size: 14px;
  margin-bottom: 12px;
}

.base-url strong {
  color: #e2e8f0;
}

/* Endpoint Card */
.endpoint {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid rgba(125, 211, 252, 0.12);
  overflow: hidden;
}

.endpoint-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
  gap: 12px;
}

.endpoint-header:hover {
  background: rgba(56, 189, 248, 0.08);
}

.endpoint-body {
  padding: 16px;
  border-top: 1px solid rgba(56, 189, 248, 0.12);
  display: none;
}

.endpoint-body.show {
  display: block;
}

/* HTTP Method Badges */
.method {
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  min-width: 60px;
  text-align: center;
}

.method.get { background: #10b981; color: white; }
.method.post { background: #3b82f6; color: white; }
.method.put { background: #f59e0b; color: white; }
.method.delete { background: #ef4444; color: white; }
.method.patch { background: #8b5cf6; color: white; }

.endpoint-path {
  font-family: 'Courier New', monospace;
  color: #e2e8f0;
  font-size: 14px;
  flex: 1;
}

.endpoint-desc {
  color: #94a3b8;
  font-size: 13px;
}

.expand-icon {
  color: #64748b;
  font-size: 10px;
  transition: transform 0.2s;
}

.endpoint-header.expanded .expand-icon {
  transform: rotate(90deg);
}

/* Parameter Table */
.param-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}

.param-table th,
.param-table td {
  padding: 10px 12px;
  text-align: left;
  border: 1px solid rgba(139, 156, 255, 0.1);
}

.param-table th {
  background: rgba(139, 156, 255, 0.1);
  color: #a5b4fc;
  font-weight: 600;
}

.param-table td {
  color: #cbd5e1;
}

.param-required {
  color: #ef4444;
  margin-left: 2px;
}

/* Code Blocks */
.code-block {
  background: #0d1117;
  border-radius: 6px;
  margin: 12px 0;
  border: 1px solid rgba(139, 156, 255, 0.1);
  overflow: hidden;
}

.code-block pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.5;
  color: #e2e8f0;
}

.api-section pre {
  background: #0d1117;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid rgba(139, 156, 255, 0.1);
}

.api-section code {
  background: rgba(139, 156, 255, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #f0abfc;
}

.api-section pre code {
  background: transparent;
  padding: 0;
  color: #e2e8f0;
}

/* Response Codes */
.response-code {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 8px;
}

.response-code.success { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.response-code.error { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.response-code.warning { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }

/* Notes */
.api-note {
  background: rgba(99, 102, 241, 0.12);
  border-left: 3px solid #8b5cf6;
  padding: 10px 12px;
  margin: 12px 0;
  color: #cbd5e1;
}

/* Protocol Labels */
.protocol-label {
  font-weight: 600;
}

.protocol-label.protocol-http { color: #10b981; }
.protocol-label.protocol-https { color: #06b6d4; }
.protocol-label.protocol-ssh { color: #8b5cf6; }
.protocol-label.protocol-tcp { color: #f59e0b; }
.protocol-label.protocol-udp { color: #ef4444; }

/* Responsive */
@media (max-width: 800px) {
  .api-wrapper {
    flex-direction: column;
    height: auto;
  }
  .api-sidebar {
    width: 100%;
    min-width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(139, 156, 255, 0.1);
  }
  .api-content {
    padding: 20px;
  }
}
