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

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

.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-tabs {
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1rem;
}

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

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

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

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

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

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

.workplace-compose-textarea {
    flex: 1;
    min-height: 300px;
    max-height: calc(100vh - 300px);
    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;
}

.workplace-compose .EasyMDEContainer .CodeMirror {
    flex: 1;
    min-height: 250px;
    max-height: calc(100vh - 350px);
    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;
}

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