﻿/* Import Open Sans font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap');

/* Help Page Container */
.help-page-container {
    height: calc(100vh - 60px); /* Subtract AppBar height */
    width: 100%;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.help-splitter {
    height: 100%;
}

/* Help Sidebar */
.help-nav-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
}

/* Tree Navigation - help-tree is a CSS class ON the e-treeview element */
.e-treeview.help-tree {
    flex: 1;
    overflow-y: auto;
    padding: 0 !important;
    background: transparent;
    border: none !important;
    outline: none !important;
}

/* Remove focus outline */
.e-treeview.help-tree:focus {
    outline: none !important;
    border: none !important;
}

/* Remove default left padding from all ul elements */
.e-treeview.help-tree .e-list-parent.e-ul {
    padding-left: 0 !important;
}

/* Add indentation for nested items at the text level */
.e-treeview.help-tree .e-level-1 .e-text-content {
    padding-left: 12px !important;
}

.e-treeview.help-tree .e-level-2 .e-text-content {
    padding-left: 32px !important;
}

.e-treeview.help-tree .e-level-3 .e-text-content {
    padding-left: 52px !important;
}

.e-treeview.help-tree .e-level-4 .e-text-content {
    padding-left: 72px !important;
}

/* Add separator lines between menu items - extend to full width */
.e-treeview.help-tree .e-list-item {
    border-bottom: 1px solid #d1d5db !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    margin-bottom: 0 !important;
    position: relative;
    min-height: 32px !important;
    height: auto !important;
}

/* Remove border on hover and focus */
.e-treeview.help-tree .e-list-item.e-hover,
.e-treeview.help-tree .e-list-item.e-node-focus,
.e-treeview.help-tree .e-list-item:focus {
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    outline: none !important;
}

/* Make separator line extend to left edge */
.e-treeview.help-tree .e-list-item::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #d1d5db;
}

/* Last item in a group doesn't need bottom border */
.e-treeview.help-tree .e-list-item:last-child {
    border-bottom: none !important;
}

.e-treeview.help-tree .e-list-item:last-child::after {
    display: none;
}

/* Text styling - black by default */
.e-treeview.help-tree .e-list-text {
    color: #000 !important;
    font-weight: 400;
    font-size: 14px;
}

/* Active item text - bold black (no background) */
.e-treeview.help-tree .e-list-item.e-active > .e-text-content .e-list-text {
    color: #000 !important;
    font-weight: 600 !important;
}

/* Hover on any item including active - bold black text */
.e-treeview.help-tree .e-list-item.e-hover > .e-text-content .e-list-text {
    color: #000 !important;
    font-weight: 600 !important;
}

/* Hide Syncfusion's default expand/collapse icons since we're using custom caret */
.e-treeview.help-tree .e-icons.interaction,
.e-treeview.help-tree .e-icons.e-icon-collapsible,
.e-treeview.help-tree .e-icons.e-icon-expandable {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    visibility: hidden !important;
}

/* Adjust text content wrapper for better vertical centering and caret positioning */
.e-treeview.help-tree .e-text-content {
    padding: 0 12px 0 0 !important;
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    min-height: 32px;
}

/* Full row styling - make it fill the entire list item height but don't show background */
.e-treeview.help-tree .e-fullrow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    width: 100%;
    border-bottom: none;
    background-color: transparent !important;
}

/* Active item - no background color, just bold text */
.e-treeview.help-tree .e-list-item.e-active > .e-fullrow {
    background-color: transparent !important;
    border-color: transparent !important;
    border: none !important;
}

.e-treeview.help-tree .e-list-item.e-active > .e-text-content {
    background-color: transparent !important;
    border: none !important;
}

/* Override default Syncfusion active styles */
.help-tree.e-treeview .e-list-item.e-active > .e-fullrow {
    background-color: transparent !important;
    border-color: transparent !important;
}

/* Hover state - light gray background for non-active items */
.e-treeview.help-tree .e-list-item.e-hover:not(.e-active) > .e-fullrow {
    background-color: transparent !important;
}

.e-treeview.help-tree .e-list-item.e-hover:not(.e-active) > .e-text-content {
    background-color: #e9ecef !important;
}

/* Hover state on active item - light blue background */
.e-treeview.help-tree .e-list-item.e-active.e-hover > .e-fullrow {
    background-color: transparent !important;
}

.e-treeview.help-tree .e-list-item.e-active.e-hover > .e-text-content {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

/* Focus state (keyboard navigation) - same as hover */
.e-treeview.help-tree .e-list-item.e-node-focus:not(.e-active) > .e-text-content {
    background-color: #e9ecef !important;
}

.e-treeview.help-tree .e-list-item.e-active.e-node-focus > .e-text-content {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

/* Custom node template styles */
.help-tree-node {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    width: 100%;
    min-height: 32px;
}

.help-node-content {
    flex: 1;
    cursor: pointer;
    padding: 0;
}

.help-node-text {
    color: #000;
    font-size: 14px;
}

.help-tree-node.active .help-node-text {
    color: #000;
    font-weight: 600;
}

/* Caret icon styling - positioned absolutely relative to the full row */
.help-caret {
    position: absolute;
    right: 12px;
    top: 50%;
    color: #6c757d !important;
    font-size: 20px;
    pointer-events: none;
    z-index: 2;
    transform: translateY(-50%) rotate(0deg) !important;
    transition: transform 0.3s ease !important;
}

/* Ensure caret stays gray for non-active items */
.e-treeview.help-tree .e-list-item:not(.e-active) .help-caret {
    color: #6c757d !important;
}

/* Default - caret points down (expanded state) */
.e-treeview.help-tree li.e-list-item .help-caret {
    transform: translateY(-50%) rotate(0deg) !important;
}

/* When the sibling ul has display: none, rotate caret to right (collapsed) */
.e-treeview.help-tree .e-list-item .e-text-content:has(+ .e-ul[style*="display: none"]) .help-caret {
    transform: translateY(-50%) rotate(-90deg) !important;
}

/* Keep caret gray even for active items */
.e-treeview.help-tree .e-list-item.e-active .help-caret {
    color: #6c757d !important;
}

/* Content Area */
.help-content-area {
    height: 100%;
    overflow-y: auto;
    padding: 2rem;
    background: white;
}

/* Breadcrumb Container - flex layout with search on right */
.help-breadcrumb-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.help-breadcrumb {
    flex: 1;
    margin-bottom: 0;
}

.help-breadcrumb a {
    color: #0B3B60;
    text-decoration: none;
}

.help-breadcrumb a:hover {
    color: #0B3B60;
    text-decoration: underline;
}

.help-breadcrumb-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Compact Search Box */
.help-search-compact {
    position: relative;
    display: flex;
    align-items: center;
}

.help-search-compact .help-search-icon {
    position: absolute;
    left: 0.5rem;
    color: #6c757d;
    font-size: 20px;
    line-height: 1;
    pointer-events: none;
    z-index: 1;
    display: flex;
    align-items: center;
}

.help-search-compact .help-search-input {
    width: 350px;
    padding: 0.375rem 2rem 0.375rem 2.5rem !important;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.2s ease;
}

.help-search-compact .help-search-input:focus {
    border-color: #0B3B60;
    box-shadow: 0 0 0 0.2rem rgba(11, 59, 96, 0.15);
}

.btn-clear-search {
    position: absolute;
    right: 0.25rem;
    padding: 0.125rem;
    border: none;
    background: transparent;
    color: #6c757d;
    z-index: 1;
    cursor: pointer;
}

.btn-clear-search:hover {
    color: #495057;
}

.btn-clear-search .material-symbols-outlined {
    font-size: 18px;
}

/* Print Button - Icon Only, No Outline */
.btn-print-icon {
    padding: 0.375rem 0.5rem;
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.btn-print-icon:hover {
    color: #0B3B60;
}

.btn-print-icon .material-symbols-outlined {
    font-size: 20px;
}

.help-content-body {
    font-size: 14px;
    line-height: 1.6;
    max-width: 900px;
}

    /* Typography */
    .help-content-body h1 {
        color: #0B3B60;
        font-size: 2rem;
        margin-bottom: 1rem;
        border-bottom: 2px solid #0B3B60;
        padding-bottom: 0.5rem;
    }

    .help-content-body h2 {
        color: #212529;
        font-size: 1.5rem;
        margin-top: 2rem;
        margin-bottom: 1rem;
    }

    .help-content-body h3 {
        color: #495057;
        font-size: 1.25rem;
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .help-content-body p {
        margin-bottom: 1rem;
    }

    .help-content-body ul,
    .help-content-body ol {
        margin-bottom: 1rem;
        padding-left: 2rem;
    }

    .help-content-body li {
        margin-bottom: 0.5rem;
    }

    .help-content-body code {
        background-color: #f8f9fa;
        padding: 2px 6px;
        border-radius: 3px;
        color: #d63384;
        font-family: 'Courier New', monospace;
        font-size: 0.9em;
    }

    .help-content-body pre {
        background-color: #f8f9fa;
        padding: 1rem;
        border-radius: 4px;
        overflow-x: auto;
        margin: 1rem 0;
    }

        .help-content-body pre code {
            background-color: transparent;
            padding: 0;
        }

    .help-content-body table {
        width: 100%;
        margin: 1.5rem 0;
        border-collapse: collapse;
    }

        .help-content-body table th,
        .help-content-body table td {
            padding: 0.75rem;
            border: 1px solid #dee2e6;
            text-align: left;
        }

        .help-content-body table th {
            background-color: #f8f9fa;
            font-weight: 600;
        }

    .help-content-body blockquote {
        border-left: 4px solid #0B3B60;
        padding-left: 1rem;
        margin: 1rem 0;
        color: #6c757d;
    }

/* Related Topics */
.help-related-topics {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #dee2e6;
}

    .help-related-topics h5 {
        color: #0B3B60;
        margin-bottom: 1rem;
    }

    .help-related-topics ul {
        list-style: none;
        padding: 0;
    }

    .help-related-topics li {
        margin-bottom: 0.5rem;
    }

    .help-related-topics a {
        display: flex;
        align-items: center;
        color: #0B3B60;
        text-decoration: none;
    }

        .help-related-topics a:hover {
            text-decoration: underline;
        }

    .help-related-topics .material-symbols-outlined {
        font-size: 18px;
        margin-right: 0.5rem;
    }

/* Feedback */
.help-feedback {
    margin-top: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

    .help-feedback p {
        margin-bottom: 0.5rem;
        font-weight: 500;
    }

    .help-feedback button {
        margin: 0 0.25rem;
    }

/* Search Results */
.help-search-results {
    height: 100%;
    overflow-y: auto;
    padding: 2rem;
    background: white;
}

/* No results state */
.no-results-container {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.no-results-icon {
    margin-bottom: 1.5rem;
}

    .no-results-icon .material-symbols-outlined {
        font-size: 64px;
        color: #adb5bd;
    }

.no-results-container h3 {
    color: #495057;
    margin-bottom: 0.5rem;
}

.no-results-container p {
    margin-bottom: 0.5rem;
}

/* Search results header */
.search-results-header {
    margin-bottom: 2rem;
}

    .search-results-header h2 {
        color: #0B3B60;
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }

    .search-results-header p {
        color: #6c757d;
        margin-bottom: 0;
    }

/* Search results list */
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Individual search result item */
.search-result-item {
    padding: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .search-result-item:hover {
        border-color: #0B3B60;
        box-shadow: 0 4px 8px rgba(11, 59, 96, 0.1);
        transform: translateY(-2px);
    }

/* Result header */
.result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.result-title {
    display: flex;
    align-items: center;
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
    flex: 1;
}

    .result-title .result-icon {
        font-size: 24px;
        margin-right: 0.5rem;
        color: #0B3B60;
    }

.result-category {
    background: #e7f1ff;
    color: #0B3B60;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Result snippet */
.result-snippet {
    color: #495057;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

    .result-snippet mark {
        background-color: #fff3cd;
        padding: 2px 4px;
        border-radius: 2px;
        font-weight: 600;
    }

/* Result footer */
.result-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6c757d;
}

.result-path {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

    .result-path .material-symbols-outlined {
        font-size: 16px;
    }

.result-score {
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .help-nav-container {
        position: fixed;
        left: -220px;
        top: 60px;
        height: calc(100vh - 60px);
        width: 220px;
        z-index: 1000;
        transition: left 0.3s;
    }

        .help-nav-container.open {
            left: 0;
            box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        }

    .help-content-area {
        padding: 1rem;
    }

    .help-content-body {
        font-size: 13px;
    }
}

/* Print styles - Only print markdown content */
@media print {
    /* Hide navigation, breadcrumb, search, and print button */
    .help-nav-container,
    .help-breadcrumb-container,
    .help-related-topics {
        display: none !important;
    }

    /* Remove page height constraints */
    .help-page-container {
        height: auto;
    }

    .help-content-area {
        padding: 0;
    }

    /* Make content full width for print */
    .help-content-body {
        max-width: 100%;
        margin: 0;
    }

    /* Ensure good page breaks */
    .help-content-body h1,
    .help-content-body h2,
    .help-content-body h3 {
        page-break-after: avoid;
    }

    .help-content-body table {
        page-break-inside: avoid;
    }
}

/* Help Flyout Overlay - moved from AppBar.razor */
.help-flyout-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1050;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding-top: 60px;
}

.help-flyout-panel {
    width: 600px;
    max-width: 90vw;
    height: 50vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.help-flyout-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
}

.help-flyout-title {
    margin: 0;
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 600;
}

.help-flyout-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-flyout-actions .btn-link {
    color: #0d6efd;
    text-decoration: none;
}

.help-flyout-actions .btn-link:hover {
    color: #0a58ca;
}

.help-flyout-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.help-flyout-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    background: #f8f9fa;
}

.help-content {
    font-size: 14px;
    line-height: 1.6;
}

.help-content h3 {
    color: #0B3B60;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.help-content h4 {
    color: var(--bs-dark);
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.help-content h5 {
    color: var(--bs-secondary);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.help-content ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.help-content li {
    margin-bottom: 0.25rem;
}

.help-content code {
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    color: #d63384;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.help-content .table {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.help-content p {
    margin-bottom: 0.75rem;
}

.help-link {
    color: var(--bs-info);
    text-decoration: none;
    cursor: help;
}

.help-link:hover {
    text-decoration: underline;
}
