/* Wafer.space Custom Sphinx Theme */

/* CSS Variables based on wafer.space theme */
:root {
    --color-primary: #58b39a;
    --color-primary-rgb: 88, 179, 154;
    --color-secondary: #606060;
    --color-background: #f9fafb;
    --color-white: #ffffff;
    --color-text: #606060;
    --color-text-dark: #303030;
    --color-text-light: #808080;
    --font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.4;
    --border-radius: 0.375rem;
    --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Reset and Base Styles */
*,
*:before,
*:after {
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
}

body {
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: var(--line-height-base);
    color: var(--color-text);
    background-color: var(--color-background);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family);
    font-weight: 600;
    color: var(--color-text-dark);
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

a:hover {
    color: rgba(var(--color-primary-rgb), 0.8);
    text-decoration: underline;
}

/* Main Layout */
.document {
    background: var(--color-white);
    margin: 0;
    min-height: 100vh;
}

.documentwrapper {
    float: left;
    width: 100%;
}

.bodywrapper {
    margin: 0;
}

.body {
    min-height: 100vh;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header/Navigation */
.related {
    background: var(--color-white);
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
    font-size: 0.875rem;
}

.related ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.related li {
    margin: 0;
}

.related a {
    color: var(--color-text);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: all 0.15s ease-in-out;
}

.related a:hover {
    background: rgba(var(--color-primary-rgb), 0.1);
    text-decoration: none;
}

/* Sidebar */
.sphinxsidebar {
    float: right;
    width: 300px;
    margin-left: -300px;
    padding: 2rem 1rem;
    background: var(--color-white);
    border-left: 1px solid #e9ecef;
    font-size: 0.875rem;
}

.sphinxsidebarwrapper {
    padding: 0;
}

.sphinxsidebar h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary);
}

.sphinxsidebar ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.sphinxsidebar li {
    margin: 0.25rem 0;
}

.sphinxsidebar a {
    color: var(--color-text);
    display: block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.15s ease-in-out;
}

.sphinxsidebar a:hover {
    background: rgba(var(--color-primary-rgb), 0.1);
    text-decoration: none;
}

.sphinxsidebar .current > a {
    background: var(--color-primary);
    color: var(--color-white);
}

/* Tables of Contents */
.toctree-wrapper {
    margin: 2rem 0;
}

.toctree-wrapper p.caption {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--color-text-dark);
    margin-bottom: 1rem;
}

.toctree-wrapper ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toctree-wrapper li {
    margin: 0.5rem 0;
    padding-left: 1rem;
    border-left: 2px solid #e9ecef;
}

.toctree-wrapper a {
    font-weight: 500;
    padding: 0.25rem 0;
    display: block;
}

/* Code Blocks */
.highlight {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    overflow-x: auto;
}

.highlight pre {
    margin: 0;
    padding: 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

code {
    background: #f8f9fa;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: var(--color-text-dark);
}

pre code {
    background: transparent;
    padding: 0;
}

/* Admonitions (Warnings, Notes, etc.) */
.admonition {
    margin: 1.5rem 0;
    padding: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.05);
}

.admonition .admonition-title {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.admonition.warning {
    border-left-color: #ffc107;
    background: rgba(255, 193, 7, 0.05);
}

.admonition.warning .admonition-title {
    color: #ffc107;
}

.admonition.danger,
.admonition.error {
    border-left-color: #dc3545;
    background: rgba(220, 53, 69, 0.05);
}

.admonition.danger .admonition-title,
.admonition.error .admonition-title {
    color: #dc3545;
}

/* Footer */
.footer {
    background: var(--color-white);
    border-top: 1px solid #e9ecef;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.875rem;
}

/* Announcement Banner */
.announcement {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 1rem;
    text-align: center;
    font-weight: 500;
    margin-bottom: 0;
}

/* Focus Indicators for Accessibility */
a:focus,
input:focus,
button:focus,
.sphinxsidebar a:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Search */
#searchbox {
    margin-bottom: 1.5rem;
}

#searchbox input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

#searchbox input[type="submit"] {
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.15s ease-in-out;
}

#searchbox input[type="submit"]:hover {
    background: rgba(var(--color-primary-rgb), 0.8);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sphinxsidebar {
        float: none;
        width: 100%;
        margin-left: 0;
        border-left: none;
        border-top: 1px solid #e9ecef;
        order: 2;
    }

    .bodywrapper {
        margin-right: 0;
    }

    .body {
        padding: 1rem;
    }

    .related ul {
        padding: 0 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .body {
        padding: 0.5rem;
    }
    
    .related ul {
        padding: 0 0.5rem;
    }
}