/* ============================================================
   Odoo Custom Addons — custom theme overrides (readthedocs)
   ============================================================ */

/* ---- Hide default theme footer ---- */
footer xmlRtd { display: none; }
footer { color: transparent; }
footer a { display: none !important; }

/* ---- Base typography ---- */
body,
.rst-content {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 Helvetica, Arial, sans-serif;
    color: #1f2937;
}

/* ============================================================
   Locked state (default): hide the sidebar / navbar, go full width.
   The navbar reappears once the page is decrypted (see bottom).
   ============================================================ */
.wy-nav-side { display: none !important; }

.wy-nav-content-wrap {
    margin-left: 0 !important;
    background: #eef1f5;
}

/* Center the content as a white card */
.wy-nav-content {
    max-width: 1040px;
    margin: 2rem auto;
    padding: 2.5rem 3rem;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 10px 30px rgba(0, 0, 0, .05);
}

/* Hide the prev/next "Next »" buttons entirely (both states).
   The readthedocs theme renders these in TWO places: the in-content
   footer buttons AND the dark fixed bottom-left ".rst-versions" flyout. */
.rst-footer-buttons,
.rst-versions { display: none !important; }

/* Locked state: also hide breadcrumbs (they return after unlock) */
.wy-breadcrumbs { display: none !important; }

/* ============================================================
   Unlocked state — bring the navbar back after decryption.
   extra.js adds `decrypted` to <body> when the content is unlocked.
   ============================================================ */
body.decrypted .wy-nav-side { display: block !important; }
body.decrypted .wy-nav-content-wrap { margin-left: 300px !important; }
body.decrypted .wy-breadcrumbs { display: block !important; }

/* ---- Sidebar (navbar) colours: match the dark top header ---- */
.wy-nav-side {
    background: linear-gradient(180deg, #111827, #334155);
}
.wy-side-nav-search {
    background: transparent;
}
.wy-side-nav-search > a,
.wy-side-nav-search > a:hover { color: #ffffff; }
.wy-menu-vertical a { color: #e2e8f0; }
.wy-menu-vertical a:hover { background: #334155; color: #ffffff; }
.wy-menu-vertical li.current { background: #0b1220; }
.wy-menu-vertical li.current > a {
    background: #0b1220;
    color: #ffffff;
    border-color: #0b1220;
}
.wy-menu-vertical li.current a:hover { background: #1e293b; color: #ffffff; }
.wy-menu-vertical li.toctree-l1.current > a {
    border-top: none;
    border-bottom: none;
}

/* ============================================================
   Top header bar (reuse the theme's mobile top bar on all sizes)
   ============================================================ */
.wy-nav-top {
    display: block !important;
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 16px 28px;
    text-align: left;
    background: linear-gradient(90deg, #111827, #334155);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.wy-nav-top a {
    color: #ffffff !important;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: .3px;
}
.wy-nav-top i { display: none !important; }   /* hide hamburger icon */

/* ============================================================
   Headings & links
   ============================================================ */
.rst-content h1,
.rst-content h2,
.rst-content h3 { color: #111827; font-weight: 700; }

.rst-content h1 {
    border-bottom: 3px solid #2563eb;
    padding-bottom: .35em;
    margin-bottom: 1.2rem;
}
.rst-content a { color: #2563eb; }
.rst-content a:hover { color: #1d4ed8; text-decoration: underline; }

.rst-content ul li { line-height: 1.9; }

/* ============================================================
   Tables
   ============================================================ */
.rst-content table.docutils,
.rst-content table {
    width: 100%;
    display: table;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
    margin: 1.2rem 0;
}
.rst-content table th {
    background: #1e293b;
    color: #ffffff;
    font-weight: 600;
    text-align: left;
    padding: 13px 16px;
    border: none;
}
.rst-content table td {
    padding: 12px 16px;
    border: none;
    border-top: 1px solid #eef2f7;
    white-space: normal;
    vertical-align: top;
}
.rst-content table tbody tr:nth-child(odd) { background: #f8fafc; }
.rst-content table tbody tr:hover { background: #eef4ff; }

/* Technical-name code chips */
.rst-content table td code {
    white-space: nowrap;
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #e0e7ff;
    border-radius: 6px;
    padding: 2px 7px;
    font-size: .85em;
}

/* ============================================================
   Password / unlock form (mkdocs-encryptcontent)
   ============================================================ */
#mkdocs-decrypt-form {
    max-width: 420px;
    margin: 3rem auto 1rem;
    padding: 2rem 2rem 1.5rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, .10);
    text-align: center;
}
#mkdocs-content-password {
    width: 100%;
    padding: 12px 14px;
    margin: .5rem 0 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font-size: 1rem;
    box-sizing: border-box;
}
#mkdocs-content-password:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}
#mkdocs-decrypt-button {
    width: 100%;
    padding: 11px 18px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 9px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}
#mkdocs-decrypt-button:hover { background: #1d4ed8; }
#mkdocs-decrypt-msg { color: #dc2626; margin-top: .75rem; min-height: 1.2em; }
