/**
 * API Documentation Stylesheet
 * Used by: api_documentation.php
 * Class prefix: .api-*
 */

/* ==========================================================================
   Layout
   ========================================================================== */
.api-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .api-layout {
        grid-template-columns: 250px 1fr;
    }
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.api-sidebar {
    display: none;
}

@media (min-width: 1024px) {
    .api-sidebar {
        display: block;
        position: sticky;
        top: 100px;
    }
}

.api-sidebar-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--v2-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.api-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.api-sidebar-nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--v2-text-muted);
    text-decoration: none;
    border-radius: var(--v2-radius-sm);
    transition: all 0.2s;
}

.api-sidebar-nav a:hover,
.api-sidebar-nav a.active {
    background: rgba(0, 255, 209, 0.1);
    color: var(--v2-primary);
}

/* ==========================================================================
   Content
   ========================================================================== */
.api-content {
    min-width: 0;
}

.api-section {
    background: var(--v2-surface-dark);
    border: 1px solid var(--v2-border-light);
    border-radius: var(--v2-radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
}

.api-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--v2-text-light);
    margin-bottom: 1rem;
}

.api-section p {
    font-size: 0.9375rem;
    color: var(--v2-text-muted);
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* ==========================================================================
   Status Badge
   ========================================================================== */
.api-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--v2-radius-md);
    margin-bottom: 1.5rem;
}

.api-status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.api-status span {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6ee7b7;
}

/* ==========================================================================
   Base URL
   ========================================================================== */
.api-base-url {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(13, 17, 23, 0.6);
    border: 1px solid var(--v2-border-light);
    border-radius: var(--v2-radius-md);
    margin-bottom: 1.5rem;
}

.api-base-url code {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9375rem;
    color: var(--v2-primary);
}

.api-base-url button {
    background: transparent;
    border: none;
    color: var(--v2-text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.api-base-url button:hover {
    color: var(--v2-primary);
}

/* ==========================================================================
   Endpoint
   ========================================================================== */
.api-endpoint {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--v2-border-light);
}

.api-endpoint:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.api-endpoint-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.api-method {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: var(--v2-radius-sm);
}

.api-method.get {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.api-method.post {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.api-method.put {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.api-method.delete {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.api-path {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--v2-text-light);
}

.api-endpoint p {
    margin-bottom: 1rem;
}

/* ==========================================================================
   Code Block
   ========================================================================== */
.api-code-block {
    position: relative;
    margin: 1rem 0;
}

.api-code-block pre {
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid var(--v2-border-light);
    border-radius: var(--v2-radius-md);
    padding: 1rem;
    overflow-x: auto;
    margin: 0;
}

.api-code-block code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    color: #e2e8f0;
    white-space: pre;
}

.api-code-block .copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.375rem 0.625rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--v2-radius-sm);
    font-size: 0.75rem;
    color: var(--v2-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.api-code-block .copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--v2-text-light);
}

.api-code-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--v2-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Tabs
   ========================================================================== */
.api-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.api-tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--v2-text-muted);
    cursor: pointer;
    border-radius: var(--v2-radius-sm) var(--v2-radius-sm) 0 0;
    transition: all 0.2s;
}

.api-tab:hover {
    color: var(--v2-text-light);
}

.api-tab.active {
    background: rgba(13, 17, 23, 0.8);
    color: var(--v2-primary);
}

/* ==========================================================================
   Syntax Highlighting
   ========================================================================== */
.token-string {
    color: #a5d6ff;
}

.token-keyword {
    color: #ff7b72;
}

.token-comment {
    color: #8b949e;
}

.token-function {
    color: #d2a8ff;
}

.token-number {
    color: #79c0ff;
}