:root {
    /* Brand Colors */
    --primary: #8b5cf6;
    /* Violet */
    --primary-hover: #7c3aed;
    --secondary: #06b6d4;
    /* Cyan */
    --accent: #f43f5e;
    /* Rose */

    /* HTTP Methods */
    --get: #10b981;
    --post: #3b82f6;
    --put: #f59e0b;
    --patch: #eab308;
    --delete: #ef4444;

    /* UI Colors */
    --bg-dark: #09090b;
    --bg-surface: #18181b;
    --bg-surface-hover: #27272a;
    --text-primary: #f8fafc;
    --text-secondary: #a1a1aa;

    --border: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(139, 92, 246, 0.5);
    --radius: 12px;
    --transition: 200ms ease;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Glassmorphism Classes */
.glass-panel {
    background: rgba(24, 24, 27, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.hidden {
    display: none !important;
}

/* --- Upload Overlay --- */
.upload-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-image:
        radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.1) 0%, transparent 40%);
    z-index: 100;
    animation: fadeIn 0.3s ease;
}

.upload-card {
    width: 100%;
    max-width: 500px;
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    text-align: center;
}

.upload-header {
    margin-bottom: 2rem;
}

.logo-icon {
    color: var(--primary);
    margin-bottom: 1rem;
    display: inline-block;
    background: rgba(139, 92, 246, 0.1);
    padding: 1rem;
    border-radius: 50%;
}

.upload-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.accent-text {
    color: var(--secondary);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.upload-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.drop-zone {
    border: 2px dashed rgba(139, 92, 246, 0.3);
    border-radius: var(--radius);
    padding: 3rem 1rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
}

.drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

.drop-icon {
    color: var(--text-secondary);
}

.drop-zone.dragover .drop-icon {
    color: var(--primary);
}

.drop-zone p {
    color: var(--text-secondary);
    font-weight: 500;
}

.or-text {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
}

.upload-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* --- App Layout --- */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border-width: 0 1px 0 0;
    background: rgba(14, 14, 16, 0.95);
    z-index: 10;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.api-title {
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.api-version {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    background: rgba(139, 92, 246, 0.2);
    color: var(--primary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.search-box {
    padding: 1rem 1.25rem;
}

.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.25rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Nav Items */
.nav-tag-group {
    margin-bottom: 1rem;
}

.nav-tag-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 700;
    margin: 1rem 0 0.5rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
    cursor: pointer;
}

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

.nav-item.active {
    background: rgba(139, 92, 246, 0.1);
    color: #c4b5fd;
}

.nav-method {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
    min-width: 48px;
    text-align: center;
}

/* Method Colors */
.m-get {
    color: var(--get);
    background: rgba(16, 185, 129, 0.1);
}

.m-post {
    color: var(--post);
    background: rgba(59, 130, 246, 0.1);
}

.m-put {
    color: var(--put);
    background: rgba(245, 158, 11, 0.1);
}

.m-patch {
    color: var(--patch);
    background: rgba(234, 179, 8, 0.1);
}

.m-delete {
    color: var(--delete);
    background: rgba(239, 68, 68, 0.1);
}

.m-other {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
}

.nav-path {
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.8;
}

.nav-item.active .nav-path {
    opacity: 1;
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    position: relative;
    background-image:
        radial-gradient(ellipse at top right, rgba(139, 92, 246, 0.08), transparent 40%);
}

.doc-section {
    display: flex;
    padding: 4rem 3rem;
    border-bottom: 1px solid var(--border);
    gap: 3rem;
    scroll-margin-top: 2rem;
}

.text-content {
    flex: 1;
    min-width: 0;
}

.code-column {
    width: 45%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 4rem;
    align-self: flex-start;
    /* Max height to allow scrolling within code if needed */
    max-height: calc(100vh - 8rem);
}

/* Typography in Content */
.doc-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.doc-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    max-width: 800px;
}

.doc-desc p {
    margin-bottom: 1rem;
}

.doc-desc a {
    color: var(--secondary);
    text-decoration: none;
}

.doc-desc a:hover {
    text-decoration: underline;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem 0;
}

h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.5rem 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

/* Info Section Components */
.server-list {
    list-style: none;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.server-list li {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.server-list li:last-child {
    border-bottom: none;
}

.info-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.info-card-row span {
    color: var(--text-secondary);
}

/* Endpoint Sections */
.endpoint-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.method-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
}

.endpoint-path {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    word-break: break-all;
}

.endpoint-summary {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0;
}

/* Tables (Params) */
.params-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.params-table th {
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.params-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: top;
}

.params-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.param-name {
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.param-req {
    color: var(--accent);
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    margin-left: 0.5rem;
}

.param-type {
    font-family: 'JetBrains Mono', monospace;
    color: var(--secondary);
    font-size: 0.85rem;
}

/* Code Panels */
.code-snippets,
.response-examples {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background: #111113;
    /* slightly darker for code */
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.lang-tabs {
    display: flex;
    gap: 0.5rem;
}

.lang-tab {
    background: none;
    border: none;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
}

.lang-tab:hover {
    color: var(--text-primary);
}

.lang-tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.code-content {
    padding: 1rem;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.code-content pre {
    margin: 0;
}

.code-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Basic Syntax colors */
.language-shell {
    color: #f8f8f2;
}

.language-js {
    color: #f1fa8c;
}

.language-python {
    color: #8be9fd;
}

.language-json {
    color: #a6e22e;
}

.res-status-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    outline: none;
}

.responses-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.response-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}

.res-code-badge {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.res-code-2xx {
    background: rgba(16, 185, 129, 0.2);
    color: var(--get);
}

.res-code-3xx {
    background: rgba(59, 130, 246, 0.2);
    color: var(--post);
}

.res-code-4xx {
    background: rgba(245, 158, 11, 0.2);
    color: var(--put);
}

.res-code-5xx {
    background: rgba(239, 68, 68, 0.2);
    color: var(--delete);
}

.res-code-other {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* Buttons & Inputs */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.primary-btn {
    background: var(--primary);
    color: white;
}

.primary-btn:hover {
    background: var(--primary-hover);
}

.outline-btn {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.outline-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.icon-btn {
    background: transparent;
    padding: 0.4rem;
    color: var(--text-secondary);
    border-radius: 6px;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.sm-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--border-focus);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .doc-section {
        flex-direction: column;
        padding: 2.5rem 1.5rem;
        gap: 2rem;
    }

    .code-column {
        width: 100%;
        position: static;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Would need an open button for mobile, keeping simple for now */
}