/**
 * Critical fixes for Memories-Dev Documentation
 * This file consolidates all necessary styles to fix UI/UX issues
 */

/* Fix whitespace issues */
.wy-nav-content {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 2em 3em !important;
}

.wy-nav-content-wrap {
    background: #fcfcfc !important;
    margin-left: 300px !important;
}

.wy-nav-side {
    width: 300px !important;
    left: 0 !important;
    background-color: #1a2638 !important;
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
    .wy-nav-content-wrap {
        margin-left: 0 !important;
    }
    
    .wy-nav-side {
        width: 300px !important;
        left: -300px !important;
    }
    
    .wy-nav-side.shift {
        width: 85% !important;
        left: 0 !important;
    }
    
    .wy-nav-content {
        padding: 1.5em !important;
    }
    
    /* Fix headings on mobile */
    h1 {
        font-size: 1.8em !important;
        margin-top: 0.7em !important;
        margin-bottom: 0.7em !important;
    }
    
    h2 {
        font-size: 1.5em !important;
        margin-top: 1.2em !important;
        margin-bottom: 0.6em !important;
    }
    
    h3 {
        font-size: 1.2em !important;
        margin-top: 1em !important;
        margin-bottom: 0.5em !important;
    }
}

/* Fix Mermaid diagrams */
.mermaid {
    display: block !important;
    margin: 2rem auto !important;
    text-align: center !important;
    background-color: white !important;
    padding: 1rem !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
    max-width: 100% !important;
    overflow-x: auto !important;
}

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

/* Typography */
body, .wy-body-for-nav, p, li, div {
    font-family: "Georgia", serif !important;
    font-size: 16px !important;
    line-height: 1.65 !important;
    color: #333 !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Georgia", serif !important;
    color: #2c3e50 !important;
    margin-top: 1.3em !important;
    margin-bottom: 0.5em !important;
    font-weight: normal !important;
    line-height: 1.3 !important;
}

h1 {
    font-size: 2.2em !important;
    border-bottom: 1px solid #eee !important;
    padding-bottom: 0.3em !important;
}

h2 {
    font-size: 1.8em !important;
    border-bottom: 1px solid #f3f3f3 !important;
    padding-bottom: 0.2em !important;
}

h3 {
    font-size: 1.5em !important;
}

/* Remove the first letter styling which is causing issues */
.section > p:first-of-type::first-letter {
    font-size: inherit !important;
    line-height: inherit !important;
    font-weight: inherit !important;
    float: none !important;
    margin-right: 0 !important;
    color: inherit !important;
}

/* Fix math rendering */
.math {
    display: block !important;
    margin: 1em 0 !important;
    padding: 1em !important;
    background-color: #f9f9f9 !important;
    border-radius: 5px !important;
    border: 1px solid #e1e1e1 !important;
    overflow-x: auto !important;
    text-align: center !important;
}

span.math {
    display: inline-block !important;
    margin: 0 0.2em !important;
    padding: 0.1em 0.3em !important;
    background-color: transparent !important;
    border: none !important;
}

/* Fix table styling */
table.docutils {
    width: 100% !important;
    margin-bottom: 1.5em !important;
    border-collapse: collapse !important;
    border: 1px solid #e1e1e1 !important;
}

table.docutils th {
    background-color: #f5f5f5 !important;
    color: #333 !important;
    font-weight: bold !important;
    padding: 0.5em 0.7em !important;
    border: 1px solid #e1e1e1 !important;
    text-align: left !important;
}

table.docutils td {
    padding: 0.5em 0.7em !important;
    border: 1px solid #e1e1e1 !important;
    vertical-align: top !important;
}

/* Fix admonition styling */
.admonition {
    margin: 1.5em 0 !important;
    padding: 0 !important;
    border-radius: 5px !important;
    border-left: 5px solid #3498db !important;
    background-color: #f8f8f8 !important;
    overflow: hidden !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.admonition-title {
    background-color: #3498db !important;
    color: white !important;
    font-weight: bold !important;
    padding: 0.5em 1em !important;
    margin: 0 !important;
}

.admonition .last {
    padding: 1em !important;
}

.note {
    border-left-color: #3498db !important;
}

.note .admonition-title {
    background-color: #3498db !important;
}

.warning {
    border-left-color: #e74c3c !important;
}

.warning .admonition-title {
    background-color: #e74c3c !important;
}

/* Fix code blocks */
pre {
    padding: 1em !important;
    background: #f8f8f8 !important;
    border: 1px solid #e1e4e5 !important;
    border-radius: 3px !important;
    overflow-x: auto !important;
    font-size: 0.9em !important;
    line-height: 1.5 !important;
}

code {
    background: #f8f8f8 !important;
    padding: 0.2em 0.4em !important;
    border-radius: 3px !important;
    font-size: 0.9em !important;
    border: 1px solid #e1e4e5 !important;
}

/* Fix sidebar styling */
.wy-menu-vertical a {
    padding-top: 0.5em !important;
    padding-bottom: 0.5em !important;
    font-size: 0.95em !important;
    color: #d9d9d9 !important;
}

.wy-menu-vertical a:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.wy-menu-vertical li.current > a {
    background-color: rgba(0, 0, 0, 0.15) !important;
    color: #ffffff !important;
}

.wy-menu-vertical p.caption {
    margin-top: 0.5em !important;
    color: #55a5d9 !important;
    font-weight: bold !important;
}

.wy-side-nav-search {
    background-color: #1a2638 !important;
}

.wy-side-nav-search > a img.logo {
    max-width: 100% !important;
    max-height: 100px !important;
    height: auto !important;
    width: auto !important;
    display: block !important;
    margin: 0 auto 0.5em !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
}

.wy-side-nav-search input[type="text"] {
    border-radius: 4px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

/* Fix TOC styling */
.toctree-wrapper ul {
    margin-left: 1.5em !important;
    line-height: 1.5 !important;
}

.toctree-wrapper li {
    margin-bottom: 0.3em !important;
}

/* Fix breadcrumbs */
.wy-breadcrumbs {
    margin-bottom: 1.5em !important;
    font-size: 0.9em !important;
}

/* Fix footer */
footer {
    margin-top: 2em !important;
    padding-top: 1em !important;
    border-top: 1px solid #e1e4e5 !important;
    color: #888 !important;
    font-size: 0.9em !important;
}

/* Fix navigation buttons */
.rst-footer-buttons {
    margin-top: 2em !important;
}

.rst-footer-buttons .btn {
    padding: 0.5em 1em !important;
    font-size: 0.9em !important;
    border-radius: 4px !important;
}

/* Print styles */
@media print {
    .wy-nav-content {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }
    
    .wy-nav-side, .wy-side-nav-search, .wy-side-scroll, .rst-versions {
        display: none !important;
    }
    
    .wy-nav-content-wrap {
        margin-left: 0 !important;
        background: white !important;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid !important;
    }
    
    p, blockquote, table, pre, figure {
        page-break-inside: avoid !important;
    }
    
    a {
        text-decoration: none !important;
        color: #000 !important;
    }
} 