/* Custom Memory Appliance Theme */

:root {
    --bg: #FFCD30;
    --fg: #000000;
    --sidebar-bg: #FFFFFF;
    --sidebar-fg: #000000;
    --sidebar-non-existant: #666666;
    --sidebar-active: #000000;
    --sidebar-spacer: #000000;
    
    --scrollbar: #000000;
    --icons: #000000;
    --icons-hover: #000000;
    
    --links: #000000;
    --inline-code-color: #000000;
    
    --theme-popup-bg: #FFFFFF;
    --theme-popup-border: #000000;
    --theme-hover: #EEEEEE;
    
    --quote-bg: #EEEEEE;
    --quote-border: #000000;
    
    --table-border-color: #000000;
    --table-header-bg: #EEEEEE;
    --table-alternate-bg: #F5F5F5;
    
    --searchbar-border-color: #000000;
    --searchbar-bg: #FFFFFF;
    --searchbar-fg: #000000;
    --searchbar-shadow-color: rgba(0, 0, 0, 0.3);
    --searchresults-header-fg: #000000;
    --searchresults-border-color: #000000;
    --searchresults-li-bg: #FFFFFF;
    --search-mark-bg: #FFCD30;
}

.sidebar {
    background-color: var(--sidebar-bg);
}

.chapter li.part-title {
    color: var(--sidebar-fg);
    margin: 15px 0 10px 0;
    font-weight: bold;
    font-size: 1.1em;
}

.content h1, .content h2, .content h3 {
    color: #000000;
}

.content a {
    color: var(--links);
}

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

.content {
    color: #000000;
    max-width: 1400px !important;
    overflow-x: visible !important;
}

/* Make the page wrapper wider */
.page-wrapper {
    max-width: none !important;
    overflow-x: auto !important;
}

#mdbook-content {
    max-width: 1400px !important;
    margin: 0 auto !important;
    overflow-x: visible !important;
}

/* Remove table wrapper overflow */
.table-wrapper {
    overflow-x: visible !important;
}

main {
    overflow-x: visible !important;
}

code {
    background-color: var(--quote-bg);
    color: #000000;
    padding: 2px 4px;
    border-radius: 3px;
}

pre {
    background-color: var(--quote-bg);
    border-left: 4px solid var(--quote-border);
    color: #000000;
}

blockquote {
    border-left: 4px solid var(--quote-border);
    background-color: var(--quote-bg);
    padding: 10px 20px;
    margin: 20px 0;
    color: #000000;
}

table {
    border-collapse: collapse;
    width: 100%;
    color: #000000;
    table-layout: fixed;
    min-width: 900px;
}

table thead {
    background-color: var(--table-header-bg);
    color: #000000;
}

table th, table td {
    border: 1px solid var(--table-border-color);
    padding: 8px 12px;
    color: #000000;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

table tr {
    background-color: #FFFFFF;
}

/* Custom column widths for gRPC model tables with 4 columns */
table thead th:nth-child(1):has(~ th:nth-child(4)) {
    width: 15%;
}

table thead th:nth-child(2):has(~ th:nth-child(4)) {
    width: 15%;
}

table thead th:nth-child(3):has(~ th:nth-child(4)) {
    width: 10%;
}

table thead th:nth-child(4) {
    width: 60%;
}

table tbody td:nth-child(1) {
    width: 15%;
}

table tbody td:nth-child(2) {
    width: 15%;
}

table tbody td:nth-child(3) {
    width: 10%;
}

table tbody td:nth-child(4) {
    width: 60%;
}

/* Override code background in table cells to match cell background */
table td code,
table th code {
    background-color: transparent !important;
    color: #000000 !important;
}

/* Mermaid diagram styling */
.mermaid {
    text-align: center;
    margin: 20px 0;
}

/* Redoc container */
#redoc-container {
    margin-top: 20px;
}

/* Hide theme picker button and popup */
#theme-toggle,
.theme-toggle {
    color: #FFCD30 !important;
    background: #FFCD30 !important;
    border-color: #FFCD30 !important;
    fill: #FFCD30 !important;
    pointer-events: none !important;
}

#theme-toggle svg,
.theme-toggle svg {
    fill: #FFCD30 !important;
    color: #FFCD30 !important;
    display: none !important;
}

#theme-list,
.theme-popup,
.theme-picker {
    display: none !important;
}

/* Hide page title in menu bar */
.menu-title {
    display: none !important;
}

/* Add logo to every page */
.content::before {
    content: '';
    display: block;
    float: right;
    width: 150px;
    height: 150px;
    background-image: url('../images/logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-left: 20px;
    margin-bottom: 10px;
}
