/* ═══ User manual (Priručnik) — Components/Manual/UserManualPanel.razor, UserManualButton.razor ═══
   Everything is prefixed um-. A panel on the right that leaves the page usable: 480px for a chapter, 760px for the
   contents and the search results; full screen on a phone (same 768px breakpoint as custom.js isMobile).
   Blazorise renders Button as .btn and TextEdit as .form-control, so those rules are overridden here. */

/* ── Panel shell ── */
.um-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1045; /* above the page and NavMenu, below modals (1050+) */
    width: 480px;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-left: 1px solid var(--rule-row);
    box-shadow: -14px 0 36px rgba(15, 23, 42, .16);
    color: var(--ink);
    outline: none;
}
.um-panel-wide { width: 760px; }

.um-panel .btn {
    display: inline-flex;
    align-items: center;
    border: 0;
    box-shadow: none;
    line-height: 1.25;
}
.um-panel .btn:focus { box-shadow: none; }
.um-panel .btn:focus-visible,
.um-panel .um-link:focus-visible,
.um-fab.btn:focus-visible {
    outline: 3px solid rgba(0, 57, 81, .35);
    outline-offset: 2px;
}

/* ── Head ── */
.um-head {
    flex: none;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 0 22px;
    border-bottom: 1px solid #eef1f5;
}
.um-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 21px;
    font-weight: 700;
    color: var(--teal);
}
.um-panel .um-x.btn {
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 10px;
    background: var(--surface-4);
    color: var(--ink-3);
    font-size: 18px;
}
.um-panel .um-x.btn:hover { background: var(--rule-row); color: var(--ink); }
.um-panel .um-close.btn { display: none; }

.um-language {
    flex: none;
    margin: 10px 22px 0;
    padding: 8px 12px;
    border-radius: 8px;
    background: #fff3e8;
    color: var(--accent-ink);
    font-size: 14px;
    line-height: 1.4;
}

/* ── Search field ── */
.um-search { flex: none; padding: 10px 22px 8px; }
.um-field { position: relative; }
.um-field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-5);
    pointer-events: none;
}
.um-panel .um-input.form-control {
    height: 44px;
    padding: 0 44px 0 40px;
    border: 1px solid var(--rule-head);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font-size: 16px;
}
.um-panel .um-input.form-control::placeholder { color: var(--ink-6); }
.um-panel .um-input.form-control:focus,
.um-field-filled .um-input.form-control {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0, 57, 81, .1);
}
.um-input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.um-panel .um-clear.btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-5);
}
.um-panel .um-clear.btn:hover { background: var(--surface-4); color: var(--ink); }

/* ── "‹ Sadržaj" and the open chapter ── */
.um-crumb {
    flex: none;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 4px 22px 10px;
    border-bottom: 1px solid #eef1f5;
}
.um-panel .um-back.btn {
    flex: none;
    gap: 6px;
    padding: 8px 12px 8px 8px;
    border-radius: 8px;
    background: var(--surface-4);
    color: var(--teal);
    font-size: 16px;
    font-weight: 700;
}
.um-panel .um-back.btn:hover { background: var(--rule-row); }
.um-chapter {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--ink-5);
    font-size: 15px;
    font-weight: 600;
}

/* ── Scrolling body ── */
.um-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 22px 28px;
    font-size: 16px;
    line-height: 1.55;
}
.um-label {
    margin: 2px 0 6px;
    color: #59697a;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.um-label-contents { margin-top: 18px; }
.um-message { padding: 10px 0; color: var(--ink-3); }

/* ── Chapter text (Markdig output; images and raw HTML never reach it) ── */
.um-text { overflow-wrap: anywhere; }
.um-text h1 { margin: 0 0 12px; font-size: 26px; line-height: 1.2; font-weight: 700; color: var(--teal); }
.um-text h2 { margin: 22px 0 10px; font-size: 23px; line-height: 1.25; font-weight: 700; color: var(--teal); }
.um-text h3 { margin: 18px 0 8px; font-size: 18px; line-height: 1.3; font-weight: 700; color: #12314c; }
.um-text h4 { margin: 14px 0 6px; font-size: 17px; line-height: 1.35; font-weight: 700; color: #12314c; }
/* The heading the panel opened on (user-manual.js scrollTo), in the size of a section title whatever its level. */
.um-text .um-opened { margin-top: 0; font-size: 23px; line-height: 1.25; color: var(--teal); }
.um-text p { margin: 0 0 10px; }
.um-text strong { font-weight: 700; color: #0f2a3d; }
.um-text a,
.um-text .um-link {
    color: #c2620f;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.um-text a:hover,
.um-text .um-link:hover { color: #9a4c08; }
.um-text ul { margin: 0 0 10px; padding-left: 22px; }
.um-text ul li { margin-bottom: 5px; }
.um-text ol { margin: 0 0 10px; padding: 0; list-style: none; counter-reset: um-step; }
.um-text ol > li { position: relative; min-height: 28px; margin-bottom: 9px; padding-left: 40px; counter-increment: um-step; }
.um-text ol > li::before {
    content: counter(um-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}
.um-text li > ul,
.um-text li > ol { margin-top: 5px; }
.um-text blockquote {
    margin: 0 0 12px;
    padding: 8px 12px;
    border-left: 3px solid #f5821f;
    border-radius: 0 8px 8px 0;
    background: #fff3e8;
}
.um-text blockquote p:last-child { margin-bottom: 0; }
.um-text code {
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--surface-4);
    color: var(--ink-2);
    font-size: .92em;
}
.um-text hr { margin: 18px 0; border: 0; border-top: 1px solid #eef1f5; }
.um-text table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    margin: 0 0 12px;
    border-collapse: collapse;
    font-size: 14.5px;
    line-height: 1.4;
}
.um-text th,
.um-text td { padding: 6px 10px; border: 1px solid var(--rule-row); vertical-align: top; text-align: left; }
.um-text th { background: var(--surface-3); color: var(--ink-3); font-weight: 700; }

/* ── Search hits ── */
.um-panel .um-hit.btn {
    display: block;
    width: 100%;
    margin-bottom: 4px;
    padding: 5px 14px;
    border: 1px solid var(--rule-row);
    border-radius: 10px;
    background: var(--surface);
    text-align: left;
    white-space: normal;
    line-height: 1.35;
}
.um-panel .um-hit.btn:hover { border-color: var(--teal); background: var(--surface-3); }
.um-hit-title,
.um-hit-text { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.um-hit-title { color: var(--teal); font-size: 16px; font-weight: 700; }
.um-hit-text { color: var(--ink-2); font-size: 15.5px; }
.um-panel mark {
    padding: 0;
    background: #fff3e8;
    color: inherit;
    text-decoration: underline;
    text-decoration-color: #f5821f;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

/* ── Contents (Sadržaj) ── */
.um-toc { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin-top: 6px; }
.um-panel .um-tile.btn {
    gap: 10px;
    min-height: 38px;
    padding: 1px 10px;
    border: 1px solid var(--rule-row);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.12;
    text-align: left;
    white-space: normal;
}
.um-panel .um-tile.btn:hover { border-color: var(--teal); background: var(--surface-3); }
.um-tile-number {
    flex: none;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e6eaf0;
    border-radius: 8px;
    background: #eef2f8;
    color: #2f4d6b;
    font-size: 13.5px;
    font-weight: 700;
}
.um-panel .um-tile-current.btn { background: #fff3e8; border-color: rgba(245, 130, 31, .45); }
.um-tile-current .um-tile-number { background: rgba(245, 130, 31, .15); border-color: rgba(245, 130, 31, .3); color: #e0730f; }

/* ── The "Priručnik" button bottom right on the sign-in pages ── */
.um-fab.btn {
    position: fixed;
    right: 20px;
    bottom: 75px;
    z-index: 1040;
    height: 54px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 20px 0 16px;
    border: 2px solid var(--teal);
    border-radius: 999px;
    background: var(--surface);
    color: var(--teal);
    font-size: 17px;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}
.um-fab.btn:hover { background: var(--surface-4); color: var(--teal); }
.um-fab.btn:focus { box-shadow: 0 4px 16px rgba(0, 0, 0, .2); }

/* ── Phone: full screen, a big "✕ Zatvori" instead of the small ✕ ── */
@media (max-width: 768px) {
    .um-panel,
    .um-panel-wide { left: 0; width: 100%; border-left: 0; box-shadow: none; }
    .um-head { height: 68px; padding: 0 12px 0 16px; }
    .um-panel .um-x.btn { display: none; }
    .um-panel .um-close.btn {
        display: inline-flex;
        gap: 7px;
        height: 48px;
        padding: 0 16px 0 12px;
        border-radius: 10px;
        background: var(--teal);
        color: #fff;
        font-size: 17px;
        font-weight: 700;
    }
    .um-language { margin: 10px 16px 0; }
    .um-search { padding: 12px 16px 8px; }
    .um-panel .um-input.form-control { height: 48px; font-size: 17px; }
    .um-field-icon { width: 19px; height: 19px; }
    .um-crumb { gap: 12px; padding: 4px 16px 10px; }
    .um-panel .um-back.btn { height: 44px; padding: 0 12px 0 8px; font-size: 17px; }
    .um-body { padding: 14px 18px 28px; font-size: 17px; }
    .um-text h1 { font-size: 26px; }
    .um-text h2 { font-size: 24px; }
    .um-text h3 { font-size: 19px; }
    .um-text h4 { font-size: 18px; }
    .um-text .um-opened { font-size: 24px; }
    .um-toc { grid-template-columns: 1fr; }
}

/* Phone, tablet and a low desktop screen: the sign-in card reaches the bottom right corner (Login at 769-1024px x
   768px, and on a desktop screen 1025-1327px wide up to 867px high, where Login's centred 610px card ends below the
   button's top, 75px + 54px above the bottom; ForgotPassword at 769px; a page taller than the screen, as Register on a
   phone, scrolls under it), so a floating button would cover the form. It sits at the bottom right of the page
   instead: the sign-in pages put it inside their root (position: relative) and keep room for it under the content. A
   page can move it with --um-fab-bottom (default: the mockup's 75px, above Login's footer). */
@media (max-width: 1024px), (min-width: 1025px) and (max-height: 867px) {
    .um-fab.btn { position: absolute; bottom: var(--um-fab-bottom, 75px); }
}
