/* API Docs Specific Styles */
.api-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
}

.api-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    backdrop-filter: blur(10px);
    transition: box-shadow 0.3s ease;
}

.api-section:hover {
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.method-badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.method-post {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.method-get {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.endpoint-url {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    font-size: 16px;
    word-break: break-all;
}

.endpoint-desc {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.code-block {
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

.code-header {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 8px;
    transition: color 0.2s;
    white-space: nowrap;
}

.tab-btn.active {
    color: var(--primary);
}

.code-content {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #e5e5e5;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 0 0 8px 0;
    -webkit-overflow-scrolling: touch;
}

.code-content::-webkit-scrollbar {
    height: 8px;
}

.code-content::-webkit-scrollbar-track {
    background: transparent;
}

.code-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.keyword {
    color: #ef4444;
}

.string {
    color: #22c55e;
}

.function {
    color: #60a5fa;
}

.comment {
    color: #737373;
}

.try-it-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-top: 24px;
}

.try-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.try-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.response-area {
    background: #000;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    display: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.status-line {
    margin-bottom: 8px;
    font-weight: 600;
}

.status-200 {
    color: #22c55e;
}

.status-error {
    color: #ef4444;
}

.nav-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 32px;
    transition: color 0.4s;
    font-weight: 500;
}

.nav-back:hover {
    color: var(--primary);
}

/* Custom file input for try-it */
.custom-file-input {
    display: none;
}

.file-label {
    display: inline-block;
    padding: 10px 20px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.file-label:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

/* Minimalist Test Button */
.btn-test {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-test:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(239, 68, 68, 0.1);
}

.btn-test:active {
    transform: scale(0.98);
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    border-color: var(--border) !important;
    color: var(--text-muted) !important;
    background: transparent !important;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    body {
        overflow-x: hidden;
    }

    .api-container {
        padding: 16px 12px;
        width: 100%;
        overflow-x: hidden;
    }

    .api-section {
        padding: 16px;
        border-radius: 12px;
    }

    .endpoint-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .method-badge {
        font-size: 12px;
    }

    .endpoint-url {
        font-size: 13px;
    }

    .endpoint-desc {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .try-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .file-label {
        max-width: 100%;
        text-align: center;
    }

    .btn-test {
        width: 100%;
    }

    /* Code block mobile optimization */
    .code-block {
        margin: 0;
        border-radius: 12px;
        padding: 16px;
        width: 100%;
        box-sizing: border-box;
    }

    .code-header {
        margin-bottom: 12px;
        padding-bottom: 10px;
        gap: 12px;
    }

    .tab-btn {
        font-size: 13px;
        padding: 6px 10px;
    }

    .code-content {
        font-size: 12px;
        line-height: 1.6;
        padding: 0;
        padding-bottom: 8px;
        /* Enable smooth horizontal scroll */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: pre;
        /* Better touch scrolling */
        scrollbar-width: thin;
        /* Remove left whitespace from HTML indentation */
        text-indent: 0;
    }

    .code-content::-webkit-scrollbar {
        height: 6px;
    }

    /* Try-it section mobile */
    .try-it-section {
        padding: 16px;
        margin-top: 16px;
    }

    .try-header {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .response-area {
        font-size: 11px;
        padding: 12px;
    }

    .response-area pre {
        white-space: pre-wrap;
        word-break: break-word;
    }

    /* Header mobile */
    .header {
        text-align: center;
        margin-bottom: 24px;
    }

    .header h1 {
        font-size: 24px;
    }

    .subtitle {
        font-size: 14px;
    }

    .nav-back {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .footer {
        margin-top: 32px;
        padding: 16px 0;
    }

    .footer p {
        font-size: 12px;
    }
}