
/* PECPool API topbar theme support */
:root,
html,
body,
.swagger-ui {
    color-scheme: light dark;
    --pecpool-api-page-bg: #f5f7fb;
    --pecpool-api-topbar-bg: #ffffff;
    --pecpool-api-topbar-border: rgba(15, 23, 42, 0.14);
    --pecpool-api-topbar-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    --pecpool-api-title: #111827;
    --pecpool-api-subtitle: #475569;
    --pecpool-api-panel-bg: #ffffff;
}

@media (prefers-color-scheme: dark) {
    :root,
    html,
    body,
    .swagger-ui {
        --pecpool-api-page-bg: #0f172a;
        --pecpool-api-topbar-bg: #0b1220;
        --pecpool-api-topbar-border: #334155;
        --pecpool-api-topbar-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
        --pecpool-api-title: #ffffff;
        --pecpool-api-subtitle: #e2e8f0;
        --pecpool-api-panel-bg: #111827;
    }
}

/* Swagger UI can apply dark mode on different elements depending on version/theme. */
html[data-theme="dark"],
html.dark,
html.swagger-ui-dark,
body[data-theme="dark"],
body.dark,
body.swagger-ui-dark,
.swagger-ui[data-theme="dark"],
.swagger-ui.dark,
.swagger-ui.swagger-ui-dark,
[data-theme="dark"] .swagger-ui,
.dark .swagger-ui,
.swagger-ui-dark .swagger-ui {
    --pecpool-api-page-bg: #0f172a;
    --pecpool-api-topbar-bg: #0b1220;
    --pecpool-api-topbar-border: #334155;
    --pecpool-api-topbar-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    --pecpool-api-title: #ffffff;
    --pecpool-api-subtitle: #e2e8f0;
    --pecpool-api-panel-bg: #111827;
}

html, body {
    background: var(--pecpool-api-page-bg) !important;
}

.swagger-ui .topbar {
    background: var(--pecpool-api-topbar-bg) !important;
    border-bottom: 2px solid var(--pecpool-api-topbar-border) !important;
    min-height: 72px !important;
    padding: 0 20px !important;
    box-shadow: var(--pecpool-api-topbar-shadow) !important;
}

.swagger-ui .topbar .wrapper {
    max-width: none !important;
    padding: 0 !important;
}

.swagger-ui .topbar .link {
    align-items: center !important;
    display: inline-flex !important;
    gap: 12px !important;
    min-height: 72px !important;
    text-decoration: none !important;
}

.swagger-ui .topbar .link > img:not(.pecpool-api-brand-logo),
.swagger-ui .topbar .link > svg,
.swagger-ui .topbar .link > span:not(.pecpool-api-brand-text) {
    display: none !important;
}

.swagger-ui .topbar .link .pecpool-api-brand-logo {
    display: block !important;
    width: 40px !important;
    height: 40px !important;
    flex: 0 0 40px !important;
}

.swagger-ui .topbar .link .pecpool-api-brand-text {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    line-height: 1.05 !important;
}

.swagger-ui .topbar .link .pecpool-api-brand-title {
    color: var(--pecpool-api-title) !important;
    display: block !important;
    font-family: Inter, Arial, sans-serif !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    letter-spacing: 0.2px !important;
    line-height: 1.05 !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

.swagger-ui .topbar .link .pecpool-api-brand-subtitle {
    color: var(--pecpool-api-subtitle) !important;
    display: block !important;
    font-family: Inter, Arial, sans-serif !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.15px !important;
    line-height: 1.2 !important;
    margin-top: 4px !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

/* Extra hard overrides for dark mode readability. */
html[data-theme="dark"] .swagger-ui .topbar .link .pecpool-api-brand-title,
html.dark .swagger-ui .topbar .link .pecpool-api-brand-title,
html.swagger-ui-dark .swagger-ui .topbar .link .pecpool-api-brand-title,
body[data-theme="dark"] .swagger-ui .topbar .link .pecpool-api-brand-title,
body.dark .swagger-ui .topbar .link .pecpool-api-brand-title,
body.swagger-ui-dark .swagger-ui .topbar .link .pecpool-api-brand-title,
.swagger-ui[data-theme="dark"] .topbar .link .pecpool-api-brand-title,
.swagger-ui.dark .topbar .link .pecpool-api-brand-title,
.swagger-ui.swagger-ui-dark .topbar .link .pecpool-api-brand-title,
[data-theme="dark"] .swagger-ui .topbar .link .pecpool-api-brand-title,
.dark .swagger-ui .topbar .link .pecpool-api-brand-title,
.swagger-ui-dark .swagger-ui .topbar .link .pecpool-api-brand-title {
    color: #ffffff !important;
}

html[data-theme="dark"] .swagger-ui .topbar .link .pecpool-api-brand-subtitle,
html.dark .swagger-ui .topbar .link .pecpool-api-brand-subtitle,
html.swagger-ui-dark .swagger-ui .topbar .link .pecpool-api-brand-subtitle,
body[data-theme="dark"] .swagger-ui .topbar .link .pecpool-api-brand-subtitle,
body.dark .swagger-ui .topbar .link .pecpool-api-brand-subtitle,
body.swagger-ui-dark .swagger-ui .topbar .link .pecpool-api-brand-subtitle,
.swagger-ui[data-theme="dark"] .topbar .link .pecpool-api-brand-subtitle,
.swagger-ui.dark .topbar .link .pecpool-api-brand-subtitle,
.swagger-ui.swagger-ui-dark .topbar .link .pecpool-api-brand-subtitle,
[data-theme="dark"] .swagger-ui .topbar .link .pecpool-api-brand-subtitle,
.dark .swagger-ui .topbar .link .pecpool-api-brand-subtitle,
.swagger-ui-dark .swagger-ui .topbar .link .pecpool-api-brand-subtitle {
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .swagger-ui .topbar,
html.dark .swagger-ui .topbar,
html.swagger-ui-dark .swagger-ui .topbar,
body[data-theme="dark"] .swagger-ui .topbar,
body.dark .swagger-ui .topbar,
body.swagger-ui-dark .swagger-ui .topbar,
.swagger-ui[data-theme="dark"] .topbar,
.swagger-ui.dark .topbar,
.swagger-ui.swagger-ui-dark .topbar,
[data-theme="dark"] .swagger-ui .topbar,
.dark .swagger-ui .topbar,
.swagger-ui-dark .swagger-ui .topbar {
    background: #0b1220 !important;
    border-bottom-color: #475569 !important;
}

.swagger-ui .scheme-container {
    background: var(--pecpool-api-panel-bg) !important;
    box-shadow: var(--pecpool-api-topbar-shadow) !important;
}

.swagger-ui .topbar,
.swagger-ui .topbar * {
    box-sizing: border-box !important;
}

.swagger-ui .topbar .link:hover .pecpool-api-brand-title,
.swagger-ui .topbar .link:focus .pecpool-api-brand-title {
    color: var(--pecpool-api-title) !important;
}

.swagger-ui .topbar .link:hover .pecpool-api-brand-subtitle,
.swagger-ui .topbar .link:focus .pecpool-api-brand-subtitle {
    color: var(--pecpool-api-subtitle) !important;
}
