/* Override  bootstrap defaults */
:root {
    --bs-body-font-size: 0.8rem;
    --bs-body-line-height: 1.3;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    height: 100%;
}

    html[data-bs-theme="dark"] {
        --bs-body-bg:  #111;
    }

        html[data-bs-theme="dark"] .mainlayout .bb-top-row {
            background-color: #000;
            background-image: url("/images/black-lozenge.png");
            background-repeat: repeat;
            background-size: auto;
        }

        html[data-bs-theme="dark"] .mainlayout .bb-sidebar2-top-row.navbar {
            background-color: #000;
            background-image: url('/images/black-lozenge.png');
            background-repeat: repeat;
            background-size: auto;
        }

        html[data-bs-theme="dark"] .mainlayout .bb-sidebar2-content {
            background-color: #000;
            background-image: url('/images/black-lozenge.png');
            background-repeat: repeat;
            background-size: auto;
        }

    html[data-bs-theme="dark"] body {
        background: #111;
        color: #ddd;
    }

.navbar-brand-text {
    font-size: 30px;
}


h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHR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xNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDg2IDY2LjAxODMgMjYzLjU3NiA2Ni4wMTg0MjAgNjcuMTI0NSAyNjkuNzY0IDY5LjMxODMgMjY3Ljg3OSA2Ni4zNzA4IDI2Ny44OTIgNjkuNTQwNyAyNjcuODQxIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS40NzIgNzAuMDg4N0wyNjEuNzk1IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: #333;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

/* Dark mode support for loading screen */
html[data-bs-theme="dark"] .loading-progress-text {
    color: #ddd;
}

html[data-bs-theme="dark"] .loading-progress circle {
    stroke: #444;
}

html[data-bs-theme="dark"] .loading-progress circle:last-child {
    stroke: #1b6ec2;
}

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.subtitle {
    color: gray;
    font-size: 30px;
}

dt {
    color: gray;
    font-size: 12px;
}

dd {
    margin-left: 16px;
}

table th,td {
    text-align:center;
}

table td.burgercolumn .bi {
    cursor: pointer;
}

.nav-tabs .nav-link:not(.active):hover {
    cursor: pointer;
}

.buttonbar {
    padding-bottom: 3px;
}

.row.filters {
    padding: 2px;
    margin: 0 0 6px 0;
    background-color: var(--bb-sidebar2-nav-item-background-hover-color);
}
    .row.filters dl {
        margin: 0;
    }
    .row.filters select {
    margin: 0;
    line-height: 1;
    font-size: 0.9rem;
}

.bb-top-row {
    justify-content: space-between !important;
}

/* The title is variable-length and less important than the user's name/env
   banner, so it shrinks and truncates instead of pushing header-actions
   past the edge of main's overflow-x:hidden box (which was clipping the
   username, e.g. "John Charlton" rendering as "John Ch"). */
.mainlayout .header-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.mainlayout .header-title h1 {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.mainlayout .header-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    white-space: nowrap;
    gap: 0.5rem;
}

/* Shared fade-up-into-place animation: starts translucent and a little below
   its resting spot, settles in over 0.6s. Reused (by keyframe name) from
   Dashboard's Index.razor.css for the stat/server cards. */
@keyframes fade-rise-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mainlayout .header-title h1,
.bb-sidebar2 .navbar-brand-text {
    opacity: 0;
    animation: fade-rise-in 0.6s ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
    .mainlayout .header-title h1,
    .bb-sidebar2 .navbar-brand-text {
        animation: none;
        opacity: 1;
    }
}

.gridtaskboard {
        display: grid;
/*    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
*/    gap: 10px;
}

    .gridtaskboard .boarditem {
        margin: 18px 0;
        border-radius: 6px;
        padding: 8px;
        border: 1px solid gray;
    }

html[data-bs-theme="dark"] .gridtaskboard .boarditem {
    border-color: var(--bb-sidebar2-nav-item-background-hover-color);
}

.mainlayout .sectionHeader {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* Knowledge Search Enhancements */
.knowledge-search .search-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0.5rem 0.5rem 0 0;
}

.knowledge-search .search-results-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.knowledge-search .empty-results {
    padding: 3rem;
    color: #6c757d;
}

.knowledge-search .search-score {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: bold;
}

.knowledge-search .context-info {
    font-size: 0.85rem;
}

.knowledge-search .search-query-display {
    font-style: italic;
}

/* MultiSelect component styling */
.multiselect {
    position: relative;
}

.multiselect .form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.multiselect .btn {
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.multiselect .border {
    border-color: #ced4da !important;
    border-radius: 0.375rem;
}

.multiselect .form-check {
    padding: 0.25rem 0;
}

.multiselect .form-check-input {
    margin-top: 0.25rem;
}

.multiselect .form-check-label {
    font-size: 0.875rem;
    cursor: pointer;
}

/* Content type badges */
.badge {
    font-size: 0.75rem;
}

.badge .bi {
    font-size: 0.7rem;
}

/* Grid styling improvements */
.grid-container {
    border-radius: 0 0 0.375rem 0.375rem;
    overflow: hidden;
}

.table th {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    font-weight: 600;
    font-size: 0.875rem;
    color: #495057;
}

.table td {
    vertical-align: middle;
    font-size: 0.875rem;
}

/* Dark mode table support */
html[data-bs-theme="dark"] .table th {
    background-color: #343a40;
    border-color: #495057;
    color: #f8f9fa;
}

html[data-bs-theme="dark"] .table td {
    background-color: #212529;
    border-color: #495057;
    color: #f8f9fa;
}

html[data-bs-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.05);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.075);
    color: #f8f9fa;
}

/* RichTextEditor (Quill "Snow" theme) dark mode support */
html[data-bs-theme="dark"] .ql-toolbar.ql-snow {
    background-color: #343a40;
    border-color: #495057;
}

html[data-bs-theme="dark"] .ql-container.ql-snow {
    border-color: #495057;
}

html[data-bs-theme="dark"] .ql-snow .ql-stroke,
html[data-bs-theme="dark"] .ql-snow .ql-stroke-miter {
    stroke: #f8f9fa;
}

html[data-bs-theme="dark"] .ql-snow .ql-fill,
html[data-bs-theme="dark"] .ql-snow .ql-stroke.ql-fill {
    fill: #f8f9fa;
}

html[data-bs-theme="dark"] .ql-snow .ql-picker {
    color: #f8f9fa;
}

html[data-bs-theme="dark"] .ql-snow .ql-picker-options {
    background-color: #343a40;
    border-color: #495057;
}

html[data-bs-theme="dark"] .ql-snow .ql-picker.ql-expanded .ql-picker-label,
html[data-bs-theme="dark"] .ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options {
    border-color: #495057;
}

html[data-bs-theme="dark"] .ql-snow .ql-tooltip {
    background-color: #343a40;
    border-color: #495057;
    color: #f8f9fa;
}

html[data-bs-theme="dark"] .ql-snow .ql-tooltip input[type=text] {
    background-color: #212529;
    border-color: #495057;
    color: #f8f9fa;
}

html[data-bs-theme="dark"] .ql-editor.ql-blank::before {
    color: rgba(248, 249, 250, 0.5);
}

/* Advanced filters section */
.border-top {
    border-color: #dee2e6 !important;
}

html[data-bs-theme="dark"] .border-top {
    border-color: #495057 !important;
}

/* Button groups for actions on index pages */
td:has(.btn-group-sm) {
    padding: 2px 0;
    width: 1px; /*  Causes the grid cell to be the same width as the content */
}

.btn-group-sm button {
    padding: 0 8px;
}

html[data-bs-theme="dark"] td a {
    color: #08f;
}

/* Impact level flash animation for High and Critical */
.impact-flash {
    display: inline-block;
    font-weight: bold;
    color: #dc3545;
    animation: impact-pulse 1.5s ease-in-out infinite;
}

@keyframes impact-pulse {
    0%, 100% {
        opacity: 1;
        color: #dc3545;
    }
    50% {
        opacity: 0.5;
        color: #ff6b6b;
    }
}

html[data-bs-theme="dark"] .impact-flash {
    color: #ff4444;
    animation: impact-pulse-dark 1.5s ease-in-out infinite;
}

@keyframes impact-pulse-dark {
    0%, 100% {
        opacity: 1;
        color: #ff4444;
    }
    50% {
        opacity: 0.5;
        color: #ff8888;
    }
}

/* Non-production environment banner shown next to the username */
.env-banner-blink {
    font-weight: bold;
    color: #dc3545;
    animation: env-banner-blink 1s step-start infinite;
}

@keyframes env-banner-blink {
    50% {
        opacity: 0;
    }
}

/* Sidebar main-menu items fade + slide in from off-screen on load, staggered
   per item. Pure CSS: the "animation" (not "transition") property plays
   automatically once when the element is first inserted into the DOM, so no
   JS is needed. nth-child delay is scoped per list, so nested groups (e.g.
   Knowledge Search, Administration) stagger among their own children too. */
.bb-sidebar2 nav .nav-item {
    opacity: 0;
    animation: sidebar-nav-item-in 0.4s ease-out forwards;
}

@keyframes sidebar-nav-item-in {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.bb-sidebar2 nav .nav-item:nth-child(1) { animation-delay: 0.00s; }
.bb-sidebar2 nav .nav-item:nth-child(2) { animation-delay: 0.05s; }
.bb-sidebar2 nav .nav-item:nth-child(3) { animation-delay: 0.10s; }
.bb-sidebar2 nav .nav-item:nth-child(4) { animation-delay: 0.15s; }
.bb-sidebar2 nav .nav-item:nth-child(5) { animation-delay: 0.20s; }
.bb-sidebar2 nav .nav-item:nth-child(6) { animation-delay: 0.25s; }
.bb-sidebar2 nav .nav-item:nth-child(7) { animation-delay: 0.30s; }
.bb-sidebar2 nav .nav-item:nth-child(8) { animation-delay: 0.35s; }
.bb-sidebar2 nav .nav-item:nth-child(9) { animation-delay: 0.40s; }
.bb-sidebar2 nav .nav-item:nth-child(10) { animation-delay: 0.45s; }
.bb-sidebar2 nav .nav-item:nth-child(11) { animation-delay: 0.50s; }
.bb-sidebar2 nav .nav-item:nth-child(12) { animation-delay: 0.55s; }
.bb-sidebar2 nav .nav-item:nth-child(13) { animation-delay: 0.60s; }
.bb-sidebar2 nav .nav-item:nth-child(14) { animation-delay: 0.65s; }
.bb-sidebar2 nav .nav-item:nth-child(15) { animation-delay: 0.70s; }
.bb-sidebar2 nav .nav-item:nth-child(16) { animation-delay: 0.75s; }
.bb-sidebar2 nav .nav-item:nth-child(17) { animation-delay: 0.80s; }
.bb-sidebar2 nav .nav-item:nth-child(18) { animation-delay: 0.85s; }
.bb-sidebar2 nav .nav-item:nth-child(19) { animation-delay: 0.90s; }
.bb-sidebar2 nav .nav-item:nth-child(20) { animation-delay: 0.95s; }

@media (prefers-reduced-motion: reduce) {
    .bb-sidebar2 nav .nav-item {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Custom modal dialog (used by ConfirmPasswordModal, AddPasswordModal, EditPasswordModal) */
.modal-overlay-custom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog-custom {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--bs-box-shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-dialog-custom.delete-dialog {
    max-width: 500px;
}

.modal-header-custom {
    padding: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bs-tertiary-bg);
    border-radius: var(--bs-border-radius-lg) var(--bs-border-radius-lg) 0 0;
}

.modal-title-custom {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--bs-heading-color);
}

.btn-close-custom {
    border: none;
    background: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--bs-secondary-color);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--bs-border-radius);
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.btn-close-custom:hover {
    color: var(--bs-body-color);
    background-color: var(--bs-secondary-bg);
}

.btn-close-custom:focus {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.modal-body-custom {
    padding: 1.5rem;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/* Bootstrap dark mode class support */
[data-bs-theme="dark"] .modal-overlay-custom {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Ensure proper contrast in dark mode */
[data-bs-theme="dark"] .modal-dialog-custom {
    box-shadow: 0 0.5rem 1rem rgba(255, 255, 255, 0.05);
}