/* Codesign Assistant — match frontend dark theme */

:root {
    --brand-pink: #ff66af;
    --brand-purple: #7b34db;
    --brand-purple-secondary: #be96f4;
    --brand-blue: #99cafb;
    --bg-main: #1e263b;
    --bg-dark: #1d1930;
    --bg-card: #070e1e;
    --text-main: #d1d5db;
    --ui-primary: #ef2b89;
}

/* Navigation sidebar — darkest */
.wy-side-nav-search {
    background-color: var(--bg-card) !important;
}

.wy-side-nav-search a,
.wy-side-nav-search .wy-dropdown > a {
    color: #fff !important;
}

.wy-side-nav-search input[type="text"] {
    background-color: var(--bg-dark) !important;
    border-color: var(--brand-purple) !important;
    color: var(--text-main) !important;
}

.wy-nav-side {
    background-color: var(--bg-card) !important;
}

.wy-menu-vertical li.current {
    background-color: var(--bg-dark) !important;
}

.wy-menu-vertical li.current > a {
    border-right: 3px solid var(--brand-pink) !important;
}

.wy-menu-vertical a {
    color: #9ca3af !important;
}

.wy-menu-vertical a:hover {
    background-color: var(--bg-dark) !important;
    color: var(--brand-pink) !important;
}

.wy-menu-vertical li.toctree-l1.current > a {
    border-bottom-color: var(--bg-card) !important;
}

/* Main content area — lighter */
.wy-nav-content-wrap {
    background-color: var(--bg-dark) !important;
}

.wy-nav-content {
    background-color: var(--bg-main) !important;
    color: var(--text-main) !important;
    max-width: 900px !important;
}

/* Headings */
.rst-content h1,
.rst-content h2,
.rst-content h3,
.rst-content h4,
.rst-content h5,
.rst-content h6 {
    color: #fff !important;
}

/* Links */
a {
    color: var(--brand-purple-secondary) !important;
}

a:hover {
    color: var(--brand-pink) !important;
}

a:visited {
    color: var(--brand-purple-secondary) !important;
}

/* Header */
.wy-side-nav-search > a img {
    max-width: 180px;
}

/* Tables */
.wy-table-responsive {
    overflow-x: visible !important;
}

.rst-content table.docutils,
.rst-content table.field-list {
    border-color: #393747 !important;
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}

.rst-content table.docutils td,
.rst-content table.docutils th,
.rst-content table.field-list td,
.rst-content table.field-list th {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.rst-content table.docutils thead,
.rst-content table.field-list thead {
    background-color: var(--bg-dark) !important;
}

.rst-content table.docutils thead th,
.rst-content table.field-list thead th {
    color: #fff !important;
    border-color: #393747 !important;
}

.rst-content table.docutils caption,
.rst-content table.field-list caption {
    color: #fff !important;
}

.rst-content table.docutils td,
.rst-content table.field-list td {
    border-color: #393747 !important;
    color: var(--text-main) !important;
    background-color: var(--bg-main) !important;
}

.rst-content table.docutils tr:nth-child(even) td,
.rst-content table.field-list tr:nth-child(even) td {
    background-color: var(--bg-dark) !important;
}

/* Code blocks */
.rst-content code,
.rst-content tt {
    background-color: var(--bg-main) !important;
    color: var(--brand-blue) !important;
    border: 1px solid #393747 !important;
}

.rst-content pre {
    background-color: var(--bg-dark) !important;
    border: 1px solid #393747 !important;
    color: var(--text-main) !important;
}

.highlight {
    background-color: var(--bg-dark) !important;
}

/* Admonitions (tip, note, warning) */
.rst-content .admonition {
    background-color: var(--bg-dark) !important;
    border-left-color: var(--brand-purple) !important;
}

.rst-content .admonition.tip {
    background-color: rgba(123, 52, 219, 0.1) !important;
    border-left-color: var(--brand-purple-secondary) !important;
}

.rst-content .admonition.tip .admonition-title {
    background-color: rgba(123, 52, 219, 0.2) !important;
}

.rst-content .admonition.note {
    background-color: rgba(153, 202, 251, 0.08) !important;
    border-left-color: var(--brand-blue) !important;
}

.rst-content .admonition.note .admonition-title {
    background-color: rgba(153, 202, 251, 0.15) !important;
}

.rst-content .admonition.warning {
    background-color: rgba(255, 102, 175, 0.08) !important;
    border-left-color: var(--brand-pink) !important;
}

.rst-content .admonition.warning .admonition-title {
    background-color: rgba(255, 102, 175, 0.15) !important;
}

.rst-content .admonition .admonition-title {
    background-color: var(--bg-dark) !important;
    color: #fff !important;
}

.rst-content .admonition p {
    color: var(--text-main) !important;
}

/* Breadcrumb / navigation bar */
.wy-breadcrumbs {
    color: var(--text-main) !important;
}

.wy-breadcrumbs li a {
    color: var(--brand-purple-secondary) !important;
}

/* Footer */
footer {
    color: var(--text-main) !important;
}

footer a {
    color: var(--brand-purple-secondary) !important;
}

/* Previous / Next navigation buttons */
.btn-neutral {
    background-color: var(--bg-dark) !important;
    color: var(--text-main) !important;
    border: 1px solid #393747 !important;
    border-radius: 4px !important;
    padding: 8px 16px !important;
}

.btn-neutral:hover {
    background-color: var(--bg-card) !important;
    color: var(--brand-pink) !important;
    border-color: var(--brand-purple) !important;
}

.btn-neutral:visited {
    color: var(--text-main) !important;
}

/* Search results */
.wy-body-for-nav .search-results .context {
    color: var(--text-main) !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background-color: var(--brand-purple);
    border-radius: 4px;
}

/* Mobile toggle */
.wy-nav-top {
    background-color: var(--bg-dark) !important;
}

.wy-nav-top a {
    color: #fff !important;
}

/* Version label */
.rst-versions {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
}

/* Image lightbox */
.rst-content img.zoomable {
    cursor: zoom-in;
    transition: opacity 0.2s;
}

.rst-content img.zoomable:hover {
    opacity: 0.85;
}

.image-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    cursor: zoom-out;
    justify-content: center;
    align-items: center;
}

.image-lightbox-overlay.active {
    display: flex;
}

.image-lightbox-overlay img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

/* Figure and diagram captions */
.rst-content .figure .caption,
.rst-content figure figcaption {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    margin-top: 0.5em;
    font-size: 0.9em;
}

/* Mermaid diagram sizing */
.rst-content .mermaid {
    max-width: 100%;
    max-height: 400px;
    overflow: auto;
    margin: 1em auto;
    display: flex;
    justify-content: center;
}

.rst-content .mermaid svg {
    max-width: 100%;
    max-height: 380px;
    height: auto !important;
}

.rst-content .mermaid svg > rect {
    fill: transparent !important;
    stroke: none !important;
}

.rst-content .document > p > em:only-child,
.rst-content .section > p > em:only-child {
    display: block;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9em;
    margin-top: -0.5em;
    margin-bottom: 1.5em;
}
