/* =================================================================
 * WORKPLACE CSS - Idea Management Styles
 * FEATURE-008: Workplace (Idea Management)
 * ================================================================= */

/* =================================================================
 * WORKPLACE CONTAINER
 * ================================================================= */
.workplace-container {
    display: flex;
    height: 100%;
    width: 100%;
}

/* =================================================================
 * WORKPLACE SIDEBAR
 * ================================================================= */
.workplace-sidebar {
    width: 48px;
    min-width: 48px;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.2s ease, min-width 0.2s ease;
}

.workplace-sidebar:hover,
.workplace-sidebar.expanded,
.workplace-sidebar.pinned {
    width: 280px;
    min-width: 280px;
}

.workplace-sidebar-icons {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    gap: 4px;
}

.workplace-sidebar-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.15s;
    border: none;
    background: none;
}

.workplace-sidebar-icon:hover {
    background-color: #e9ecef;
    color: #0d6efd;
}

.workplace-sidebar-icon.active {
    background-color: #0d6efd;
    color: #fff;
}

.workplace-sidebar-icon i {
    font-size: 1.1rem;
}

.workplace-sidebar-content {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.workplace-sidebar:hover .workplace-sidebar-content,
.workplace-sidebar.expanded .workplace-sidebar-content,
.workplace-sidebar.pinned .workplace-sidebar-content {
    display: flex;
}

.workplace-sidebar:hover .workplace-sidebar-icons,
.workplace-sidebar.expanded .workplace-sidebar-icons,
.workplace-sidebar.pinned .workplace-sidebar-icons {
    display: none;
}

/* Sidebar header with pin button */
.workplace-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.workplace-sidebar-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #495057;
}

.workplace-sidebar-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.workplace-create-folder-btn,
.workplace-collapse-all-btn,
.workplace-pin-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.15s;
}

.workplace-create-folder-btn:hover,
.workplace-collapse-all-btn:hover,
.workplace-pin-btn:hover {
    background-color: #e9ecef;
    color: #0d6efd;
}

.workplace-sidebar.pinned .workplace-pin-btn {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
}

.workplace-upload-btn {
    margin: 12px;
    flex-shrink: 0;
}

/* =================================================================
 * WORKPLACE TREE
 * ================================================================= */
.workplace-tree {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 8px;
}

.workplace-tree-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.workplace-tree-item {
    cursor: pointer;
}

.workplace-tree-item-content {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: background-color 0.15s;
}

.workplace-tree-item-content:hover {
    background-color: #e9ecef;
}

.workplace-tree-item-content i {
    color: #6c757d;
    flex-shrink: 0;
}

.workplace-tree-item.has-children > ul {
    display: none;
}

.workplace-tree-item.has-children.expanded > ul {
    display: block;
}

.workplace-tree-item.has-children > .workplace-tree-item-content::before {
    content: '\F229';
    font-family: 'bootstrap-icons';
    font-size: 0.7rem;
    margin-right: 2px;
    transition: transform 0.15s;
}

.workplace-tree-item.has-children.expanded > .workplace-tree-item-content::before {
    transform: rotate(90deg);
}

.workplace-tree-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* Highlighted parent folder when file is being previewed */
.workplace-tree-item.folder-highlighted > .workplace-tree-item-content {
    background-color: rgba(255, 193, 7, 0.15);
}

.workplace-tree-item.folder-highlighted > .workplace-tree-item-content > i.bi-folder-fill {
    color: #ffc107 !important;
}

/* =================================================================
 * WORKPLACE TREE ACTIONS
 * ================================================================= */
.workplace-tree-actions {
    display: none;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

.workplace-tree-item-content:hover .workplace-tree-actions {
    display: flex;
}

.workplace-tree-action-btn {
    background: none;
    border: none;
    padding: 2px 5px;
    cursor: pointer;
    opacity: 0.6;
    font-size: 0.75rem;
    border-radius: 3px;
    transition: all 0.15s;
}

.workplace-tree-action-btn:hover {
    opacity: 1;
}

.workplace-tree-download-btn {
    color: #0d6efd;
}

.workplace-tree-download-btn:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

.workplace-tree-rename-btn {
    color: #6c757d;
}

.workplace-tree-rename-btn:hover {
    background-color: rgba(108, 117, 125, 0.1);
    color: #495057;
}

.workplace-tree-delete-btn {
    color: #dc3545;
}

.workplace-tree-delete-btn:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

.workplace-tree-add-btn {
    color: #198754;
}

.workplace-tree-add-btn:hover {
    background-color: rgba(25, 135, 84, 0.1);
}

.workplace-rename-input {
    border: 1px solid #007bff;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 0.85rem;
    width: 100%;
    outline: none;
}

/* =================================================================
 * WORKPLACE CONTENT AREA
 * ================================================================= */
.workplace-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #fff;
}

.workplace-placeholder,
.workplace-empty,
.workplace-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
    text-align: center;
    padding: 2rem;
}

.workplace-placeholder i,
.workplace-empty i,
.workplace-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.workplace-error i {
    color: #dc3545;
}

/* =================================================================
 * WORKPLACE EDITOR
 * ================================================================= */
.workplace-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* EasyMDE in workplace editor (edit mode) */
.workplace-editor .EasyMDEContainer {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.workplace-editor .EasyMDEContainer .CodeMirror {
    flex: 1;
    min-height: 200px;
    overflow-y: auto !important;
}

.workplace-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.workplace-editor-path {
    font-size: 0.85rem;
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workplace-editor-status {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.workplace-editor-status i.spin {
    animation: spin 1s linear infinite;
}

.workplace-editor-textarea {
    flex: 1;
    width: 100%;
    border: none;
    padding: 12px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    overflow-y: auto;
}

.workplace-editor-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.workplace-editor-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.workplace-cancel-btn {
    font-size: 0.8rem;
    padding: 4px 12px;
}

/* Edit hint for double-click */
.workplace-edit-hint-container {
    padding: 4px 16px 8px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.workplace-edit-hint {
    font-size: 0.75rem;
    opacity: 0.7;
}

.workplace-content-body[title]:not([title=""]) {
    cursor: pointer;
}

/* Workplace Content Body (view mode) */
.workplace-content-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* When content body contains HTML/image preview, make it flex and remove padding */
.workplace-content-body:has(.workplace-preview),
.workplace-content-body:has(.workplace-image-preview) {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.workplace-markdown-content {
    max-width: 900px;
}

.workplace-code-content {
    margin: 0;
    padding: 16px;
    background-color: #f6f8fa;
    border-radius: 6px;
    overflow-x: auto;
}

.workplace-code-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.workplace-text-content {
    margin: 0;
    padding: 16px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Workplace Binary Placeholder */
.workplace-binary-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
    color: #6c757d;
}

.workplace-binary-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.workplace-binary-placeholder h5 {
    margin-bottom: 0.5rem;
    color: #495057;
}

/* =================================================================
 * WORKPLACE PREVIEW MODE
 * ================================================================= */
.workplace-preview {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
}

.workplace-preview-toolbar {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.workplace-preview-iframe {
    flex: 1;
    width: 100%;
    border: none;
    background: white;
    min-height: 300px;
}

.workplace-preview-content {
    flex: 1;
    overflow: auto;
    padding: 1.5rem;
    background: white;
}

/* =================================================================
 * WORKPLACE TABS & UPLOADER
 * ================================================================= */
.workplace-uploader {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem;
}

.workplace-target-folder {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    background-color: #e7f3ff;
    border: 1px solid #b6d4fe;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #0a58ca;
}

.workplace-target-folder i {
    color: #0d6efd;
}

.workplace-target-folder strong {
    font-weight: 600;
}

.workplace-clear-target {
    margin-left: auto;
    padding: 0;
    color: #6c757d;
    text-decoration: none;
}

.workplace-clear-target:hover {
    color: #dc3545;
}

.workplace-tabs {
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.workplace-tabs .nav-link {
    color: #6c757d;
    border: none;
    padding: 0.75rem 1.25rem;
}

.workplace-tabs .nav-link:hover {
    border: none;
    color: #007bff;
    background: none;
}

.workplace-tabs .nav-link.active {
    color: #007bff;
    border: none;
    border-bottom: 2px solid #007bff;
    background: none;
}

.workplace-tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.workplace-tab-content .tab-pane {
    flex: 1;
    display: none;
    flex-direction: column;
    min-height: 0;
}

.workplace-tab-content .tab-pane.active {
    display: flex;
}

/* =================================================================
 * WORKPLACE COMPOSE AREA
 * ================================================================= */
.workplace-compose {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
    min-height: 0;
}

.workplace-compose-textarea {
    flex: 1;
    min-height: 100px;
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    overflow-y: auto;
}

.workplace-compose-textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

.workplace-compose-textarea::placeholder {
    color: #adb5bd;
}

/* EasyMDE Markdown Editor Customizations */
.workplace-compose .EasyMDEContainer {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.workplace-compose .EasyMDEContainer .CodeMirror {
    flex: 1;
    min-height: 100px;
    border-radius: 0 0 8px 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    overflow-y: auto !important;
}

.workplace-compose .editor-toolbar {
    border-radius: 8px 8px 0 0;
    background: #f8f9fa;
}

.workplace-compose .editor-preview {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 1rem;
}

.workplace-compose .editor-preview pre code {
    background: #f6f8fa;
    border-radius: 4px;
    padding: 0.5rem;
    display: block;
}

.workplace-compose-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* CR-004: KB Reference button and count label (in tab bar) */
.workplace-kb-ref-area {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.25rem 0;
}

.workplace-kb-ref-btn {
    border: none;
    background: none;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.workplace-kb-ref-btn:hover {
    background: none;
    color: #334155;
}

.workplace-kb-ref-count {
    background: #10b981;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    padding: 0 6px;
    cursor: pointer;
}

.workplace-kb-ref-popup {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 100;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 8px;
    min-width: 220px;
    max-height: 200px;
    overflow-y: auto;
}

.workplace-kb-ref-popup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 4px 6px;
    font-size: 0.8rem;
    color: #212529;
    border-radius: 4px;
}

.workplace-kb-ref-popup-item:hover {
    background: #f8fafc;
}

.workplace-kb-ref-popup-item button {
    border: none;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    line-height: 1;
}

.workplace-kb-ref-popup-item button:hover {
    color: #ef4444;
}

.workplace-kb-ref-clear {
    border-top: 1px solid #e2e8f0;
    margin-top: 2px;
    padding-top: 2px;
    text-align: right;
}

.workplace-kb-ref-clear-btn {
    border: none;
    background: none;
    color: #ef4444;
    font-size: 10px;
    cursor: pointer;
    padding: 2px 4px;
}

/* =================================================================
 * WORKPLACE UPLOAD DROPZONE
 * ================================================================= */
#upload-pane {
    align-items: center;
    justify-content: center;
    padding-top: 2rem;
}

.workplace-dropzone {
    width: 100%;
    max-width: 500px;
    padding: 3rem 2rem;
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.workplace-dropzone:hover,
.workplace-dropzone.dragover {
    border-color: #007bff;
    background-color: #f0f7ff;
}

.workplace-dropzone i {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.workplace-dropzone.dragover i {
    color: #007bff;
}

.workplace-dropzone.uploading {
    pointer-events: none;
    opacity: 0.6;
}

.workplace-upload-status {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
}

.workplace-supported-formats {
    width: 100%;
    max-width: 500px;
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

/* =================================================================
 * FORMAT TAGS
 * ================================================================= */
.format-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.format-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.format-tag-docs {
    background-color: #d4edda;
    color: #155724;
}

.format-tag-data {
    background-color: #fff3cd;
    color: #856404;
}

.format-tag-code {
    background-color: #cce5ff;
    color: #004085;
}

.format-tag-image {
    background-color: #f8d7da;
    color: #721c24;
}

/* =================================================================
 * CR-002: FOLDER DROP TARGET STYLES
 * ================================================================= */
.idea-folder-node {
    transition: background-color 0.2s, outline 0.2s;
}

.idea-folder-node.drop-target {
    background-color: rgba(13, 110, 253, 0.1);
    outline: 2px dashed var(--bs-primary, #0d6efd);
    outline-offset: -2px;
    border-radius: 4px;
}

.idea-folder-node.drop-target .bi-folder,
.idea-folder-node.drop-target .bi-folder2 {
    color: var(--bs-primary, #0d6efd);
}

/* =================================================================
 * IMAGE PREVIEW
 * ================================================================= */
.workplace-image-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 1rem;
    background: #f8f9fa;
}

.workplace-preview-img {
    max-width: 100%;
    max-height: calc(100vh - 200px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* =================================================================
 * COPILOT BUTTON DROPDOWN
 * ================================================================= */
.copilot-btn-container {
    position: relative;
    display: inline-block;
}

.copilot-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    padding: 6px 0;
    margin-top: 4px;
}

.copilot-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.copilot-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #495057;
    transition: background-color 0.1s;
}

.copilot-dropdown-item:hover {
    background-color: #f0f7ff;
    color: #0d6efd;
}

.copilot-dropdown-item i {
    font-size: 1rem;
    color: #6c757d;
    width: 20px;
    text-align: center;
}

.copilot-dropdown-item:hover i {
    color: #0d6efd;
}

/* =================================================================
 * CODEMIRROR SEARCH DIALOG STYLES
 * ================================================================= */
.CodeMirror-dialog {
    position: absolute;
    left: 0;
    right: 0;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 8px 12px;
    z-index: 1050;
    font-size: 14px;
}

.CodeMirror-dialog-top {
    top: 0;
}

.CodeMirror-dialog-bottom {
    bottom: 0;
}

.CodeMirror-dialog input {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 4px 8px;
    margin-right: 8px;
    font-size: 14px;
    outline: none;
}

.CodeMirror-dialog input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.CodeMirror-dialog button {
    background: #0d6efd;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 14px;
}

.CodeMirror-dialog button:hover {
    background: #0b5ed7;
}

.CodeMirror-search-hint {
    color: #6c757d;
    font-size: 12px;
    margin-left: 8px;
}


/* =================================================================
 * CR-006: FOLDER TREE UX ENHANCEMENT STYLES
 * ================================================================= */

/* Design system variables for CR-006 */
:root {
    --cr006-color-primary: #0f172a;
    --cr006-color-secondary: #475569;
    --cr006-color-accent: #10b981;
    --cr006-color-accent-light: #d1fae5;
    --cr006-color-border: #e2e8f0;
    --cr006-color-bg: #f8fafc;
    --cr006-color-error: #ef4444;
    --cr006-color-error-light: #fee2e2;
    --cr006-radius-sm: 4px;
    --cr006-radius-md: 8px;
    --cr006-radius-lg: 12px;
}

/* =================================================================
 * TREE SEARCH BAR
 * ================================================================= */
.tree-search-container {
    padding: 8px 12px;
    border-bottom: 1px solid var(--cr006-color-border);
}

.tree-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.tree-search-icon {
    position: absolute;
    left: 10px;
    color: var(--cr006-color-secondary);
    font-size: 14px;
    pointer-events: none;
}

.tree-search-input {
    width: 100%;
    padding: 6px 32px 6px 32px;
    border: 1px solid var(--cr006-color-border);
    border-radius: var(--cr006-radius-md);
    font-size: 13px;
    background: white;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tree-search-input:focus {
    outline: none;
    border-color: var(--cr006-color-accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.tree-search-input::placeholder {
    color: #94a3b8;
}

.tree-search-clear {
    position: absolute;
    right: 6px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--cr006-color-secondary);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s ease;
}

.tree-search-clear:hover {
    background: var(--cr006-color-border);
    color: var(--cr006-color-primary);
}

/* Search result highlighting */
.tree-item.search-match .tree-label {
    background: linear-gradient(transparent 60%, #fef08a 60%);
}

.tree-item.search-parent {
    opacity: 0.7;
}

/* =================================================================
 * DRAG-DROP STATES
 * ================================================================= */
.tree-item.dragging {
    opacity: 0.5;
}

.tree-item.drag-over {
    background: var(--cr006-color-accent-light) !important;
    border: 2px dashed var(--cr006-color-accent) !important;
    border-radius: var(--cr006-radius-md);
}

.tree-item.drag-invalid {
    background: var(--cr006-color-error-light) !important;
    border: 2px solid var(--cr006-color-error) !important;
    border-radius: var(--cr006-radius-md);
}

.tree-item.moving {
    opacity: 0.6;
    pointer-events: none;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* =================================================================
 * FOLDER VIEW BUTTON ON TREE ITEMS
 * ================================================================= */
.tree-folder-view-btn {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--cr006-color-secondary);
    border-radius: var(--cr006-radius-sm);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
    margin-left: auto;
    flex-shrink: 0;
}

.tree-item:hover .tree-folder-view-btn {
    opacity: 1;
}

.tree-folder-view-btn:hover {
    background: var(--cr006-color-accent);
    color: white;
}

/* =================================================================
 * FOLDER VIEW PANEL
 * ================================================================= */
.folder-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
}

.folder-view-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--cr006-color-border);
    background: var(--cr006-color-bg);
}

.folder-view-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.folder-view-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--cr006-color-secondary);
    border-radius: var(--cr006-radius-sm);
    cursor: pointer;
    transition: background 0.15s ease;
}

.folder-view-close:hover {
    background: var(--cr006-color-border);
}

/* Breadcrumb */
.folder-view-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 14px;
}

.breadcrumb-item {
    color: var(--cr006-color-secondary);
    padding: 2px 4px;
    border-radius: var(--cr006-radius-sm);
}

.breadcrumb-item.clickable {
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.breadcrumb-item.clickable:hover {
    color: var(--cr006-color-accent);
    background: var(--cr006-color-accent-light);
}

.breadcrumb-item.current {
    color: var(--cr006-color-primary);
    font-weight: 500;
}

.breadcrumb-sep {
    color: #cbd5e1;
    font-size: 12px;
}

/* Action bar */
.folder-view-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.folder-view-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--cr006-color-border);
    background: white;
    color: var(--cr006-color-primary);
    border-radius: var(--cr006-radius-md);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.folder-view-action-btn:hover {
    border-color: var(--cr006-color-accent);
    color: var(--cr006-color-accent);
}

.folder-view-action-btn.danger:hover {
    border-color: var(--cr006-color-error);
    color: var(--cr006-color-error);
}

.folder-view-action-btn i {
    font-size: 14px;
}

/* Content area */
.folder-view-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.folder-view-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: var(--cr006-color-secondary);
    text-align: center;
}

.folder-view-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #cbd5e1;
}

.folder-view-empty p {
    margin: 0 0 8px 0;
}

/* Item list */
.folder-view-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.folder-view-item {
    border-radius: var(--cr006-radius-md);
    transition: background 0.15s ease;
}

.folder-view-item-main {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    gap: 10px;
    cursor: pointer;
    border-radius: var(--cr006-radius-md);
}

.folder-view-item-main:hover {
    background: var(--cr006-color-bg);
}

.folder-view-item-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--cr006-color-secondary);
    border-radius: var(--cr006-radius-sm);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.folder-view-item.expanded .folder-view-item-toggle {
    transform: rotate(90deg);
}

.folder-view-item-spacer {
    width: 20px;
}

.folder-view-item-icon {
    font-size: 18px;
    color: var(--cr006-color-secondary);
    flex-shrink: 0;
}

.folder-view-item-icon.folder-icon {
    color: #f59e0b;
}

.folder-view-item-name {
    flex: 1;
    font-size: 14px;
    color: var(--cr006-color-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-view-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.folder-view-item-main:hover .folder-view-item-actions {
    opacity: 1;
}

.folder-view-item-action {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--cr006-color-secondary);
    border-radius: var(--cr006-radius-sm);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.folder-view-item-action:hover {
    background: var(--cr006-color-border);
    color: var(--cr006-color-primary);
}

.folder-view-item-action.danger:hover {
    background: var(--cr006-color-error-light);
    color: var(--cr006-color-error);
}

/* TASK-240: Into folder button - always visible with primary color */
.folder-view-item-action.into-btn {
    color: var(--cr006-color-accent);
}

.folder-view-item-action.into-btn:hover {
    background: var(--cr006-color-accent);
    color: white;
}

/* Nested children */
.folder-view-item-children {
    display: none;
    padding-left: 24px;
}

.folder-view-item.expanded > .folder-view-item-children {
    display: block;
}

/* TASK-241: Drag and drop styles */
.folder-view-item.dragging {
    opacity: 0.5;
}

.folder-view-item.drop-target > .folder-view-item-main {
    background: var(--cr006-color-accent-light, rgba(59, 130, 246, 0.1));
    border: 2px dashed var(--cr006-color-accent);
    border-radius: var(--cr006-radius-sm);
}

.folder-view-content.drop-target-zone {
    background: var(--cr006-color-accent-light, rgba(59, 130, 246, 0.05));
    border: 2px dashed var(--cr006-color-accent);
    border-radius: var(--cr006-radius-sm);
}

/* Error state */
.folder-view-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--cr006-color-error);
    text-align: center;
}

.folder-view-error i {
    font-size: 48px;
    margin-bottom: 16px;
}

/* TASK-241: Drag and drop styles for folder view */
.folder-view-item.dragging {
    opacity: 0.5;
    background-color: #e3f2fd;
}

.folder-view-item.drop-target {
    background-color: #e8f5e9;
    border: 2px dashed #4caf50;
    border-radius: 6px;
}

.folder-view-item.drop-target > .folder-view-item-main {
    background-color: transparent;
}

.folder-view-content.drop-target-zone {
    background-color: #e8f5e9;
    border: 2px dashed #4caf50;
    border-radius: 6px;
}

/* TASK-240: "Into" button styling */
.folder-view-item-action.into-btn {
    color: #0d6efd;
}

.folder-view-item-action.into-btn:hover {
    background-color: #e7f1ff;
    color: #0a58ca;
}

/* =================================================================
 * CONFIRM DIALOG
 * ================================================================= */
.confirm-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.confirm-dialog-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.confirm-dialog {
    background: white;
    border-radius: var(--cr006-radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 400px;
    width: 90%;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.confirm-dialog-overlay.visible .confirm-dialog {
    transform: scale(1);
}

.confirm-dialog-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--cr006-color-border);
}

.confirm-dialog-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--cr006-color-primary);
}

.confirm-dialog-body {
    padding: 20px;
}

.confirm-dialog-message {
    margin: 0;
    font-size: 14px;
    color: var(--cr006-color-secondary);
    line-height: 1.5;
}

.confirm-dialog-details {
    margin-top: 12px;
}

.confirm-dialog-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: #fef3c7;
    border-radius: var(--cr006-radius-md);
    color: #92400e;
    font-size: 13px;
    margin: 0;
}

.confirm-dialog-warning i {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.confirm-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--cr006-color-border);
}

.confirm-dialog-btn {
    padding: 8px 16px;
    border-radius: var(--cr006-radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.confirm-dialog-btn.cancel-btn {
    border: 1px solid var(--cr006-color-border);
    background: white;
    color: var(--cr006-color-secondary);
}

.confirm-dialog-btn.cancel-btn:hover {
    background: var(--cr006-color-bg);
}

.confirm-dialog-btn.confirm-btn {
    border: none;
    background: var(--cr006-color-accent);
    color: white;
}

.confirm-dialog-btn.confirm-btn:hover {
    background: #059669;
}

.confirm-dialog-btn.confirm-btn.danger {
    background: var(--cr006-color-error);
}

.confirm-dialog-btn.confirm-btn.danger:hover {
    background: #dc2626;
}

.confirm-dialog-btn.confirm-btn.primary {
    background: #3b82f6;
}

.confirm-dialog-btn.confirm-btn.primary:hover {
    background: #2563eb;
}
