/* 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;
}

.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;
}

/* 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;
}

/* ===== BLAZOR BOOTSTRAP LAYOUT FIXES ===== */
/* Force desktop layout - ensure sidebar is always visible on desktop */

/* Ensure the bb-page container uses flexbox layout */
.bb-page {
    display: flex !important;
    flex-direction: row !important;
    height: 100vh !important;
    width: 100% !important;
    min-height: 100vh !important;
}

/* Ensure sidebar displays as full-height column on desktop */
.bb-sidebar2 {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    min-height: 100vh !important;
    min-width: 200px !important;
 max-width: 200px !important;
    width: 200px !important;
    flex-shrink: 0 !important;
    position: relative !important;
    left: auto !important;
    transform: none !important;
    background-color: inherit !important;
}

/* Sidebar top row (navbar) */
.bb-sidebar2-top-row {
    flex-shrink: 0 !important;
    display: flex !important;
}

/* Sidebar content should fill remaining height */
.bb-sidebar2-content {
flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: block !important;
    height: auto !important;
}

/* Main content area should flex and fill remaining space */
.bb-page > div:not(.bb-sidebar2):not(.bb-sidebar2-top-row):not(.bb-sidebar2-content) {
flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    width: 100% !important;
}

/* Hide mobile hamburger on DESKTOP (min-width: 992px) */
@media (min-width: 992px) {
    .bb-sidebar2-toggler {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        position: absolute !important;
    }
    
    .bb-sidebar2 {
        display: flex !important;
        position: relative !important;
        transform: translateX(0) !important;
  left: auto !important;
    }

    .bb-page {
    flex-direction: row !important;
    }
    
    /* Ensure sidebar content is visible on desktop */
    .bb-sidebar2-content {
        display: block !important;
visibility: visible !important;
        height: calc(100vh - 60px) !important;
    }
}

/* Mobile layout - show hamburger and hide sidebar by default */
@media (max-width: 991px) {
    .bb-page {
        flex-direction: column !important;
    }
    
    .bb-sidebar2 {
 position: fixed !important;
        top: 0 !important;
        left: 0 !important;
  width: 200px !important;
        max-width: 200px !important;
        height: 100vh !important;
     z-index: 1030 !important;
    transform: translateX(-100%) !important;
        transition: transform 0.3s ease !important;
    }
    
    .bb-sidebar2.show {
        transform: translateX(0) !important;
    }
    
    .bb-sidebar2-toggler {
        display: flex !important;
        visibility: visible !important;
    }
}

/* ===== ACTIVE NAV LINK STYLING ===== */
/* Style active nav items with purple box/highlight */
.bb-sidebar2-content .nav-link.active,
.bb-sidebar2-content .nav-item.active .nav-link,
.bb-sidebar2-content a.nav-link.active {
    background-color: #667eea !important;
  color: white !important;
    border-radius: 0.375rem !important;
    font-weight: 500 !important;
}

.bb-sidebar2-content .nav-link.active:hover,
.bb-sidebar2-content .nav-item.active .nav-link:hover,
.bb-sidebar2-content a.nav-link.active:hover {
    background-color: #5568d3 !important;
    color: white !important;
}

/* Ensure nav items have proper spacing and font */
.bb-sidebar2-content .nav-link {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    color: inherit !important;
}

/* ===== END BLAZOR BOOTSTRAP LAYOUT FIXES ===== */