*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
    --bg: #09090b;
    --bg-elevated: #18181b;
    --bg-subtle: #27272a;
    --border: #3f3f46;
    --border-subtle: #27272a;
    --text: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(9, 9, 11, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 24px;
}
.navbar-content {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo i { color: var(--primary); }
.nav-links { display: flex; gap: 8px; }
.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}
.nav-link:hover { color: var(--text); background: var(--bg-subtle); }
.nav-link.primary { background: var(--primary); color: white; }
.nav-link.primary:hover { background: var(--primary-hover); }

/* Main Layout */
.main-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 88px 24px 48px;
    display: grid;
    grid-template-columns: 280px 1fr 400px;
    gap: 24px;
    align-items: start;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 112px);
    overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-section { margin-bottom: 24px; }
.sidebar-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    margin-bottom: 4px;
}
.sidebar-title.admin { color: var(--warning); }

.endpoint-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 2px;
}
.endpoint-item:hover { background: var(--bg-subtle); }
.endpoint-item.active {
    background: rgba(99, 102, 241, 0.15);
    border-left: 3px solid var(--primary);
}
.endpoint-item.admin.active {
    background: rgba(234, 179, 8, 0.1);
    border-left-color: var(--warning);
}

.method-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    min-width: 36px;
    text-align: center;
}
.method-badge.get { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.method-badge.post { background: rgba(34, 197, 94, 0.2); color: #22c55e; }

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

/* Content Area */
.content-area { min-width: 0; }

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 12px;
}
.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}
.card-body { padding: 20px; }

/* Endpoint Header */
.endpoint-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.endpoint-header .method-badge {
    font-size: 0.75rem;
    padding: 6px 10px;
}
.endpoint-header h2 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 600;
}
.auth-badge {
    background: rgba(234, 179, 8, 0.15);
    color: var(--warning);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.endpoint-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.7;
}

/* Info Box */
.info-box {
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--primary);
    padding: 12px 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.info-box.warning {
    background: rgba(234, 179, 8, 0.1);
    border-left-color: var(--warning);
}
.info-box.danger {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--danger);
}
.info-box strong { color: var(--text); }

/* Parameters Table */
.params-section { margin-bottom: 24px; }
.params-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.params-title i { color: var(--primary); font-size: 0.75rem; }

.params-table {
    width: 100%;
    border-collapse: collapse;
}
.params-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-subtle);
}
.params-table td {
    padding: 12px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: top;
}
.params-table tr:last-child td { border-bottom: none; }
.param-name {
    font-family: 'JetBrains Mono', monospace;
    color: #f87171;
    font-weight: 500;
}
.param-required {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 600;
}
.param-required.required { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.param-required.optional { background: var(--bg-subtle); color: var(--text-muted); }
.param-type {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--primary);
}
.param-desc { color: var(--text-secondary); }

/* Response Example */
.response-example {
    background: var(--bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.response-header {
    padding: 10px 16px;
    background: var(--bg-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.response-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.copy-btn {
    padding: 6px 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.copy-btn:hover { background: var(--border); color: var(--text); }
.copy-btn.copied { background: var(--success); color: white; border-color: var(--success); }
.response-code {
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    overflow-x: auto;
}
.response-code pre { margin: 0; }
.hljs { background: transparent !important; }

/* Tester Panel */
.tester-panel {
    position: sticky;
    top: 88px;
}

.tester-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    overflow: hidden;
}
.tester-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-bottom: 1px solid var(--border-subtle);
}
.tester-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tester-header h3 i { color: var(--primary); }

.tester-body { padding: 16px; }

.config-group { margin-bottom: 16px; }
.config-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.config-label i { color: var(--primary); }

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.85rem;
    transition: all 0.2s;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input.mono { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; }

/* Dynamic Args */
.args-container { margin-top: 16px; }
.arg-row {
    display: grid;
    grid-template-columns: 1fr 1fr 32px;
    gap: 8px;
    margin-bottom: 8px;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.remove-arg-btn {
    width: 32px;
    height: 38px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    color: var(--danger);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.remove-arg-btn:hover { background: var(--danger); color: white; }

.add-arg-btn {
    width: 100%;
    padding: 10px;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.add-arg-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(99, 102, 241, 0.05); }

/* Method Toggle */
.method-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.method-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.method-btn:hover { border-color: var(--border); }
.method-btn.active.get { background: rgba(59, 130, 246, 0.15); border-color: #3b82f6; color: #3b82f6; }
.method-btn.active.post { background: rgba(34, 197, 94, 0.15); border-color: #22c55e; color: #22c55e; }

/* Send Button */
.send-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}
.send-btn:hover { background: var(--primary-hover); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Response Area */
.tester-response {
    margin-top: 16px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 16px;
}
.response-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-badge.success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.status-badge.error { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.status-badge.time { background: var(--bg-subtle); color: var(--text-secondary); }

.response-output {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    max-height: 300px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Code Generation */
.code-section { margin-top: 16px; border-top: 1px solid var(--border-subtle); padding-top: 16px; }
.code-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.code-tab {
    padding: 6px 12px;
    background: var(--bg);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}
.code-tab:hover { color: var(--text-secondary); }
.code-tab.active { background: var(--bg-subtle); color: var(--text); border-color: var(--border); }

.code-output {
    background: var(--bg);
    border-radius: var(--radius-sm);
    max-height: 250px;
    overflow: auto;
}
.code-output pre {
    margin: 0;
    padding: 12px;
}
.code-output code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    background: transparent !important;
}
.code-output .hljs {
    background: transparent !important;
    padding: 0;
}

/* Responsive */
@media (max-width: 1400px) {
    .main-container { grid-template-columns: 250px 1fr 350px; }
}
@media (max-width: 1200px) {
    .main-container { grid-template-columns: 1fr; }
    .sidebar { position: static; max-height: 300px; }
    .tester-panel { position: static; margin-top: 24px; }
}
@media (max-width: 600px) {
    .main-container { padding: 80px 16px 32px; }
    .input-row { grid-template-columns: 1fr; }
    .arg-row { grid-template-columns: 1fr; }
    .arg-row .remove-arg-btn { width: 100%; height: 36px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
