/* Uputstva (javni prikaz /help i pregled u Tools / Help).
   Prvi deo je okvir javnog prikaza i važi samo za stranicu sa body.help-site; drugi deo je izgled samog teksta
   uputstva (.help-page i njegove klase, preuzete iz PISWKP-a) i važi svuda gde se tekst prikazuje. */

/* ---------- Okvir javnog prikaza ---------- */
body.help-site {
    margin: 0;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f4f6f9;
}

.help-site .help-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    box-sizing: border-box;
    background: #133e85;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .16);
}

.help-site .help-brand {
    color: #fff;
    font-weight: 700;
    letter-spacing: .06em;
    text-decoration: none;
}

.help-site .help-bar-title {
    font-weight: 500;
    opacity: .9;
}

.help-site .help-menu-btn {
    display: none;
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

    .help-site .help-menu-btn svg {
        width: 24px;
        height: 24px;
        fill: currentColor;
        display: block;
    }

.help-site .help-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    padding-top: 40px;
    min-height: 100vh;
    box-sizing: border-box;
}

.help-site .help-layout-single {
    grid-template-columns: minmax(0, 1fr);
}

/* Drvo uputstava */
.help-site .help-tree {
    position: sticky;
    top: 40px;
    height: calc(100vh - 40px);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 12px 8px 24px;
    background: #fff;
    border-right: 1px solid #dde3ec;
}

    .help-site .help-tree ul {
        list-style: none;
        margin: 0;
        padding: 0 0 0 14px;
    }

        .help-site .help-tree ul:first-child {
            padding-left: 0;
        }

    .help-site .help-tree summary {
        cursor: pointer;
        list-style: none;
    }

        .help-site .help-tree summary::-webkit-details-marker {
            display: none;
        }

    .help-site .help-tree details > summary > .help-link::after {
        content: "";
        margin-left: auto;
        border: solid #8a97ad;
        border-width: 0 2px 2px 0;
        padding: 3px;
        transform: rotate(-45deg);
        transition: transform .12s ease;
    }

    .help-site .help-tree details[open] > summary > .help-link::after {
        transform: rotate(45deg);
    }

.help-site .help-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    margin: 1px 0;
    border-radius: 5px;
    color: #374151;
    text-decoration: none;
}

    .help-site .help-link:hover {
        background: #e8f0ff;
        color: #2f5597;
    }

    .help-site .help-link.current {
        background: #dbeafe;
        color: #1d4ed8;
        font-weight: 600;
    }

.help-site .help-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: currentColor;
    opacity: .8;
}

/* Glavni deo */
.help-site .help-main {
    min-width: 0;
    padding: 18px 20px 40px;
}

/* Tekst uputstva zauzima celu širinu glavnog dela (margine su 20px od .help-main), bez centriranja. */
.help-site .help-main > .help-page,
.help-site .help-crumbs {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.help-site .help-crumbs {
    padding: 0 8px 4px;
    font-size: 13px;
    color: #6b7686;
}

    .help-site .help-crumbs a {
        color: #2f5597;
        text-decoration: none;
    }

        .help-site .help-crumbs a:hover {
            text-decoration: underline;
        }

.help-site .help-crumb-sep {
    margin: 0 6px;
}

.help-site .help-children {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .help-site .help-children a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        margin-bottom: 6px;
        background: #fff;
        border: 1px solid #dde3ec;
        border-radius: 6px;
        color: #2f5597;
        text-decoration: none;
    }

        .help-site .help-children a:hover {
            background: #e8f0ff;
        }

.help-site .help-page a {
    color: #1d4ed8;
}

.help-site .help-page {
    background: #fff;
    border: 1px solid #dde3ec;
    border-radius: 6px;
    padding: 18px 22px 30px;
}

html:has(body.help-site) {
    scroll-behavior: smooth;
}

/* Uski ekran: drvo se otvara dugmem „Sadržaj“ u traci. */
@media (max-width: 900px) {
    .help-site .help-menu-btn {
        display: block;
    }

    .help-site .help-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .help-site .help-tree {
        display: none;
        position: fixed;
        top: 40px;
        left: 0;
        bottom: 0;
        width: min(320px, 86vw);
        height: auto;
        z-index: 15;
        box-shadow: 4px 0 14px rgba(0, 0, 0, .18);
    }

    .help-site.help-tree-open .help-tree {
        display: block;
    }

    .help-site .help-main {
        padding: 12px 20px 32px;
    }
}

/* ---------- Izgled teksta uputstva ---------- */
.help-page {
    font-size: 14px;
    line-height: 1.65;
    color: #333;
}

.help-title {
    color: #2f5597;
    border-bottom: 1px solid #ccc;
    padding-bottom: 6px;
    margin: 0 0 12px;
}

.help-desc {
    color: #555;
    margin-bottom: 20px;
}

.help-section {
    color: #2f5597;
    margin-top: 28px;
    margin-bottom: 8px;
    scroll-margin-top: 56px;
}

.help-subsection {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin-top: 18px;
    margin-bottom: 6px;
}

.help-warning {
    background: #fff8c6;
    border: 1px solid #e0c200;
    padding: 10px;
    margin: 15px 0;
}

.help-info {
    background: #f5f7fb;
    border-left: 4px solid #2f5597;
    padding: 10px;
    margin: 15px 0;
}

.help-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 12px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.help-img-caption {
    font-size: small;
    color: #777;
    margin-top: -6px;
    margin-bottom: 15px;
}

.help-steps {
    margin-top: 10px;
    padding-left: 22px;
}

.help-list {
    padding-left: 22px;
}

.help-note {
    color: #666;
    font-style: italic;
}

.help-page table {
    border-collapse: collapse;
    margin: 12px 0;
}

.help-page th,
.help-page td {
    border: 1px solid #d5dbe6;
    padding: 6px 10px;
    text-align: left;
    vertical-align: top;
}

.help-page th {
    background: #f1f4fa;
}

/* ---------- „Reference“: mini-meni sekcija uputstva (gradi ga help.js) ---------- */
.help-page.help-split {
    display: flex;
    align-items: flex-start;
    gap: 28px;
}

    .help-page.help-split > .help-content {
        flex: 1;
        min-width: 0;
    }

.help-page.help-split > .help-toc {
    order: 2;
}

.help-toc {
    width: 280px;
    flex: 0 0 auto;
    position: sticky;
    top: 56px;
    box-sizing: border-box;
    border-left: 3px solid #2f5597;
    background: #f8fafc;
    padding: 12px 14px;
    border-radius: 6px;
}

    .help-toc:empty {
        display: none;
    }

.help-toc-title {
    font-weight: 700;
    color: #2f5597;
    margin-bottom: 8px;
}

.help-toc a {
    display: block;
    color: #374151;
    text-decoration: none;
    padding: 6px 10px;
    margin: 3px 0;
    border-radius: 5px;
    transition: background-color .15s ease, color .15s ease;
}

    .help-toc a:hover {
        background-color: #e8f0ff;
        color: #2f5597;
    }

    .help-toc a.active {
        background-color: #dbeafe;
        color: #1d4ed8;
        font-weight: 600;
    }

@media (max-width: 1279px) {
    .help-page.help-split {
        display: block;
    }

    .help-toc {
        position: static;
        width: auto;
        margin: 0 0 16px;
    }
}

/* Široke tabele se ne probijaju van teksta: po potrebi se pomeraju vodoravno. */
.help-page .help-content {
    overflow-x: auto;
}

.help-page table {
    width: 100%;
}

/* „Reference“ unutar teksta (uski ekran, ispod naslova): u toku teksta, bez lepljenja uz ivicu. */
.help-content > .help-toc {
    position: static;
    width: auto;
    margin: 0 0 16px;
}
