:root {
    --primary: #007AFF;
    --primary-glow: rgba(0, 122, 255, 0.3);
    --bg: #0D0D0E;
    --sidebar-bg: #151517;
    --card-bg: #1C1C1E;
    --border: #2C2C2E;
    --text-main: #FFFFFF;
    --text-muted: #98989D;
    --code-bg: #000000;
    --tag-post: #007AFF;
    --tag-get: #34C759;
    --tag-delete: #FF453A;
    --tag-put: #FF9F0A;
    --success: #32D74B;
    --error: #FF453A;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    flex-shrink: 0;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-header {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.sidebar-search {
    margin-top: 14px;
}

.sidebar-search-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    color: white;
    font-size: 13px;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
}

.sidebar-search-input::placeholder {
    color: var(--text-muted);
}

.sidebar-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.nav-section {
    padding: 0 12px;
    margin-bottom: 32px;
}

.section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 12px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: var(--primary-glow);
    color: var(--primary);
}

.method-tag {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--tag-post);
    color: white;
    flex-shrink: 0;
}

.method-tag.get    { background: var(--tag-get); }
.method-tag.post   { background: var(--tag-post); }
.method-tag.delete { background: var(--tag-delete); }
.method-tag.put    { background: var(--tag-put); }

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

.content-header {
    padding: 40px 60px 20px;
}

/* Header row: title + Docs button */
.header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.btn-docs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-top: 6px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-docs:hover {
    background: rgba(0, 122, 255, 0.12);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-docs.active {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: var(--primary);
}

.api-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.api-description {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 800px;
}

.explorer-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 20px 60px 60px;
    min-height: 0;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.panel, .response-view {
    min-width: 0;
}

/* Control Panel */
.panel {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.panel-section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.endpoint-url {
    background: var(--code-bg);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

input, select, textarea {
    width: 100%;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: border 0.3s, box-shadow 0.3s;
    resize: none;
    overflow: hidden;
}

input[type="file"] {
    padding: 10px 12px;
    color: var(--text-muted);
    cursor: pointer;
    overflow: visible;
}

input[type="file"]::-webkit-file-upload-button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 12px;
    font-family: 'Inter', sans-serif;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
}

input:focus, select:focus, textarea:focus { 
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2398989D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.btn-execute {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    margin-bottom: 40px;
}

.btn-execute:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-execute:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Response View */
.response-view {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.response-container {
    flex: 1;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 480px;
    margin-bottom: 40px;
    max-width: 100%;
    overflow: hidden;
}

.response-toolbar {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-pill {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
}

.status-pill.success { color: var(--success); background: rgba(50, 215, 75, 0.1); }
.status-pill.error   { color: var(--error);   background: rgba(255, 69, 58, 0.1);  }

.code-viewport {
    flex: 1;
    padding: 20px;
    overflow: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #d1d1d6;
}

.code-viewport pre {
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-muted);
}

.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 122, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
    margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* JSON syntax highlighting */
.json-key         { color: #ff7ab2; }
.json-string      { color: #abe338; }
.json-number      { color: #dcb1ff; }
.json-boolean     { color: #6dbdfa; }
.json-null        { color: #999; }
.json-punctuation { color: #888; }

/* Custom Dropdown for Project Selector */
.project-dropdown {
    position: relative;
    width: 100%;
    margin-top: 12px;
    margin-bottom: 8px;
}

.dropdown-trigger {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.dropdown-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.dropdown-trigger .project-name {
    font-size: 13px;
    font-weight: 700;
    color: white;
}

.dropdown-trigger .chevron {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.project-dropdown.open .chevron {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #18181A;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    overflow: hidden;
    z-index: 1000;
    display: none;
}

.project-dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-item {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #a1a1aa;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.dropdown-item.active {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary);
    font-weight: 700;
}

.dropdown-item .item-name {
    font-size: 13px;
}

/* Inline file note */
.field-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    font-style: italic;
}

/* ============================================================
   Docs Drawer
   ============================================================ */

.docs-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.docs-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.docs-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 520px;
    max-width: 96vw;
    height: 100vh;
    background: #111113;
    border-left: 1px solid var(--border);
    z-index: 201;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.docs-drawer.open {
    transform: translateX(0);
}

.docs-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.docs-drawer-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.docs-drawer-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.docs-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.docs-close-btn:hover {
    background: rgba(255, 69, 58, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.docs-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.docs-drawer-body::-webkit-scrollbar {
    width: 4px;
}

.docs-drawer-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* Docs section */
.docs-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.docs-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.docs-description-text {
    font-size: 14px;
    color: #c0c0c5;
    line-height: 1.65;
}

/* Endpoint badge row */
.docs-endpoint-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #d1d1d6;
}

/* Parameters table */
.docs-params-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.docs-params-table th {
    text-align: left;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.docs-params-table td {
    padding: 10px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: #c0c0c5;
    vertical-align: top;
}

.docs-params-table tr:last-child td {
    border-bottom: none;
}

.docs-param-name {
    font-family: 'JetBrains Mono', monospace;
    color: #ff7ab2;
    font-size: 12px;
}

.docs-param-type {
    font-family: 'JetBrains Mono', monospace;
    color: #6dbdfa;
    font-size: 12px;
}

.docs-param-required {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 69, 58, 0.12);
    color: var(--error);
}

.docs-param-optional {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(152, 152, 157, 0.12);
    color: var(--text-muted);
}

/* cURL block */
.curl-block {
    position: relative;
    background: #000;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.curl-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.curl-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Inter', sans-serif;
}

.curl-copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 122, 255, 0.1);
    border: 1px solid rgba(0, 122, 255, 0.25);
    border-radius: 6px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.curl-copy-btn:hover {
    background: rgba(0, 122, 255, 0.2);
    border-color: var(--primary);
}

.curl-copy-btn.copied {
    background: rgba(50, 215, 75, 0.1);
    border-color: rgba(50, 215, 75, 0.3);
    color: var(--success);
}

.curl-code {
    padding: 16px 18px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    line-height: 1.7;
    color: #d1d1d6;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    overflow-x: auto;
}
