/* Custom CSS for Preads Platform Documentation */

/* Brand Colors */
/* Brand Colors for ReadTheDocs Theme */
@import url('https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700&display=swap');

:root {
    --primary-color: #667eea;
    --accent-color: #764ba2;
}

/* Force Google Fonts over missing local theme fonts */
body, .wy-body-for-nav {
    font-family: "Lato", "proxima-nova", "Helvetica Neue", Arial, sans-serif !important;
}

h1, h2, h3, h4, h5, h6, .rst-content .toctree-wrapper p.caption, legend {
    font-family: "Roboto Slab", "ff-tisa-web-pro", "Georgia", Arial, sans-serif !important;
}

pre, code, .rst-content tt, .rst-content code, kbd, samp {
    font-family: "Inconsolata", "Consolas", "Andale Mono", monospace !important;
}

/* Fix for large twemoji icons in non-material themes */
.twemoji {
    display: inline-block;
}
.twemoji svg {
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
    fill: currentColor;
}

.twemoji.lg svg {
    width: 2.5em;
    height: 2.5em;
}

/* Custom Buttons */
/* Grid Cards - Generic targeting for RTD compatibility */
.grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.grid > ul {
    display: contents;
}

.grid > ul > li,
.grid.cards > * {
    list-style: none;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 1.5rem;
    flex: 1 1 250px;
    transition: all 0.3s ease;
    background: #fff;
}

.grid > ul > li:hover,
.grid.cards > *:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: #667eea;
}

/* Professional Button Styles */
.md-button,
.btn-neutral,
a.md-button,
.rst-footer-buttons a,
.rst-current-version span a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-radius: 50px; /* Modern pill shape */
    background: #404040; /* Sophisticated indigo gradient */
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 400;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    border: none;
    /* box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); */
    /* transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); */
    cursor: pointer;
}

/* Secondary/Navigation Button specific overrides if needed */
.rst-footer-buttons a {
    background: #f1f5f9;
    color: #475569 !important;
    border: 1px solid #e2e8f0;
    box-shadow: none;
}

.rst-footer-buttons a:hover {
    background: #e2e8f0;
    color: #1e293b !important;
    transform: translateY(-1px);
}

/* Primary Button Hover */
.md-button:hover,
a.md-button:hover,
.btn-neutral:hover {
    /* transform: translateY(-2px); */
    /* box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4), 0 4px 6px -2px rgba(99, 102, 241, 0.1); */
    background: #333;
    color: #ffffff !important;
}

/* Footer Version Navigation Links */
.rst-current-version span a {
    padding: 6px 14px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mermaid Diagrams */
.mermaid {
    text-align: center;
    margin: 2rem 0;
}

/* Custom Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Print Styles */
@media print {
    .md-header,
    .md-sidebar,
    .md-footer {
        display: none;
    }

    .md-content {
        max-width: 100%;
    }
}

.wy-nav-content {
    padding: 1.618em 3.236em;
    height: 100%;
    max-width: 100%;
    margin: auto;
}

/* Fix for unstyled/broken tabs (pymdownx.tabbed) */
.tabbed-set {
    display: flex;
    flex-wrap: wrap;
    margin: 1em 0;
    position: relative;
    border: 1px solid #e1e4e6;
    border-radius: 4px;
    overflow: hidden;
}

.tabbed-set > input {
    display: none;
}

.tabbed-labels {
    display: flex;
    width: 100%;
    border-bottom: 2px solid #e1e4e6;
    background: #f8f9fb;
}

.tabbed-labels label {
    padding: 12px 24px;
    cursor: pointer;
    font-weight: 600;
    color: #777;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease-in-out;
}

.tabbed-labels label:hover {
    color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.05);
}

.tabbed-content {
    width: 100%;
    background: #fff;
}

.tabbed-block {
    display: none;
    padding: 20px;
}

/* Visibility logic for tabs */
.tabbed-set input:nth-child(1):checked ~ .tabbed-labels label:nth-child(1),
.tabbed-set input:nth-child(2):checked ~ .tabbed-labels label:nth-child(2),
.tabbed-set input:nth-child(3):checked ~ .tabbed-labels label:nth-child(3),
.tabbed-set input:nth-child(4):checked ~ .tabbed-labels label:nth-child(4),
.tabbed-set input:nth-child(5):checked ~ .tabbed-labels label:nth-child(5),
.tabbed-set input:nth-child(6):checked ~ .tabbed-labels label:nth-child(6) {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: #fff;
}

.tabbed-set input:nth-child(1):checked ~ .tabbed-content .tabbed-block:nth-child(1),
.tabbed-set input:nth-child(2):checked ~ .tabbed-content .tabbed-block:nth-child(2),
.tabbed-set input:nth-child(3):checked ~ .tabbed-content .tabbed-block:nth-child(3),
.tabbed-set input:nth-child(4):checked ~ .tabbed-content .tabbed-block:nth-child(4),
.tabbed-set input:nth-child(5):checked ~ .tabbed-content .tabbed-block:nth-child(5),
.tabbed-set input:nth-child(6):checked ~ .tabbed-content .tabbed-block:nth-child(6) {
    display: block;
    animation: fadeInTab 0.3s ease-in-out;
}

@keyframes fadeInTab {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media screen and (max-width: 768px) {
    .tabbed-labels {
        flex-direction: column;
    }
    .tabbed-labels label {
        border-bottom: 1px solid #e1e4e6;
        border-left: 3px solid transparent;
    }
    .tabbed-set input:nth-child(1):checked ~ .tabbed-labels label:nth-child(1),
    .tabbed-set input:nth-child(2):checked ~ .tabbed-labels label:nth-child(2),
    .tabbed-set input:nth-child(3):checked ~ .tabbed-labels label:nth-child(3) {
        border-bottom-color: #e1e4e6;
        border-left-color: var(--primary-color);
    }
}

/* Fix for unstyled task lists (checklists) */
ul.task-list {
    list-style-type: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

li.task-list-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.8em;
    position: relative;
    padding-left: 0;
}

.task-list-control {
    display: inline-flex;
    align-items: center;
    margin-right: 12px;
    cursor: default;
    padding-top: 4px; /* Align with text baseline */
}

.task-list-control input {
    display: none; /* Hide real checkbox */
}

/* Custom Checkbox Indicator */
.task-list-indicator {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    background-color: #fff;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Style for checked state */
li.task-list-item input:checked + .task-list-indicator {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

li.task-list-item input:checked + .task-list-indicator::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Base list styling improvements for RTD theme */
.rst-content ul:not(.task-list), 
.rst-content ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
}

.rst-content li > p {
    margin-bottom: 0.5em;
}

.rst-content li {
    margin-bottom: 0.4em;
    line-height: 1.6;
}

/* Professional Sidebar (Aside) Redesign */
.wy-nav-side {
    background: #404040 !important;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

.wy-side-nav-search {
    background-color: #333 !important;
    padding: 2rem 1.5rem;
}

.wy-side-nav-search > a {
    color: #fff !important;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.wy-side-nav-search input[type="text"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
    color: #fff;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.wy-side-nav-search input[type="text"]:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Sidebar Menu UX */
.wy-menu-vertical li.current > a, .wy-menu-vertical li.on > a {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
    border-left: 4px solid #000;
    font-weight: 700;
}

.wy-menu-vertical a {
    color: rgba(255, 255, 255, 0.6) !important;
    padding: 12px 20px !important;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.wy-menu-vertical a:hover {
    background: rgba(255, 255, 255, 0.03) !important;
    color: #fff !important;
}

.wy-menu-vertical p.caption {
    color: rgba(255, 255, 255, 0.3) !important;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 800;
    margin-top: 2rem;
    padding: 0 20px 8px !important;
}

/* Professional Footer Polish */
footer {
    border-top: 1px solid #e2e8f0;
    margin-top: 4rem;
    padding-top: 2rem;
    text-align: center;
}

footer hr {
    display: none;
}

footer [role="contentinfo"] {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.7;
}

footer [role="contentinfo"] a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

footer [role="contentinfo"] a:hover {
    text-decoration: underline;
}

/* General Layout UX */
.wy-nav-content-wrap {
    background: #f8fafc;
}

.wy-nav-content {
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    margin: 2rem auto !important;
    max-width: 1000px !important;
}

.wy-menu-vertical ul.navtree.subnav-l1 ul.subnav-l2, .wy-menu-vertical ul.navtree.subnav-l1 li.toctree-l2.current li.toctree-l3 > a {
    background: #333;
}

.wy-menu-vertical .navtree li.toctree-l2.current > a, .wy-menu-vertical .navtree li.toctree-l2.current > span {
    color: #dadde7 !important;
}

.wy-menu-vertical .navtree li.toctree-l2.current, .wy-menu-vertical .navtree li.toctree-l2.current > a {
    background: #161616;
}
.wy-nav-top {
    background: #333;
    color: #fff;
}

li.current.with-children a {
    background: #404040 !important;
}

.wy-menu-vertical ul.navtree.subnav-l1 li.toctree-l2.current li.toctree-l3 > a:hover, .wy-menu-vertical ul.subnav-l1 li.toctree-l2.current li.toctree-l3 > a:hover, .wy-menu-vertical ul.navtree.subnav-l1 li.toctree-l2.current li.toctree-l3.current > a:hover, .wy-menu-vertical ul.tocbase li.toctree-l4 > a:hover, .wy-menu-vertical ul.tocbase li.toctree-l4 > a:hover, .wy-menu-vertical ul.tocbase li.toctree-l5 > a:hover, .wy-menu-vertical ul.tocbase li.toctree-l6 > a:hover, .wy-menu-vertical ul.tocbase li.toctree-l7 > a:hover {
    background: #999 !important;
}

.wy-menu-vertical ul.navtree.subnav-l1 li.toctree-l2.current li.toctree-l3.current > a, .wy-menu-vertical ul.navtree.subnav-l1 li.toctree-l3.current li.toctree-l4 > a {
    background: #333030;
}

/* Sidebar Navigation Cleanup - Hide internal page sections */
/* We exclusively show items labeled as 'navtree' (MkDocs primary nav) */
.wy-menu-vertical li[class*="toctree-l"]:not(.navtree) {
    display: none !important;
}

/* Hide any redundant anchor links in the sidebar to keep it focused strictly on pages */
.wy-menu-vertical a[href*="#"] {
    display: none !important;
}