/* Custom styles for Qt-like documentation */

/* Make the page wider for code examples */
body {
    max-width: 1400px;
    margin: 0 auto;
}

/* Style the toctree (table of contents) */
.toctree-wrapper {
    margin-bottom: 2rem;
}

.toctree-wrapper .toctree-l0 > a {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--pst-color-link);
}

/* Section anchors */
h1, h2, h3, h4, h5, h6 {
    scroll-margin-top: 60px;
}

/* ============================================
   CODE BLOCK STYLING - Fix double nesting
   ============================================ */

/* Remove outer container padding, keep only inner */
div[class^="highlight"].notranslate {
    padding: 0;
    margin: 0;
    background-color: transparent;
    border-radius: 0;
}

/* Inner highlight container */
div.highlight {
    padding: 1rem;
    border-radius: 6px;
    background-color: var(--pst-color-pre-bg, #f6f8fa);
    color: var(--pst-color-pre-text, inherit);
}

/* The actual pre element */
div.highlight pre {
    padding: 0;
    margin: 0;
    background-color: transparent;
    border-radius: 0;
}

/* Inline code */
code {
    border-radius: 4px;
    padding: 2px 6px;
    background-color: var(--pst-color-code-bg, #f0f0f0);
    color: var(--pst-color-code-text, inherit);
}

/* Improve the navigation panel */
nav.toc {
    font-size: 0.9em;
}

nav.toc li {
    padding: 2px 0;
}

nav.toc a:hover {
    color: var(--pst-color-link-hover);
}

/* Highlight current section in TOC */
nav.toc .current {
    font-weight: 600;
    color: var(--pst-color-link);
}

/* Make the sidebar more Qt-like */
.sphinxsidebar {
    width: 280px !important;
}

.sphinxsidebarwrapper {
    padding: 10px;
}

/* Related links styling */
.related {
    background-color: var(--pst-color-surface, #f8f9fa);
    border-top: 1px solid var(--pst-color-border, #e1e4e8);
    padding: 8px 15px;
}

.related li {
    display: inline-block;
    margin-right: 15px;
}

/* Citations and footnotes */
.footnote {
    font-size: 0.9em;
    color: var(--pst-color-muted, #666);
}

/* Class members styling */
dl[class*="member"] dt {
    font-weight: 500;
    background-color: var(--pst-color-surface, #f6f8fa);
    border-left: 3px solid var(--pst-color-link, #0366d6);
    padding: 8px 12px;
    margin-top: 10px;
}

dl[class*="member"] dd {
    margin-left: 20px;
    padding: 8px 0;
}

/* Better spacing for function signatures */
.py func {
    background-color: transparent;
    border: none;
    padding: 0;
}

/* Admonition styling */
.admonition {
    border-radius: 6px;
    margin: 1rem 0;
    background-color: var(--pst-color-surface, #f8f9fa);
}

.admonition-title {
    font-weight: 600;
    border-bottom: 1px solid var(--pst-color-border, rgba(0,0,0,0.1));
    padding-bottom: 8px;
    margin-bottom: 12px;
}

/* Improve right sidebar (local TOC) */
.sphinxsidebarright {
    width: 250px !important;
}

/* Make page content more readable */
.body {
    font-size: 16px;
    line-height: 1.7;
}

.body p {
    margin-bottom: 1em;
}

/* List styling */
.body ul, .body ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

.body li {
    margin-bottom: 0.5em;
}

/* Table styling */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

table th, table td {
    border: 1px solid var(--pst-color-border, #e1e4e8);
    padding: 8px 12px;
}

table th {
    background-color: var(--pst-color-surface, #f6f8fa);
    font-weight: 600;
}

/* Better header link visibility */
.headerlink {
    opacity: 0.3;
    margin-left: 5px;
}

.headerlink:hover {
    opacity: 1;
}

/* ============================================
   DARK MODE SUPPORT for sphinxawesome-theme
   ============================================ */

/* Dark mode - use .dark class on html element */
html.dark div.highlight {
    background-color: #1e1e1e !important;
    color: #d4d4d4;
}

html.dark code,
html.dark :not(pre) > code {
    background-color: #2d2d2d !important;
    color: #d4d4d4;
}

/* Syntax highlighting colors for dark mode */
html.dark .highlight .go { color: #6a9955; }      /* Comment */
html.dark .highlight .gp { color: #9cdcfe; }      /* Generic Prompt */
html.dark .highlight .k { color: #569cd6; }       /* Keyword */
html.dark .highlight .kn { color: #569cd6; }      /* Keyword Namespace */
html.dark .highlight .s { color: #ce9178; }       /* String */
html.dark .highlight .sc { color: #ce9178; }     /* String Char */
html.dark .highlight .nb { color: #4ec9b0; }     /* Name Built-in */
html.dark .highlight .nc { color: #4ec9b0; }    /* Name Class */
html.dark .highlight .nf { color: #dcdcaa; }    /* Name Function */
html.dark .highlight .ni { color: #ce9178; }     /* Name Entity */
html.dark .highlight .nn { color: #4ec9b0; }    /* Name Namespace */
html.dark .highlight .nt { color: #569cd6; }     /* Name Tag */
html.dark .highlight .o { color: #808080; }     /* Operator */
html.dark .highlight .ow { color: #569cd6; }     /* Operator Word */
html.dark .highlight .p { color: #808080; }      /* Punctuation */
html.dark .highlight .cm { color: #6a9955; }     /* Comment Multiline */
html.dark .highlight .cp { color: #569cd6; }     /* Comment Preproc */
html.dark .highlight .c1 { color: #6a9955; }    /* Comment Single */
html.dark .highlight .cs { color: #6a9955; }     /* Comment Special */
html.dark .highlight .gd { color: #f44747; }    /* Generic Deleted */
html.dark .highlight .ge { color: #d4d4d4; font-style: italic; } /* Generic Emph */
html.dark .highlight .gr { color: #f44747; }    /* Generic Error */
html.dark .highlight .gh { color: #569cd6; }    /* Generic Heading */
html.dark .highlight .gi { color: #b5cea8; }     /* Generic Inserted */
html.dark .highlight .gs { color: #d4d4d4; font-weight: bold; } /* Generic Strong */
html.dark .highlight .gu { color: #569cd6; }    /* Generic Subheading */
html.dark .highlight .kc { color: #569cd6; }     /* Keyword Constant */
html.dark .highlight .kd { color: #569cd6; }    /* Keyword Declaration */
html.dark .highlight .km { color: #569cd6; }    /* Keyword Namespace */
html.dark .highlight .kt { color: #4ec9b0; }     /* Keyword Type */
html.dark .highlight .m { color: #b5cea8; }     /* Literal Number */
html.dark .highlight .mb { color: #b5cea8; }    /* Literal Number Bin */
html.dark .highlight .mf { color: #b5cea8; }    /* Literal Number Float */
html.dark .highlight .mh { color: #b5cea8; }     /* Literal Number Hex */
html.dark .highlight .mi { color: #b5cea8; }    /* Literal Number Integer */
html.dark .highlight .mo { color: #b5cea8; }    /* Literal Number Oct */
html.dark .highlight .sa { color: #ce9178; }    /* Literal String Affix */
html.dark .highlight .sb { color: #ce9178; }    /* Literal String Backtick */
html.dark .highlight .se { color: #ce9178; }    /* Literal String Escape */
html.dark .highlight .sh { color: #ce9178; }    /* Literal String Heredoc */
html.dark .highlight .si { color: #ce9178; }    /* Literal String Interpol */
html.dark .highlight .sr { color: #ce9178; }    /* Literal String Regex */
html.dark .highlight .ss { color: #ce9178; }    /* Literal String Symbol */
html.dark .highlight .sx { color: #ce9178; }    /* Literal String Other */
html.dark .highlight .dl .s { color: #ce9178; } /* Literal String docs */
