/* Documentation-specific styles */

/* Reset body styles from gojitsu-theme.css */
body {
    padding: 0;
    margin: 0;
    text-align: left;
    display: block;
    min-height: 100vh;
    font-size: 15px;
}

/* Override gojitsu-theme.css global heading sizes for docs context */
h1 { font-size: 32px; }
h2 { font-size: 26px; }
h3 { font-size: 20px; }
h4 { font-size: 16px; }

/* Header adjustments */
.app-header {
    margin: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

[data-theme="light"] .app-header {
    background: rgba(255, 255, 255, 0.88) !important;
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .app-header {
    background: rgba(13, 14, 17, 0.88) !important;
    border-bottom-color: rgba(255, 255, 255, 0.07);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Main Documentation Container */
.docs-container {
    display: flex;
    height: calc(100vh - 48px);
    overflow: hidden;
}

/* Sidebar */
.docs-sidebar {
    width: 280px;
    background: var(--panel);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.docs-sidebar.collapsed {
    transform: translateX(-100%);
    position: absolute;
    z-index: 999;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--panel);
    z-index: 10;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
}

.sidebar-toggle {
    display: none;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    color: var(--fg-secondary);
}

.sidebar-nav {
    padding: 8px;
}

/* Navigation Items */
.nav-divider {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    padding: 16px 12px 6px 12px;
    margin-top: 4px;
}

.nav-item,
.nav-group-header {
    display: block;
    padding: 9px 12px;
    margin: 2px 0;
    border-radius: 6px;
    color: var(--fg-secondary);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.nav-item:hover,
.nav-group-header:hover {
    background: var(--hover-bg);
    color: var(--fg);
}

.nav-item.active {
    background: transparent;
    color: var(--accent);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav-group {
    margin: 4px 0;
}

.nav-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.nav-group-icon {
    transition: transform 0.2s;
    font-size: 10px;
}

.nav-group.collapsed .nav-group-icon {
    transform: rotate(-90deg);
}

.nav-group-items {
    margin-left: 12px;
    border-left: 1px solid var(--border-subtle);
    padding-left: 8px;
    margin-top: 4px;
}

.nav-group.collapsed .nav-group-items {
    display: none;
}

/* Main Content */
.docs-content {
    flex: 1;
    overflow-y: auto;
    background: var(--bg);
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 48px;
}

.content-wrapper.api-mode {
    padding: 0;
    max-width: none;
}

/* Layout: markdown + page TOC side by side */
.content-wrapper.has-toc {
    display: flex;
    align-items: flex-start;
    gap: 48px;
    max-width: 1400px;
}

.content-wrapper.has-toc #markdownContent {
    flex: 1;
    min-width: 0;
}

/* Page TOC */
.page-toc-container {
    width: 192px;
    flex-shrink: 0;
    position: sticky;
    top: 68px;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
    scrollbar-width: none;
}

.page-toc-container::-webkit-scrollbar { display: none; }

.toc-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.toc-link {
    display: block;
    font-size: 12.5px;
    color: var(--fg-secondary);
    text-decoration: none;
    padding: 4px 0;
    line-height: 1.45;
    transition: color 0.12s;
    border-left: 2px solid transparent;
    padding-left: 10px;
    margin-left: -12px;
}

.toc-link.toc-h3 {
    padding-left: 20px;
    font-size: 12px;
    color: var(--muted);
}

.toc-link:hover {
    color: var(--fg);
}

.toc-link.active {
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 500;
}

.toc-link.toc-h3.active {
    color: var(--accent);
}

@media (max-width: 1100px) {
    .page-toc-container { display: none !important; }
    .content-wrapper.has-toc { max-width: 1200px; }
}

/* Welcome Section */
.welcome-section {
    text-align: left;
}

.welcome-section h1 {
    font-size: 32px;
    margin-bottom: 16px;
    color: var(--fg);
}

.welcome-section > p {
    font-size: 16px;
    color: var(--fg-secondary);
    margin-bottom: 48px;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.quick-link-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.2s;
}

.quick-link-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.quick-link-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--fg);
}

.quick-link-card p {
    font-size: 14px;
    color: var(--fg-secondary);
    margin-bottom: 16px;
}

/* Markdown Content Styles */
.markdown-content {
    line-height: 1.75;
    font-size: 15px;
}

.markdown-content h1 {
    font-size: 28px;
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    color: var(--fg);
}

.markdown-content h2 {
    font-size: 24px;
    margin-top: 32px;
    margin-bottom: 16px;
    color: var(--fg);
}

.markdown-content h3 {
    font-size: 20px;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--fg);
}

.markdown-content h4 {
    font-size: 16px;
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--fg);
}

.markdown-content p {
    margin-bottom: 18px;
    color: var(--fg-secondary);
    font-size: 15px;
}

.markdown-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
}

.markdown-content a:hover {
    border-bottom-color: var(--accent);
}

.markdown-content code {
    background: var(--hover-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.85em;
    color: var(--accent);
    font-weight: 500;
}

.markdown-content pre {
    background: #f6f8fa;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 20px 0;
    line-height: 1.65;
}

[data-theme="dark"] .markdown-content pre {
    background: #0d1117;
    border-color: rgba(255,255,255,0.07);
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
    color: var(--fg);
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.875em;
}

.markdown-content ul,
.markdown-content ol {
    margin: 16px 0;
    padding-left: 24px;
    color: var(--fg-secondary);
}

.markdown-content li {
    margin: 8px 0;
}

.markdown-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--fg-secondary);
    font-style: italic;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.markdown-content table th,
.markdown-content table td {
    padding: 12px;
    border: 1px solid var(--border);
    text-align: left;
}

.markdown-content table th {
    background: var(--panel);
    font-weight: 600;
    color: var(--fg);
}

.markdown-content table td {
    color: var(--fg-secondary);
}

.markdown-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* Search Modal */
.search-modal {
    max-width: 600px;
    width: 90%;
}

.search-input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--fg);
    margin-bottom: 16px;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--panel);
    transition: all 0.15s;
}

.search-result-item:hover {
    background: var(--hover-bg);
    border-color: var(--accent);
}

.search-result-title {
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 4px;
}

.search-result-excerpt {
    font-size: 13px;
    color: var(--fg-secondary);
}

.search-result-path {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}

/* Production API notice banner */
.prod-api-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: color-mix(in srgb, var(--jitsu-mustard) 12%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--jitsu-mustard) 30%, transparent);
    color: var(--fg);
    font-size: 14px;
    line-height: 1.5;
}

@supports not (color: color-mix(in srgb, red 10%, blue)) {
    .prod-api-notice {
        background: rgba(221, 180, 49, 0.12);
        border-bottom: 1px solid rgba(221, 180, 49, 0.30);
    }
}

.prod-api-notice svg {
    flex-shrink: 0;
    color: var(--jitsu-mustard);
}

.prod-api-notice .btn-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent);
    cursor: pointer;
    font-size: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Swagger UI Customization */
#apiContent {
    min-height: 600px;
    padding: 0;
}

#apiContent .swagger-ui {
    font-family: 'AvenirNextLTPro', 'Open Sans', sans-serif;
    font-size: 14px;
}

#apiContent .swagger-ui .opblock-summary-description,
#apiContent .swagger-ui .opblock-body,
#apiContent .swagger-ui textarea,
#apiContent .swagger-ui input[type="text"],
#apiContent .swagger-ui .body-param__text,
#apiContent .swagger-ui .highlight-code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Responsive Design */
@media (max-width: 768px) {
    .docs-sidebar {
        position: fixed;
        left: 0;
        top: 48px;
        height: calc(100vh - 48px);
        z-index: 999;
        transform: translateX(-100%);
    }

    .docs-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
    }

    .sidebar-toggle {
        display: block;
    }

    .content-wrapper {
        padding: 20px 16px;
    }

    .quick-links {
        grid-template-columns: 1fr;
    }

    .welcome-section h1 {
        font-size: 24px;
    }

    .welcome-hero h1 {
        font-size: 30px;
    }
}

/* Dark theme adjustments for code highlighting */
[data-theme="dark"] .markdown-content code {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .hljs {
    background: var(--panel);
}

/* Loading indicator */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--muted);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Breadcrumb navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    font-size: 13px;
    color: var(--fg-secondary);
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--muted);
}

/* Table of contents for long documents */
.doc-toc {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin: 24px 0;
}

.doc-toc h4 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--fg);
}

.doc-toc ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.doc-toc li {
    margin: 6px 0;
}

.doc-toc a {
    color: var(--fg-secondary);
    text-decoration: none;
    font-size: 13px;
}

.doc-toc a:hover {
    color: var(--accent);
}

/* ─── Lifecycle Visualizer ───────────────────────────────────────────────── */

.lifecycle-viz {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px 28px 20px;
    margin-bottom: 40px;
}

/* Main happy-path track */
.lc-track {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.lc-phase {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lc-phase-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
}

.lc-phase-steps {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.lc-phase-sep {
    color: var(--border);
    font-size: 18px;
    padding: 0 2px;
    line-height: 1;
    /* align with step row, below phase label */
    margin-top: 22px;
    flex-shrink: 0;
}

/* Status node chip */
.lc-node {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--fg-secondary);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1px;
    cursor: pointer;
    transition: border-color 0.12s, color 0.12s, background 0.12s, box-shadow 0.12s;
    white-space: nowrap;
    line-height: 1;
}

.lc-node:hover {
    border-color: var(--nc, var(--accent));
    color: var(--nc, var(--accent));
    background: var(--hover-bg);
}

.lc-node.active {
    border-color: var(--nc, var(--accent));
    color: var(--nc, var(--accent));
    background: var(--hover-bg);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--nc, var(--accent)) 18%, transparent);
}

.lc-arrow {
    color: var(--muted);
    font-size: 13px;
    padding: 0 1px;
    flex-shrink: 0;
    line-height: 1;
}

/* Description bar */
.lc-desc-bar {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 20px;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.lc-desc-hint {
    font-size: 12px;
    color: var(--muted);
    font-style: italic;
}

.lc-desc-body {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.lc-desc-status {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
    background: transparent;
    padding: 0;
}

.lc-desc-text {
    font-size: 13px;
    color: var(--fg-secondary);
    line-height: 1.5;
}

/* Exception / resolution states */
.lc-exc-details {
    border-top: 1px solid var(--border-subtle);
    padding-top: 16px;
}

/* Override the generic details/summary styles inside the viz */
.lifecycle-viz details {
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0;
    overflow: visible;
}

.lifecycle-viz summary {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--muted);
    padding: 0 0 14px 0;
    border: none;
    background: transparent;
}

.lifecycle-viz summary:hover {
    background: transparent;
    color: var(--fg-secondary);
}

.lifecycle-viz summary::before {
    font-size: 8px;
}

.lc-exc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.lc-exc-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lc-exc-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    margin-bottom: 2px;
}

.lc-exc-chips {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.lc-node.lc-exc {
    font-size: 10.5px;
    padding: 4px 8px;
    border-style: dashed;
    opacity: 0.8;
}

.lc-node.lc-exc:hover,
.lc-node.lc-exc.active {
    opacity: 1;
    border-style: solid;
}

/* Fallback for browsers without color-mix() */
@supports not (color: color-mix(in srgb, red 10%, transparent)) {
    .lc-node.active {
        box-shadow: 0 0 0 3px var(--active-bg);
    }
}

/* ---------------------------------------------------------------------------
   Webhook Explorer
--------------------------------------------------------------------------- */

.wh-explorer {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 40px;
}

.wh-explorer-head {
    padding: 16px 20px 8px;
}

.wh-explorer-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--fg-secondary);
    margin-bottom: 3px;
}

.wh-explorer-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}

.wh-explorer-body {
    display: flex;
    height: 480px;
}

.wh-sidebar {
    display: flex;
    flex-direction: column;
    width: 260px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    overflow: hidden;
}

.wh-tabs {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.wh-tab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 10px;
    border: none;
    background: transparent;
    color: var(--fg-secondary);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    text-align: left;
    transition: background 0.12s, color 0.12s;
}

.wh-tab:hover {
    background: var(--hover-bg);
    color: var(--fg);
}

.wh-tab.active {
    background: var(--active-bg);
    color: var(--accent);
    font-weight: 600;
}

.wh-tab-count {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--hover-bg);
    color: var(--muted);
    flex-shrink: 0;
}

.wh-tab.active .wh-tab-count {
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--accent);
}

.wh-event-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.wh-event-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 6px 10px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.12s;
}

.wh-event-btn:hover {
    background: var(--hover-bg);
}

.wh-event-btn.active {
    background: var(--active-bg);
}

.wh-event-name {
    font-size: 11.5px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--fg);
    line-height: 1.3;
}

.wh-event-btn.active .wh-event-name {
    color: var(--accent);
}


.wh-payload-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.wh-payload-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.wh-active-event {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 3px;
    font-family: 'JetBrains Mono', monospace;
}

.wh-active-desc {
    font-size: 12px;
    color: var(--fg-secondary);
    margin: 0;
    line-height: 1.4;
}

.wh-copy-btn {
    position: static;
    opacity: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.wh-pre {
    flex: 1;
    margin: 0;
    overflow-y: auto;
    border-radius: 0;
    border: none;
    background: transparent;
    padding: 16px 20px;
    font-size: 12px;
    line-height: 1.65;
}

[data-theme="dark"] .wh-pre {
    background: transparent;
}

@supports not (color: color-mix(in srgb, red 10%, blue)) {
    .wh-tab.active .wh-tab-count {
        background: rgba(72, 181, 116, 0.15);
        color: var(--accent);
    }
}

/* Webhook Explorer — actions bar */
.wh-explorer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px 14px;
    border-bottom: 1px solid var(--border);
}

.wh-test-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.wh-test-btn:hover {
    background: var(--accent);
    color: #fff;
}

/* Webhook Tester Modal */
.wt-modal {
    max-width: 620px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.wt-cors-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12.5px;
    line-height: 1.5;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 18px;
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    color: var(--text-secondary);
    border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}

@supports not (color: color-mix(in srgb, red 10%, blue)) {
    .wt-cors-notice {
        background: rgba(72, 181, 116, 0.08);
        border-color: rgba(72, 181, 116, 0.2);
    }
}

.wt-cors-notice svg { flex-shrink: 0; margin-top: 1px; color: var(--accent); }

.wt-select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--input-bg, var(--bg));
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}

.wt-optional {
    font-weight: 400;
    font-size: 11px;
    color: var(--text-secondary);
}

.wt-auth-row {
    display: flex;
    gap: 8px;
}

.wt-auth-name { flex: 1; }
.wt-auth-value { flex: 1; }

.wt-payload {
    width: 100%;
    box-sizing: border-box;
    height: 200px;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--code-bg, var(--panel));
    color: var(--text);
    font-family: var(--font-mono, monospace);
    font-size: 12px;
    line-height: 1.55;
    resize: vertical;
}

.wt-payload:focus {
    outline: none;
    border-color: var(--accent);
}

.wt-field-error {
    margin-top: 4px;
}

.wt-response {
    margin-top: 18px;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.wt-response-meta {
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: var(--font-mono, monospace);
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}

.wt-ok   { color: #48B574; }
.wt-error { color: #BC5D33; }

.wt-response-body {
    margin: 0;
    padding: 14px;
    font-size: 12px;
    line-height: 1.6;
    font-family: var(--font-mono, monospace);
    background: var(--code-bg, var(--panel));
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 240px;
    overflow-y: auto;
}

/* Copy button on code blocks */
.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    height: 26px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s, color 0.15s, border-color 0.15s, background 0.15s;
    z-index: 2;
}

.copy-btn:hover {
    opacity: 1;
    color: var(--fg);
    border-color: var(--accent);
}

.copy-btn.copied {
    opacity: 1;
    color: var(--accent);
    border-color: var(--accent);
}

/* Details / collapsible payload samples */
.markdown-content details {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 12px 0;
    overflow: hidden;
}

.markdown-content summary {
    padding: 9px 14px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: var(--fg-secondary);
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, color 0.15s;
}

.markdown-content summary::-webkit-details-marker { display: none; }

.markdown-content summary::before {
    content: '▶';
    font-size: 9px;
    color: var(--muted);
    transition: transform 0.15s;
    flex-shrink: 0;
}

.markdown-content details[open] summary::before {
    transform: rotate(90deg);
}

.markdown-content summary:hover {
    background: var(--hover-bg);
    color: var(--fg);
}

.markdown-content details pre {
    margin: 0;
    border-radius: 0 0 10px 10px;
    border: none;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}

/* Table cells containing details/code — remove double padding */
.markdown-content td:has(details),
.markdown-content td:has(pre) {
    padding: 0;
    vertical-align: top;
}

/* Swagger UI theme customization */
.swagger-ui .topbar {
    display: none;
}

.swagger-ui .info {
    margin: 0;
}

.swagger-ui .scheme-container {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* ─── Phase 1: Onboarding & Welcome ───────────────────────────────────────── */

/* Header: environment pill */
.env-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--hover-bg);
    color: var(--fg-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.env-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--active-bg);
}

.env-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--jitsu-mustard);
}
.env-dot.staging  { background: var(--jitsu-mustard); }
.env-dot.production { background: var(--jitsu-green); }

/* Header: token button */
.token-action-btn {
    color: var(--fg-secondary);
}
.token-action-btn.has-token {
    color: var(--accent);
}
.token-action-btn svg {
    flex-shrink: 0;
}

/* Quatro color bar */
.quatro-bar {
    display: flex;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    width: 100%;
    margin: 0 0 32px;
}
.quatro-bar span {
    flex: 1;
}

/* Welcome hero */
.welcome-hero {
    text-align: center;
    margin-bottom: 32px;
}
.welcome-hero h1 {
    font-size: 46px;
    font-weight: 300;
    color: var(--fg);
    margin-bottom: 14px;
    letter-spacing: -1.5px;
    line-height: 1.12;
}
.welcome-hero h1 strong {
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent) 0%, var(--jitsu-azure) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.welcome-hero p {
    font-size: 17px;
    color: var(--fg-secondary);
    margin: 0;
}

/* Setup banner (shown when no token configured) */
.setup-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--active-bg);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 40px;
}
.setup-banner-icon {
    font-size: 28px;
    flex-shrink: 0;
}
.setup-banner-text {
    flex: 1;
}
.setup-banner-text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 4px;
}
.setup-banner-text p {
    font-size: 13px;
    color: var(--fg-secondary);
    margin: 0;
}

/* Environment status bar (shown when token is configured) */
.env-status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 40px;
    font-size: 13px;
    color: var(--fg-secondary);
}
.env-status-bar .env-dot { margin-right: 2px; }
.env-status-bar strong { color: var(--fg); }
.env-status-bar code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 11px;
    background: var(--hover-bg);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--muted);
}
.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    text-decoration: underline;
}
.btn-link:hover { opacity: 0.8; }

/* Primary solid button */
.btn-primary-solid {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: #fff;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-primary-solid:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.setup-banner-btn {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: #fff;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.setup-banner-btn:hover { background: var(--accent-hover); }

/* Section headers */
.section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    margin: 0 0 16px 0;
}

/* Journey cards */
.journey-section { margin-bottom: 48px; }

.journey-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.journey-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}
.journey-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 28px rgba(72, 181, 116, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.guide-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    flex-shrink: 0;
}

@supports not (color: color-mix(in srgb, red 10%, blue)) {
    .guide-card-icon { background: rgba(72, 181, 116, 0.12); }
}

.journey-card-num {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
    opacity: 0.3;
    flex-shrink: 0;
    width: 44px;
    line-height: 1;
}

.journey-card-body { flex: 1; }
.journey-card-body h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--fg);
    margin: 0 0 6px 0;
}
.journey-card-body p {
    font-size: 13px;
    color: var(--fg-secondary);
    margin: 0;
    line-height: 1.5;
}

.journey-card-arrow {
    font-size: 18px;
    color: var(--muted);
    flex-shrink: 0;
    transition: transform 0.15s;
}
.journey-card:hover .journey-card-arrow {
    transform: translateX(3px);
    color: var(--accent);
}

/* Checklist section */
.checklist-section { margin-bottom: 48px; }

.checklist-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.checklist-header-row .section-label { margin: 0; }

.checklist-progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.progress-bar-track {
    width: 120px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--jitsu-azure));
    border-radius: 3px;
    transition: width 0.4s ease;
}
.progress-label {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

.checklist-phases {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.checklist-phase {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.checklist-phase-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.checklist-phase-header:hover { background: var(--hover-bg); }

.checklist-phase-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.checklist-phase-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
}
.checklist-phase-count {
    font-size: 11px;
    color: var(--muted);
    background: var(--hover-bg);
    padding: 2px 8px;
    border-radius: 10px;
}
.checklist-phase-count.complete {
    background: var(--active-bg);
    color: var(--accent);
}
.checklist-phase-chevron {
    font-size: 11px;
    color: var(--muted);
    transition: transform 0.2s;
}
.checklist-phase.collapsed .checklist-phase-chevron {
    transform: rotate(-90deg);
}
.checklist-phase.collapsed .checklist-phase-items {
    display: none;
}

.checklist-phase-items {
    padding: 8px 0;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    transition: background 0.1s;
}
.checklist-item:hover { background: var(--hover-bg); }

.checklist-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
}

.checklist-item-label {
    flex: 1;
    font-size: 14px;
    color: var(--fg-secondary);
    line-height: 1.5;
}
.checklist-item.checked .checklist-item-label {
    text-decoration: line-through;
    color: var(--muted);
}

.checklist-item-link {
    font-size: 11px;
    color: var(--accent);
    text-decoration: none;
    flex-shrink: 0;
    margin-top: 2px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s;
}
.checklist-item:hover .checklist-item-link { opacity: 1; }
.checklist-item-link:hover { text-decoration: underline; }

/* Setup Modal */
.setup-modal {
    max-width: 480px;
    width: 90%;
}
.setup-modal h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 4px;
}
.setup-modal-subtitle {
    font-size: 13px;
    color: var(--fg-secondary);
    margin-bottom: 24px;
}
.setup-field {
    margin-bottom: 20px;
}
.setup-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    margin-bottom: 8px;
}
.env-toggle-group {
    display: flex;
    gap: 8px;
}
.env-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    padding: 10px 14px;
    background: var(--hover-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--fg-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    justify-content: center;
}
.env-toggle-btn:hover {
    border-color: var(--accent);
    color: var(--fg);
}
.env-toggle-btn.active {
    background: var(--active-bg);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}
.token-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.token-input {
    flex: 1;
    background: var(--hover-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--fg);
    outline: none;
    transition: border-color 0.15s;
}
.token-input:focus { border-color: var(--accent); }
.token-input::placeholder { color: var(--muted); font-family: inherit; }
.btn-icon {
    background: var(--hover-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.15s;
    display: flex;
    align-items: center;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }
.setup-hint {
    font-size: 12px;
    color: var(--muted);
    margin: 8px 0 0 0;
}
.setup-hint a { color: var(--accent); }
.setup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}
.setup-status {
    margin-top: 12px;
    font-size: 13px;
    min-height: 20px;
    text-align: center;
}
.setup-status.success { color: var(--accent); }
.setup-status.error { color: var(--jitsu-sienna); }

/* Responsive overrides for Phase 1 */
@media (max-width: 768px) {
    .setup-banner { flex-direction: column; text-align: center; }
    .journey-cards { grid-template-columns: 1fr; }
    .checklist-header-row { flex-direction: column; align-items: flex-start; }
    .welcome-hero h1 { font-size: 24px; }
    .quatro-bar { width: 100%; }
    .env-pill span:last-child { display: none; }
    .token-action-btn span { display: none; }
}

/* Print styles */
@media print {
    .docs-sidebar,
    .app-header,
    .search-modal {
        display: none;
    }

    .docs-content {
        width: 100%;
        max-width: none;
    }

    .content-wrapper {
        padding: 0;
    }
}

