/* Fluent-Dark Theme Variables */
:root[data-bs-theme="dark"] {
    --bs-body-bg: #1f1f1f;
    --bs-body-color: #f8f9ff;
    --bs-primary: #4cc2ff;
    --bs-secondary: #8a8886;
    --bs-success: #107c10;
    --bs-surface: #252423;
    --bs-surface-hover: #2b2a29;
    --bs-border-color: #3b3a39;
    --bs-border-color-translucent: rgba(255, 255, 255, 0.15);
    --bs-elevation-4: 0 1.6px 3.6px 0 rgba(0,0,0,0.132);
    --bs-code-bg: #111418;
    --bs-code-color: #ffb4ab;
    --bs-pre-bg: #111418;
    --bs-pre-color: #e5c07b;
    --bs-link-color: #a1c9fd;
    --bs-link-hover-color: #b3d5ff;
    --bs-primary: #60a5fa; /* More subtle blue */
    --bs-primary-hover: #3b82f6;
    --bs-primary-subtle: rgba(96, 165, 250, 0.1);
}

/* Base typography matching your app */
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    line-height: 1.5;
}

/* Layout Structure */
.main-container {
    min-height: 100vh;
    display: flex;
}

/* Sidebar styling */
.sidebar {
    width: 320px;
    background-color: var(--bs-surface);
    border-right: 1px solid var(--bs-border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    background-color: var(--bs-surface);
}

/* Close button styling for mobile sidebar */
.sidebar-header .btn-outline-secondary {
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.sidebar-header .btn-outline-secondary:hover {
    background-color: var(--bs-surface-hover);
    border-color: var(--bs-border-color);
    color: var(--bs-primary);
}

.sidebar-header .btn-outline-secondary:focus {
    box-shadow: 0 0 0 0.25rem rgba(76, 194, 255, 0.25);
}

/* Ensure proper spacing for the header flex layout */
.sidebar-header .d-flex {
    width: 100%;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--bs-secondary);
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-item {
    margin: 0.125rem 0.5rem;
}

.nav-link {
    color: var(--bs-body-color);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: var(--bs-surface-hover);
    color: var(--bs-primary);
}

.nav-link.active {
    background-color: var(--bs-primary);
    color: white;
}

.nav-link i {
    margin-right: 0.5rem;
    width: 16px;
    text-align: center;
}

.repo-header {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--bs-body-color);
    padding: 0.75rem 1rem;
    background-color: var(--bs-surface);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    cursor: default;
    border: 1px solid var(--bs-border-color);
    transition: all 0.2s ease;
}

/* Repository section headers - hover state */
.repo-header:hover {
    background-color: var(--bs-surface-hover);
    border-color: var(--bs-border-color);
}

/* Repository section headers - active state (dark grey) */
.repo-header.active {
    background-color: #404040 !important; /* Dark grey background */
    border-color: #505050 !important;     /* Slightly lighter grey border */
    color: #ffffff !important;            /* White text */
}

.repo-header.active:hover {
    background-color: #4a4a4a !important; /* Slightly lighter on hover */
    border-color: #555555 !important;
}

/* Repository section icons */
.repo-header .tree-icon {
    color: var(--bs-primary);
    margin-right: 0.5rem;
    transition: color 0.2s ease;
}

/* Active repository section icons - keep them visible in white */
.repo-header.active .tree-icon {
    color: #ffffff !important;
}

/* Login prompt section styling to match tree sections */
.tree-section-login .tree-section-header {
    margin-bottom: 0.5rem;
}

.tree-section-login .tree-section-header > div.text-muted {
    padding: 0.75rem 1rem;
    background: var(--bs-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    color: var(--bs-body-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.tree-section-login .tree-section-header .btn {
    margin: 0 1rem;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

/* Tree view styling */
.tree-view {
    padding-left: 0;
}

.tree-item {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tree-item-content {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem 0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.tree-item-content:hover {
    background-color: var(--bs-primary-subtle);
    border-radius: 6px;
}

.tree-item-content:hover .tree-icon {
    transform: scale(1.1);
}


.tree-item-content.active {
    background-color: var(--bs-primary);
    color: white;
}

.card.folder-item:hover,
.card.file-item:hover {
    background: var(--bs-surface-hover);
    border-color: var(--bs-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.15);
}

/* Tree section toggle - more subtle */
.tree-section-toggle:hover {
    background: var(--bs-primary-subtle);
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

.tree-section-toggle.expanded {
    background: var(--bs-primary-subtle);
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

.tree-toggle {
    width: 16px;
    height: 16px;
    border: none;
    background: none;
    color: var(--bs-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.25rem;
    transition: transform 0.2s ease;
}

.tree-toggle.expanded {
    transform: rotate(90deg);
}

.tree-toggle:disabled {
    opacity: 0;
    cursor: default;
}

.tree-icon {
    width: 16px;
    margin-right: 0.5rem;
    transition: color 0.2s ease;
}

.tree-icon.folder {
    color: #ffd700; /* Gold for folders */
}

.tree-icon.markdown,
.tree-icon.file {
    color: #60a5fa; /* Subtle blue for markdown */
}

.tree-icon.pdf {
    color: #ef4444; /* Red for PDFs */
}

.tree-icon.updf {
    color: #ef4444; /* Orange for uPDFs */
}

.tree-icon.ulink {
    color: #10b981; /* Green for uLinks */
}

.tree-icon.link {
    color: #8b5cf6; /* Purple for regular links */
}

/* Folder item colors in main content */
.folder-item .display-6,
.file-item .display-6 {
    transition: transform 0.2s ease;
}

.folder-item:hover .display-6,
.file-item:hover .display-6 {
    transform: scale(1.1);
}

/* Specific file type colors for content cards */
.folder-item .bi-folder2 {
    color: #ffd700 !important;
}

.file-item .bi-file-text {
    color: #60a5fa !important;
}

.file-item .bi-file-pdf {
    color: #ef4444 !important;
}

.file-item .bi-link-45deg {
    color: #10b981 !important;
}

/* uPDF viewer styling */
.updf-content .updf-meta .badge {
    font-size: 0.75rem;
    padding: 0.4em 0.6em;
}

.updf-content .updf-actions .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.updf-content .updf-viewer iframe {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* uLink content styling */
.ulink-content .card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.ulink-content .card:hover {
    transform: translateY(-2px);
}

/* Service-specific colors for uLinks */
.service-figma { color: #F24E1E !important; }
.service-notion { color: #000000 !important; }
.service-github { color: #333333 !important; }
.service-google { color: #4285F4 !important; }
.service-dropbox { color: #0061FF !important; }
.service-trello { color: #0079BF !important; }
.service-slack { color: #4A154B !important; }

.tree-children {
    padding-left: 1rem;
    border-left: 1px solid var(--bs-border-color);
    margin-left: 0.5rem;
    display: none;
}

.tree-children.expanded {
    display: block;
}

/* Enhanced tree styling for folder clicks */
.tree-item-content[data-type="folder"] {
    font-weight: 500;
}

.tree-item-content[data-type="folder"]:hover {
    background-color: var(--bs-surface-hover);
    color: var(--bs-primary);
}

.tree-item-content[data-type="folder"]:hover .tree-icon.folder {
    color: var(--bs-primary);
}

/* Make it clear that folders are clickable */
.tree-item-content[data-type="folder"] .tree-label {
    cursor: pointer;
}

/* Style active folder differently */
.tree-item-content.active[data-type="folder"] {
    background-color: var(--bs-primary);
    color: white;
}

.tree-item-content.active[data-type="folder"] .tree-icon.folder {
    color: white;
}

.tree-folder-hint {
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tree-item-content[data-type="folder"]:hover .tree-folder-hint {
    opacity: 1;
}

/* Tree loading error styling */
.tree-loading-error {
    background: var(--bs-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    margin: 0.5rem;
}

.tree-loading-error .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Tree section styling */
.tree-section {
    list-style: none;
    margin: 0.5rem 0;
    padding: 0;
}

.tree-section-header {
    margin-bottom: 0.5rem;
}

.tree-section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bs-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    color: var(--bs-body-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.tree-section-toggle:hover {
    background: var(--bs-surface-hover);
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

.tree-section-toggle.expanded {
    background: #404040 !important;       /* Dark grey background */
    border-color: #505050 !important;     /* Slightly lighter grey border */
    color: white !important;              /* White text */
}

.tree-section-toggle.expanded:hover {
    background: #4a4a4a !important;       /* Slightly lighter on hover */
    border-color: #555555 !important;
}

.tree-section-toggle i.bi-chevron-down {
    transition: transform 0.2s ease, color 0.2s ease;
}

.tree-section-toggle.expanded i.bi-chevron-down {
    transform: rotate(180deg);
    color: white !important;
}

.repo-header.active-subtle {
    background-color: #383838 !important; /* Darker subtle grey */
    border-color: #484848 !important;
    color: #e5e5e5 !important;            /* Light grey text */
}

.repo-header.active-subtle .tree-icon {
    color: #e5e5e5 !important;
}

.tree-section-children {
    padding-left: 0;
    margin-left: 0;
    border-left: none;
    display: none;
    list-style: none;
}

.tree-section-children.expanded {
    display: block;
    margin-top: 0.5rem;
}

/* Content area */
.content-area {
    margin-left: 320px;
    flex: 1;
    padding: 2rem;
    max-width: calc(100vw - 320px);
}

/* Content styling matching your app */
.content {
    max-width: 1200px;
    margin: 0 auto;
}

/* Markdown content styling matching your existing app */
.markdown-content h1, 
.markdown-content h2, 
.markdown-content h3, 
.markdown-content h4, 
.markdown-content h5, 
.markdown-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 400;
    line-height: 1.2;
    color: var(--bs-body-color);
}

.markdown-content h1 { font-size: 3rem; }
.markdown-content h2 { font-size: 2.5rem; }
.markdown-content h3 { font-size: 2rem; }
.markdown-content h4 { font-size: 1.5rem; }
.markdown-content h5 { font-size: 1.125rem; }
.markdown-content h6 { font-size: 1rem; }

.markdown-content p {
    margin: 1rem 0;
    line-height: 1.6;
    color: #e1e2e8;
}

.markdown-content code {
    background: var(--bs-code-bg) !important;
    color: var(--bs-code-color);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'JetBrains Mono', Menlo, Monaco, 'Courier New', Courier, monospace;
    font-size: 0.875em;
}

.markdown-content pre {
    background: var(--bs-pre-bg);
    color: var(--bs-pre-color);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--bs-border-color);
}

.markdown-content pre code {
    background: transparent !important;
    color: inherit;
    padding: 0;
}

.markdown-content blockquote {
    border-left: 4px solid var(--bs-border-color);
    color: #c3c6cf;
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0 6px 6px 0;
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
    border: 1px solid #626262;
    border-radius: 6px;
    overflow: hidden;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid #626262;
    padding: 0.75rem;
    text-align: left;
}

.markdown-content th {
    background-color: #252525;
    font-weight: 600;
}

.markdown-content tr:nth-of-type(odd) {
    background-color: #222222;
}

.markdown-content a {
    color: var(--bs-link-color);
    text-decoration: none;
}

.markdown-content a:hover {
    color: var(--bs-link-hover-color);
    text-decoration: underline;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1rem 0;
}

/* Mobile responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .content-area {
        margin-left: 0;
        max-width: 100vw;
        padding: 1rem;
    }

    .mobile-header {
        display: block;
        background-color: var(--bs-surface);
        border-bottom: 1px solid var(--bs-border-color);
        padding: 1rem;
        position: sticky;
        top: 0;
        z-index: 1030;
    }

    .offcanvas-backdrop {
        z-index: 1040;
        background-color: rgba(0, 0, 0, 0.4);
    }
    
    .sidebar.offcanvas-start {
        z-index: 1045;
    }
    
    /* Make sure sidebar content is above everything */
    .sidebar .sidebar-header,
    .sidebar .sidebar-nav {
        position: relative;
        z-index: 1046;
    }

    .updf-content .updf-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .updf-content .updf-actions .btn {
        margin-right: 0;
        width: 100%;
    }
    
    .ulink-content .d-grid .btn {
        font-size: 0.875rem;
    }
}

@media (min-width: 992px) {
    .mobile-header {
        display: none;
    }
}

/* Loading states */
.loading {
    background: var(--bs-surface);
    border-radius: 12px;
    margin: 2rem;
    padding: 3rem;
    border: 1px solid var(--bs-border-color);
}

/* Status badges */
.badge.bg-secondary { background-color: #6c757d !important; }
.badge.bg-info { background-color: var(--bs-primary) !important; }
.badge.bg-success { background-color: #10b981 !important; }

.spinner-border {
    color: var(--bs-primary);
    width: 2rem;
    height: 2rem;
}
/* Authentication section */
.auth-section {
    padding: 1.5rem;
    background-color: var(--bs-surface);
    border-radius: 8px;
    border: 1px solid var(--bs-border-color);
    margin-bottom: 1rem;
}

.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
    transition: all 0.2s ease;
}

.btn-outline-primary {
    color: var(--bs-primary);
    border-color: var(--bs-border-color);
    background-color: transparent;
}

.btn-outline-primary:hover {
    color: white;
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    transform: translateY(-1px);
}

.btn-outline-secondary {
    color: var(--bs-secondary);
    border-color: var(--bs-border-color);
    background-color: transparent;
}

.btn-outline-secondary:hover {
    color: white;
    background-color: var(--bs-secondary);
    border-color: var(--bs-secondary);
    transform: translateY(-1px);
}

.form-control {
    background-color: var(--bs-surface);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

.form-control:focus {
    background-color: var(--bs-surface);
    border-color: var(--bs-primary);
    color: var(--bs-body-color);
    box-shadow: 0 0 0 0.2rem rgba(76, 194, 255, 0.25);
}

/* Header breadcrumb */
.content-header {
    border-bottom: 1px solid var(--bs-border-color);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 0.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--bs-secondary);
}

.breadcrumb-item a {
    color: var(--bs-link-color);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--bs-body-color);
}

/* Section collapse toggle */
.section-toggle {
    background: none;
    border: none;
    color: var(--bs-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.section-toggle:hover {
    background-color: var(--bs-surface-hover);
    color: var(--bs-primary);
}

.section-toggle i {
    transition: transform 0.2s ease;
}

.section-toggle.collapsed i {
    transform: rotate(-90deg);
}

/* Tree loading state */
.tree-loading {
    padding: 1rem;
    text-align: center;
    color: var(--bs-secondary);
    font-size: 0.875rem;
}

/* Folder contents styling */
.folder-contents {
    padding: 1rem 0;
}

.folder-header {
    border-bottom: 1px solid var(--bs-border-color);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.folder-header h2 {
    color: var(--bs-body-color);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.folder-header p {
    margin-bottom: 0;
    font-size: 1rem;
}


.content-section {
    margin-bottom: 2rem;
}

.section-title {
    color: var(--bs-body-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--bs-border-color-translucent);
}

.items-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.folder-item,
.file-item {
    background: var(--bs-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.folder-item:hover,
.file-item:hover {
    background: var(--bs-surface-hover);
    border-color: var(--bs-primary);
    transform: translateY(-1px);
    box-shadow: var(--bs-elevation-4);
}

.folder-item h6,
.file-item h6 {
    color: var(--bs-body-color);
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.folder-item small,
.file-item small {
    color: var(--bs-secondary);
    font-size: 0.8rem;
}

.folder-item i.bi-chevron-right,
.file-item i.bi-arrow-right {
    font-size: 0.875rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.folder-item:hover i.bi-chevron-right,
.file-item:hover i.bi-arrow-right {
    opacity: 1;
}

.empty-folder {
    background: var(--bs-surface);
    border: 2px dashed var(--bs-border-color);
    border-radius: 12px;
    margin: 2rem 0;
    padding: 3rem;
}

.empty-folder h4 {
    font-weight: 500;
}

/* Fix: Target the actual classes being used */
.item-card {
    background: var(--bs-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.item-card:hover {
    background: var(--bs-surface-hover);
    border-color: var(--bs-primary);
    transform: translateY(-1px);
    box-shadow: var(--bs-elevation-4);
}

.item-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.item-info {
    flex-grow: 1;
}

.item-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--bs-body-color);
}

.item-type {
    font-size: 0.75rem;
    color: var(--bs-secondary);
    text-transform: uppercase;
}

.item-size {
    font-size: 0.75rem;
    color: var(--bs-secondary);
}

.item-action {
    color: var(--bs-secondary);
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.item-card:hover .item-action {
    color: var(--bs-primary);
}

/* Grid layout */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.75rem;
}

/* Folder and file specific styling */
.folder-card .item-icon {
    color: #ffd700;
}

.file-card .item-icon {
    color: var(--bs-primary);
}

@media (max-width: 768px) {
    .items-grid {
        grid-template-columns: 1fr;
    }
    
    .item-card {
        padding: 0.75rem;
    }
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .items-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .folder-contents {
        padding: 1rem;
    }
    
    .folder-header h2 {
        font-size: 1.5rem;
    }
}

@media (min-width: 1200px) {
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    }
}

/* Full-width Task Control Datagrids */
.task-control-datagrids-section .card {
    border: 1px solid var(--bs-border-color);
    box-shadow: var(--bs-elevation-4);
    border-radius: 8px;
}

.task-control-datagrids-section .card-header {
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.task-control-datagrids-section .table {
    font-size: 11px; /* Match your app's FontSize="11" */
}

.task-control-datagrids-section .table th {
    background-color: var(--bs-gray-100);
    border-bottom: 2px solid var(--bs-border-color);
    font-weight: 600;
    font-size: 11px;
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.task-control-datagrids-section .table td {
    vertical-align: middle;
    font-size: 11px;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--bs-border-color-translucent);
}

.task-control-datagrids-section .table tbody tr:hover {
    background-color: var(--bs-primary-bg-subtle);
}

/* Icon column styling */
.task-control-datagrids-section .table th:first-child,
.task-control-datagrids-section .table td:first-child {
    width: 40px;
    text-align: center;
}

/* Modified date column */
.task-control-datagrids-section .table th:last-child,
.task-control-datagrids-section .table td:last-child {
    width: 200px;
    font-size: 11px;
}

/* Card footer for data source info */
.task-control-datagrids-section .card-footer {
    background-color: var(--bs-gray-50);
    border-top: 1px solid var(--bs-border-color);
    padding: 0.75rem 1.25rem;
}

/* Responsive table scrolling */
.task-control-datagrids-section .table-responsive {
    border-radius: 0;
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .task-control-datagrids-section .table th {
    background-color: var(--bs-gray-800);
    color: var(--bs-gray-100);
}

[data-bs-theme="dark"] .task-control-datagrids-section .card-footer {
    background-color: var(--bs-gray-800);
    border-top: 1px solid var(--bs-gray-700);
}

/* Repository section headers */
.repo-header {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--bs-body-color);
    padding: 0.5rem 0.75rem;
    background-color: var(--bs-surface-hover);
    border-radius: 6px;
    margin-bottom: 0.25rem;
    cursor: default;
}

.repo-header:hover {
    background-color: var(--bs-surface-hover);
}

.repo-header .tree-icon {
    color: var(--bs-primary);
}

/* Ensure repo children are always visible */
.repo-header + .tree-children {
    display: block !important;
    margin-left: 0.5rem;
    padding-left: 0.75rem;
}

/* Repository section headers */
.repo-header {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--bs-body-color) !important;
    padding: 0.5rem 0.75rem;
    background-color: var(--bs-surface-hover);
    border-radius: 6px;
    margin-bottom: 0.25rem;
    cursor: default;
    border: 1px solid var(--bs-border-color);
}

.repo-header:hover {
    background-color: var(--bs-surface-hover) !important;
}

.repo-header .tree-icon {
    color: var(--bs-primary);
    margin-right: 0.5rem;
}

/* Ensure repo children are always visible */
.repo-header + .tree-children {
    display: block !important;
    margin-left: 0.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--bs-border-color);
}

/* Authentication prompt overlay */
.auth-prompt-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
}

.auth-prompt-card {
    background: var(--bs-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--bs-elevation-4);
}

/* ============================================================================
   PDF.js VIEWER STYLING
   ============================================================================ */

.pdf-viewer-container {
    background: var(--bs-surface);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.pdf-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bs-surface-hover);
    border-bottom: 1px solid var(--bs-border-color);
    gap: 1rem;
}

.pdf-viewer-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pdf-viewer-controls button {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 4px;
}

.pdf-page-info {
    font-size: 0.875rem;
    color: var(--bs-secondary);
    min-width: 100px;
    text-align: center;
}

.pdf-zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pdf-zoom-select {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 4px;
    background: var(--bs-surface);
    color: var(--bs-body-color);
    min-width: 80px;
}

.pdf-canvas-container {
    padding: 1rem;
    background: #f8f9fa;
    min-height: 600px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: auto;
    max-height: 70vh;
}

.pdf-canvas {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    background: white;
}

.pdf-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--bs-secondary);
}

.pdf-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--bs-danger);
    text-align: center;
    padding: 2rem;
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .pdf-canvas-container {
    background: #2d2d2d;
}

/* Responsive PDF viewer */
@media (max-width: 768px) {
    .pdf-viewer-header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .pdf-viewer-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pdf-canvas-container {
        padding: 0.5rem;
        max-height: 60vh;
    }
}

/* Custom status badge colors that match Avalonia app exactly */
.badge.bg-sandy-brown {
    background-color: #F4A460 !important; /* SandyBrown */
    color: black !important;
}

.badge.bg-light-blue {
    background-color: #ADD8E6 !important; /* LightBlue */
    color: black !important;
}

.badge.bg-medium-aquamarine {
    background-color: #66CDAA !important; /* MediumAquamarine */
    color: black !important;
}

.badge.bg-light-coral {
    background-color: #F08080 !important; /* LightCoral */
    color: black !important;
}

.badge.bg-orchid {
    background-color: #DA70D6 !important; /* Orchid */
    color: black !important;
}

.badge.bg-light-yellow {
    background-color: #FFFFE0 !important; /* LightYellow */
    color: black !important;
}

.badge.bg-transparent {
    background-color: transparent !important;
    color: var(--bs-body-color) !important;
    border: 1px solid var(--bs-border-color);
}

/* Tasks page specific styles */
.tasks-container {
    animation: fadeIn 0.3s ease-in;
}

.tasks-container .card {
    border: 1px solid var(--bs-border-color);
    background: var(--bs-surface);
    box-shadow: var(--bs-elevation-2);
}

.tasks-container .table {
    --bs-table-bg: transparent;
}

.tasks-container .table-dark {
    --bs-table-bg: var(--bs-gray-800);
    --bs-table-color: var(--bs-gray-100);
}

.tasks-container .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.5rem;
}

.tasks-container .btn-group-sm .btn {
    padding: 0.25rem 0.375rem;
    font-size: 0.75rem;
}

/* Task priority indicators */
.tasks-container .priority-dots {
    display: inline-flex;
    gap: 2px;
    align-items: center;
}

.tasks-container .priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.tasks-container .task-completed {
    opacity: 0.6;
    background-color: var(--bs-gray-50);
}

.tasks-container .task-completed td {
    color: var(--bs-gray-600) !important;
}

.tasks-container .task-completed .fw-medium {
    text-decoration: line-through;
    font-weight: normal !important;
}

.tasks-container .task-completed .badge {
    opacity: 0.7;
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .tasks-container .task-completed {
    background-color: var(--bs-gray-800);
}

[data-bs-theme="dark"] .tasks-container .task-completed td {
    color: var(--bs-gray-500) !important;
}

/* Hover effect for completed tasks */
.tasks-container .task-completed:hover {
    opacity: 0.8;
    background-color: var(--bs-gray-100);
}

[data-bs-theme="dark"] .tasks-container .task-completed:hover {
    background-color: var(--bs-gray-700);
}

.tasks-container .priority-high { background-color: #dc3545; }
.tasks-container .priority-medium { background-color: #ffc107; }
.tasks-container .priority-low { background-color: #198754; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .tasks-container .table-responsive {
        font-size: 0.875rem;
    }
    
    .tasks-container .btn-group-sm .btn {
        padding: 0.125rem 0.25rem;
    }
}

/* Attachment modal styles */
.attachments-modal .list-group-item {
    border-left: 3px solid var(--bs-primary);
    margin-bottom: 0.5rem;
    border-radius: 0.375rem;
}

.attachments-modal .list-group-item:hover {
    background-color: var(--bs-gray-50);
}

[data-bs-theme="dark"] .attachments-modal .list-group-item:hover {
    background-color: var(--bs-gray-800);
}

/* Code display styling */
code.user-select-all {
    user-select: all;
    word-break: break-all;
    white-space: pre-wrap;
}

/* Enhanced task row styles */
.tasks-container .table tbody tr.has-attachments {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.tasks-container .table tbody tr.has-attachments:hover {
    background-color: var(--bs-primary-bg-subtle) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

[data-bs-theme="dark"] .tasks-container .table tbody tr.has-attachments:hover {
    background-color: rgba(77, 194, 255, 0.1) !important;
}

/* Attachment indicator styling */
.attachment-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.attachment-indicator .bi-paperclip {
    font-size: 1.1rem;
}

.attachment-indicator .badge {
    font-size: 0.7rem;
    min-width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Hover effect for attachment rows */
.tasks-container .table tbody tr.has-attachments {
    position: relative;
}

.tasks-container .table tbody tr.has-attachments::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--bs-primary);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tasks-container .table tbody tr.has-attachments:hover::before {
    opacity: 1;
}

/* Ensure completed tasks with attachments still show hover effect */
.tasks-container .task-completed.has-attachments:hover {
    opacity: 0.9 !important;
}

/* Attachment column header improvement */
.tasks-container .table thead th:nth-child(7) {
    text-align: center;
}      

