﻿/* User manual (Pages/Handleiding.razor) */

/* App bar in the theme color, with the search field in the middle. The SCS theme has a 40px app bar
   (AppTheme.BarHeight); the manual uses a higher bar, so the drawer and the content start below it. */
.manual {
    --manual-bar-height: 64px;
}

.manual .mud-drawer.mud-drawer-clipped-always {
    top: var(--manual-bar-height);
    height: calc(100% - var(--manual-bar-height));
}

.manual .mud-main-content {
    padding-top: var(--manual-bar-height);
}

.manual .manual-appbar {
    height: var(--manual-bar-height);
    background: var(--mud-palette-appbar-background);
    color: var(--mud-palette-appbar-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
}

.manual .manual-appbar .mud-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 640px) minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    height: var(--manual-bar-height);
}

.manual-appbar-start {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.manual-brand {
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.manual-brand-text {
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
}

.manual-brand-text strong {
    font-weight: 700;
}

/* Search field: white on the colored bar (dark surface in dark mode) */
.manual-search-wrap {
    width: 100%;
}

.manual-searchbox {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 8px 0 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid transparent;
    color: var(--mud-palette-text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.manual-searchbox:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.manual-searchbox:focus-within {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35), 0 4px 14px rgba(0, 0, 0, 0.2);
}

.manual-search-icon {
    color: var(--mud-palette-text-secondary);
    flex: 0 0 auto;
}

.manual-searchbox input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.95rem;
}

.manual-searchbox input::placeholder {
    color: var(--mud-palette-text-secondary);
    opacity: 1;
}

.manual-search-kbd {
    flex: 0 0 auto;
    font-family: inherit;
    font-size: 0.72rem;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 6px;
    border: 1px solid var(--mud-palette-lines-default);
    background: transparent;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.manual-dark .manual-searchbox {
    background: var(--mud-palette-surface);
}

.manual-search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.manual-search-clear:hover {
    background: rgba(127, 127, 127, 0.2);
}

.manual-nav .mud-nav-link-text {
    white-space: normal;
}

.manual-main {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    padding: 24px 32px 64px 32px;
}

.manual-article {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 860px;
}

.manual-muted {
    color: var(--mud-palette-text-secondary);
}

/* Breadcrumb */
.manual-breadcrumb {
    display: flex;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 8px;
}

.manual-breadcrumb a {
    color: var(--mud-palette-primary);
    text-decoration: none;
}

/* Content from Markdown */
.manual-content {
    font-size: 0.975rem;
    line-height: 1.65;
    color: var(--mud-palette-text-primary);
}

.manual-content h1 {
    font-size: 2rem;
    font-weight: 500;
    margin: 0 0 16px 0;
}

.manual-content h2 {
    font-size: 1.4rem;
    font-weight: 500;
    margin: 32px 0 10px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    scroll-margin-top: calc(var(--manual-bar-height) + 16px);
}

.manual-content h3 {
    font-size: 1.12rem;
    font-weight: 600;
    margin: 22px 0 6px 0;
    scroll-margin-top: calc(var(--manual-bar-height) + 16px);
}

.manual-content p,
.manual-content ul,
.manual-content ol {
    margin: 0 0 12px 0;
}

.manual-content ul,
.manual-content ol {
    padding-left: 24px;
}

.manual-content ul {
    list-style: disc;
}

.manual-content ol {
    list-style: decimal;
}

.manual-content li {
    margin: 3px 0;
}

.manual-content a {
    color: var(--mud-palette-primary);
}

.manual-content code {
    background: var(--mud-palette-background-gray);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.9em;
}

.manual-content kbd {
    display: inline-block;
    border: 1px solid var(--mud-palette-lines-default);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 0 5px;
    font-size: 0.85em;
    font-family: inherit;
    background: var(--mud-palette-surface);
    white-space: nowrap;
}

.manual-content img {
    max-width: 100%;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    margin: 6px 0;
}

.manual-content table {
    border-collapse: collapse;
    margin: 8px 0 16px 0;
    width: 100%;
    font-size: 0.92rem;
}

.manual-content th,
.manual-content td {
    border: 1px solid var(--mud-palette-lines-default);
    padding: 6px 10px;
    text-align: left;
    vertical-align: top;
}

.manual-content th {
    background: var(--mud-palette-background-gray);
    font-weight: 600;
}

.manual-content blockquote {
    margin: 12px 0;
    padding: 10px 14px;
    border-left: 4px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-background-gray);
    border-radius: 0 6px 6px 0;
}

.manual-content blockquote p:last-child {
    margin-bottom: 0;
}

.manual-content blockquote.manual-tip {
    border-left-color: #2e7d32;
    background: rgba(46, 125, 50, 0.08);
}

.manual-content blockquote.manual-warning {
    border-left-color: #ed6c02;
    background: rgba(237, 108, 2, 0.08);
}

.manual-content blockquote.manual-todo {
    border-left-color: #9c27b0;
    background: rgba(156, 39, 176, 0.07);
    font-style: italic;
}

.manual-content blockquote.manual-role {
    border-left-color: var(--mud-palette-primary);
    background: rgba(89, 74, 226, 0.06);
    font-size: 0.9rem;
}

.manual-content mark.manual-hit,
.manual-result-snippet mark {
    background: #fff176;
    color: #000;
    padding: 0 1px;
    border-radius: 2px;
}

.manual-flash {
    animation: manual-flash 1.6s ease-out;
}

@keyframes manual-flash {
    0% { background: rgba(255, 241, 118, 0.9); }
    100% { background: transparent; }
}

/* Icons of the app in the text: {icon:Name} (ManualService) */
.manual-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55em;
    height: 1.55em;
    margin: 0 2px;
    vertical-align: -0.4em;
    border-radius: 6px;
    border: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-background-gray);
    color: var(--mud-palette-text-primary);
}

.manual-icon svg {
    width: 1.1em;
    height: 1.1em;
    fill: currentColor;
}

/* "Wat is nieuw" dialog (Dialogs/Shared/WhatsNewDialog.razor) */
/* Always 80% of the screen high; the content scrolls when it does not fit, the buttons stay visible */
.whatsnew-dialog {
    height: 80vh;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.whatsnew-dialog .mud-dialog-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.whatsnew-dialog .mud-dialog-title,
.whatsnew-dialog .mud-dialog-actions {
    flex: 0 0 auto;
}

/* The line under a version number always stays: MudBlazor removes the line of an expanded panel (and of the
   panel before it and the last one); here the header has the line, also when the panel is open */
.whatsnew .mud-expand-panel,
.whatsnew .mud-expand-panel.mud-panel-expanded,
.whatsnew .mud-expand-panel.mud-panel-next-expanded,
.whatsnew .mud-expand-panel:last-child {
    border-bottom: none;
    margin: 0;
}

.whatsnew .mud-expand-panel-header {
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.whatsnew-version {
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

.whatsnew-content {
    font-size: 0.92rem;
}

.whatsnew-content p strong {
    display: block;
    margin-top: 6px;
}

/* Cards on start and chapter pages */
.manual-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.manual-card {
    display: block;
    padding: 14px 16px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.manual-card:hover {
    border-color: var(--mud-palette-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.manual-card-title {
    font-weight: 600;
    color: var(--mud-palette-primary);
    margin-bottom: 4px;
}

.manual-card-text {
    font-size: 0.85rem;
    color: var(--mud-palette-text-secondary);
}

/* Previous / next */
.manual-prevnext {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.manual-prevnext a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--mud-palette-primary);
    max-width: 48%;
}

.manual-prevnext .manual-next {
    text-align: right;
    margin-left: auto;
}

.manual-prevnext .manual-muted {
    font-size: 0.8rem;
}

/* On this page */
.manual-toc {
    flex: 0 0 220px;
    position: sticky;
    top: calc(var(--manual-bar-height) + 24px);
    max-height: calc(100vh - var(--manual-bar-height) - 64px);
    overflow-y: auto;
    font-size: 0.85rem;
    border-left: 1px solid var(--mud-palette-lines-default);
    padding-left: 14px;
}

.manual-toc-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}

.manual-toc a {
    display: block;
    padding: 3px 0;
    color: var(--mud-palette-text-primary);
    text-decoration: none;
}

.manual-toc a:hover {
    color: var(--mud-palette-primary);
}

.manual-toc .manual-toc-l3 {
    padding-left: 12px;
    color: var(--mud-palette-text-secondary);
}

/* Search results */
.manual-result {
    display: block;
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
}

.manual-result:hover {
    border-color: var(--mud-palette-primary);
}

.manual-result-path {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.manual-result-title {
    font-weight: 600;
    color: var(--mud-palette-primary);
}

.manual-result-snippet {
    font-size: 0.875rem;
    margin-top: 4px;
}

/* Dark mode (preference of the user, see Layout/ManualLayout.razor) */
.manual-dark .manual-content blockquote.manual-tip {
    border-left-color: #66bb6a;
    background: rgba(102, 187, 106, 0.12);
}

.manual-dark .manual-content blockquote.manual-warning {
    border-left-color: #ffa726;
    background: rgba(255, 167, 38, 0.12);
}

.manual-dark .manual-content blockquote.manual-todo {
    border-left-color: #ce93d8;
    background: rgba(206, 147, 216, 0.12);
}

.manual-dark .manual-content blockquote.manual-role {
    background: rgba(144, 202, 249, 0.10);
}

.manual-dark .manual-card:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.manual-dark .manual-content img {
    background: #fff;
}

@keyframes manual-flash-dark {
    0% { background: rgba(255, 241, 118, 0.35); }
    100% { background: transparent; }
}

.manual-dark .manual-flash {
    animation-name: manual-flash-dark;
}

@media (max-width: 1200px) {
    .manual-toc {
        display: none;
    }
}

@media (max-width: 700px) {
    .manual-main {
        padding: 16px;
    }

    .manual .manual-appbar .mud-toolbar {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 8px;
    }

    .manual-brand-text,
    .manual-search-kbd,
    .manual-appbar-end {
        display: none;
    }
}

@media print {
    .manual .mud-appbar,
    .manual .mud-drawer,
    .manual-toc,
    .manual-prevnext {
        display: none !important;
    }

    .manual .mud-main-content {
        padding: 0 !important;
        margin: 0 !important;
    }
}
