/* Modern BIM Tree View Styles */
.bim-tree-view {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex-shrink: 0;
}

.bim-tree-view ul {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.bim-tree-view li {
    position: relative;
    padding: 0;
    margin: 0;
}

/* Tree list container */
.tree-list {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.tree-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.tree-list li {
    position: relative;
    padding: 0;
    margin: 0;
}

/* Tree node container */
.tree-node {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    min-height: 40px;
    display: block;
    flex-shrink: 0;
}

.tree-node:hover {
    background-color: #f8f9fa;
}

.tree-node.selected {
    background-color: #e3f2fd;
    border-left: 3px solid #2196f3;
}

.tree-node-container {
    display: flex;
    align-items: center;
    position: relative;
    flex-shrink: 0;
    min-width: 0;
}

/* Indentation and connecting lines */
.tree-node::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #e0e0e0;
}

.tree-node:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 20px;
    height: 1px;
    background: #e0e0e0;
}

/* Expand/collapse button */
.expand-btn {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    color: #666;
    font-size: 12px;
}

.expand-btn:hover {
    background-color: #f0f0f0;
}

.expand-btn.expanded::before {
    content: '▼';
    font-size: 10px;
    color: #666;
}

.expand-btn.collapsed::before {
    content: '▶';
    font-size: 10px;
    color: #666;
}

/* Checkbox styling */
.tree-node input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #2196f3;
}

/* Node icon */
.node-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    font-size: 12px;
}

.node-icon.project {
    background: #2196f3;
    color: white;
}

.node-icon.site {
    background: #4caf50;
    color: white;
}

.node-icon.building {
    background: #2196f3;
    color: white;
}

.node-icon.level {
    background: #ff9800;
    color: white;
}

.node-icon.room {
    background: #9c27b0;
    color: white;
}

.node-icon.stairs {
    background: #795548;
    color: white;
}

.node-icon.structural {
    background: #607d8b;
    color: white;
}

.node-icon.default {
    background: #e0e0e0;
    color: #666;
}

/* Node title */
.node-title {
    flex: 1;
    font-weight: 500;
    color: #333;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    max-width: 150px;
}

.node-title:hover {
    color: #2196f3;
}

/* Children container */
/* Children container - consolidated with animation rules below */

.children ul {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.children li {
    position: relative;
    padding: 0;
    margin: 0;
}

.children::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #e0e0e0;
}

/* Hidden state */
.tree-node.hidden {
    opacity: 0.5;
}

.tree-node.hidden .node-title {
    text-decoration: line-through;
    color: #999;
}

/* Highlighted state */
.tree-node.highlighted {
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
}

/* X-ray state */
.tree-node.xrayed {
    opacity: 0.7;
}

/* Empty state */
.bim-tree-view .empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Animation for expand/collapse */
.children {
    transition: all 0.3s ease;
    margin-left: 20px;
    position: relative;
    overflow: hidden;
    width: 100%;
    display: block;
}

.children.collapsed {
    display: none !important;
}

.children:not(.collapsed) {
    display: block !important;
}

/* Modern scrollbar */
.bim-tree-view::-webkit-scrollbar {
    width: 6px;
}

.bim-tree-view::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.bim-tree-view::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.bim-tree-view::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
} 

/* Modern Floating Properties Modal */
.bim-properties-panel {
    position: fixed !important;
    top: 20px !important;
    right: -160px !important;
    width: 140px !important;
    max-height: 200px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(8px) !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    z-index: 1000 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.bim-properties-panel.active {
    right: 20px !important;
}

.bim-properties-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #2c3e50 !important;
    color: white !important;
    position: relative;
}

.bim-properties-header h3 {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    color: white;
    position: relative;
    z-index: 1;
}

.bim-properties-close {
    background: rgba(255, 255, 255, 0.1) !important;
    border: none;
    font-size: 18px;
    color: white;
    cursor: pointer;
    padding: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.bim-properties-close:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.1);
}

.bim-properties-content {
    padding: 8px;
    max-height: calc(200px - 30px);
    overflow-y: auto;
}

.bim-property-group {
    margin-bottom: 6px;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 6px;
    border-left: 2px solid #2c3e50;
}

.bim-property-group h4 {
    margin: 0 0 4px 0;
    font-size: 10px;
    color: #333;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.bim-property-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.bim-property-item:last-child {
    border-bottom: none;
}

.bim-property-label {
    font-weight: 500;
    color: #666;
    min-width: 60px;
    margin-right: 8px;
}

.bim-property-value {
    color: #333;
    text-align: right;
    word-break: break-word;
    max-width: 60px;
    font-weight: 600;
}

.bim-property-empty {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
    font-size: 13px;
}

.bim-property-error {
    color: #dc3545;
    text-align: center;
    padding: 20px;
    font-weight: 600;
    font-size: 13px;
}

#properties-loading {
    text-align: center;
    padding: 30px;
    color: #666;
    font-style: italic;
    font-size: 13px;
}

/* Clean modern styling */
.property-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #2c3e50;
    color: white;
}

.priority-high,
.priority-medium,
.priority-low {
    color: #2c3e50;
    font-weight: 600;
}

/* Modern Compact BIM Toolbar - Positioned in top-right of viewer */
.bim-toolbar-compact {
    position: absolute;
    right: 50%;
    top: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    padding: 8px;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-shrink: 0;
}

.bim-tool-compact {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(44, 62, 80, 0.1);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    color: #2c3e50;
    flex-shrink: 0;
}

.bim-tool-compact:hover {
    background: rgba(44, 62, 80, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.2);
}

.bim-tool-compact.active {
    background: #2c3e50;
    color: white;
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

.bim-tool-compact svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.bim-tool-compact .tooltip {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.bim-tool-compact:hover .tooltip {
    opacity: 1;
}

.bim-tool-compact .tooltip::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-bottom-color: #2c3e50;
}

/* Tree search highlighting */
.tree-search-highlight {
    background-color: rgba(255, 193, 7, 0.3) !important;
    border-left: 3px solid #ffc107 !important;
}

.tree-search-highlight .node-title {
    font-weight: 700 !important;
    color: #2c3e50 !important;
}

/* Fix header shrinking */
.h-14 {
    flex-shrink: 0 !important;
}

.flex.items-center.justify-between {
    flex-shrink: 0 !important;
}

.flex.space-x-2 {
    flex-shrink: 0 !important;
}

button[data-panel] {
    flex-shrink: 0 !important;
    min-width: fit-content !important;
}

/* BIM Comment System Styles */
.bim-comment-panel {
    position: fixed !important;
    top: 70% !important;
    right: -280px !important;
    transform: translateY(-50%) !important;
    width: 220px !important;
    max-height: 50vh !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    z-index: 1000 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    display: flex !important;
    flex-direction: column !important;
}

.bim-comment-panel.active {
    right: 20px !important;
}

.bim-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #f8f9fa !important;
    color: #333 !important;
    position: relative;
    flex-shrink: 0;
    border-bottom: 1px solid #e0e0e0;
}

.bim-comment-header h3 {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    color: #333;
}

.bim-comment-close {
    background: rgba(0, 0, 0, 0.05) !important;
    border: none;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    padding: 2px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.bim-comment-close:hover {
    background: rgba(0, 0, 0, 0.1) !important;
}

.bim-comment-content {
    padding: 8px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.bim-comment-list {
    margin-bottom: 16px;
}

.bim-comment-item {
    background: #fff;
    border-radius: 4px;
    padding: 6px 8px;
    margin-bottom: 4px;
    border-left: 2px solid #2196f3;
    border: 1px solid #e0e0e0;
    border-left: 2px solid #2196f3;
}

.bim-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.bim-comment-time {
    font-size: 8px;
    color: #999;
}

.bim-comment-actions {
    display: flex;
    gap: 4px;
}

.bim-comment-edit,
.bim-comment-delete {
    background: none;
    border: none;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.bim-comment-edit {
    color: #2196f3;
}

.bim-comment-delete {
    color: #f44336;
}

.bim-comment-edit:hover {
    background: rgba(33, 150, 243, 0.1);
}

.bim-comment-delete:hover {
    background: rgba(244, 67, 54, 0.1);
}

.bim-comment-text {
    font-size: 10px;
    color: #333;
    line-height: 1.2;
}

.bim-comment-content {
    margin-bottom: 4px;
}

.bim-comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 8px;
    color: #999;
}

.bim-comment-footer {
    border-top: 1px solid #e0e0e0;
    padding: 8px;
    background: #f8f9fa;
    flex-shrink: 0;
}

.bim-comment-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    transition: opacity 0.3s ease;
}

.bim-comment-form textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 10px;
    resize: none;
    min-height: 32px;
    font-family: inherit;
    box-sizing: border-box;
}

/* Loading Indicator Styles */
.bim-loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.bim-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2196f3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.bim-loading-indicator span {
    font-size: 10px;
    color: #666;
    font-weight: 500;
}

/* File Upload Styles */
.bim-file-upload {
    margin-bottom: 0;
}

.bim-file-label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #f8f9fa;
    border: 1px dashed #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    color: #666;
    transition: all 0.2s ease;
}

.bim-file-label:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.bim-file-label svg {
    color: #2196f3;
}

#comment-files {
    display: none;
}

.bim-file-list {
    margin-top: 8px;
}

.bim-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 11px;
}

.bim-file-name {
    color: #333;
    flex: 1;
    margin-right: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bim-file-remove {
    background: none;
    border: none;
    color: #f44336;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bim-file-remove:hover {
    background: rgba(244, 67, 54, 0.1);
    border-radius: 50%;
}

/* Comment Files Display */
.bim-comment-files {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.bim-comment-file {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 11px;
    color: #666;
}

.bim-comment-file svg {
    color: #2196f3;
}

.bim-no-comments {
    text-align: center;
    color: #999;
    font-size: 13px;
    padding: 20px;
    font-style: italic;
}

/* BIM Approval Modal Styles */
.bim-approval-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 2000 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
}

.bim-approval-modal.active {
    display: flex !important;
}

.bim-modal-backdrop {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(4px) !important;
}

.bim-modal-content {
    position: relative !important;
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2) !important;
    width: 400px !important;
    max-width: 90vw !important;
    max-height: 80vh !important;
    overflow: hidden !important;
    transform: scale(0.9) !important;
    opacity: 0 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.bim-approval-modal.active .bim-modal-content {
    transform: scale(1) !important;
    opacity: 1 !important;
}

.bim-modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px 24px !important;
    border-bottom: 1px solid #e0e0e0 !important;
    background: #f8f9fa !important;
}

.bim-modal-title {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #333 !important;
}

.bim-modal-close {
    background: none !important;
    border: none !important;
    font-size: 24px !important;
    color: #666 !important;
    cursor: pointer !important;
    padding: 4px !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}

.bim-modal-close:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    color: #333 !important;
}

.bim-modal-body {
    padding: 24px !important;
}

.bim-project-info {
    margin-bottom: 24px !important;
}

.bim-info-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 0 !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.bim-info-item:last-child {
    border-bottom: none !important;
}

.bim-info-label {
    font-weight: 600 !important;
    color: #666 !important;
    font-size: 14px !important;
}

.bim-info-value {
    color: #333 !important;
    font-size: 14px !important;
}

.bim-approval-reasons {
    margin-bottom: 20px !important;
}

.bim-reasons-label {
    display: block !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #333 !important;
    margin-bottom: 8px !important;
}

.bim-reasons-textarea {
    width: 100% !important;
    padding: 12px !important;
    border: 1px solid #d0d0d0 !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    resize: vertical !important;
    min-height: 80px !important;
    transition: border-color 0.2s ease !important;
}

.bim-reasons-textarea:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.bim-approval-actions {
    display: flex !important;
    gap: 12px !important;
    justify-content: space-between !important;
}

.bim-approve-btn,
.bim-reject-btn {
    flex: 1 !important;
    padding: 12px 16px !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.2s ease !important;
}

.bim-approve-btn {
    background: #10b981 !important;
    color: white !important;
}

.bim-approve-btn:hover {
    background: #059669 !important;
    transform: translateY(-1px) !important;
}

.bim-reject-btn {
    background: #ef4444 !important;
    color: white !important;
}

.bim-reject-btn:hover {
    background: #dc2626 !important;
    transform: translateY(-1px) !important;
}

/* Result Modal Styles */
.bim-result-content {
    text-align: center !important;
    padding: 20px 0 !important;
}

.bim-result-icon {
    margin-bottom: 20px !important;
    display: flex !important;
    justify-content: center !important;
}

.bim-result-icon.animate {
    animation: resultPulse 1s ease-in-out !important;
}

@keyframes resultPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.bim-result-title {
    font-size: 20px !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    color: #333 !important;
}

.bim-result-description {
    font-size: 14px !important;
    color: #666 !important;
    line-height: 1.5 !important;
    margin-bottom: 24px !important;
}

.bim-result-actions {
    display: flex !important;
    gap: 12px !important;
    justify-content: center !important;
}

.bim-close-btn {
    padding: 10px 20px !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

/* Result Background Colors */
.bim-result-approved {
    background: #f0fdf4 !important;
    border: 1px solid #bbf7d0 !important;
}

.bim-result-rejected {
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
}

.bim-result-banned {
    background: #fff7ed !important;
    border: 1px solid #fed7aa !important;
}

/* Button Colors */
.bim-btn-green {
    background: #10b981 !important;
    color: white !important;
}

.bim-btn-green:hover {
    background: #059669 !important;
}

.bim-btn-red {
    background: #ef4444 !important;
    color: white !important;
}

.bim-btn-red:hover {
    background: #dc2626 !important;
}

.bim-btn-orange {
    background: #f97316 !important;
    color: white !important;
}

.bim-btn-orange:hover {
    background: #ea580c !important;
}

.bim-comment-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.bim-comment-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.bim-comment-btn.primary {
    background: #2196f3;
    color: white;
    border-color: #2196f3;
}

.bim-comment-btn:hover {
    background: #f0f0f0;
}

.bim-comment-btn.primary:hover {
    background: #1976d2;
}

/* Project Comment System Styles */
.file-upload-section {
    margin-bottom: 12px !important;
}

.file-upload-section label {
    display: inline-flex !important;
    align-items: center !important;
    padding: 6px 12px !important;
    background: #f3f4f6 !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.file-upload-section label:hover {
    background: #e5e7eb !important;
    border-color: #9ca3af !important;
}

#selectedFiles {
    max-height: 120px !important;
    overflow-y: auto !important;
}

#selectedFiles div {
    border: 1px solid #e5e7eb !important;
    border-radius: 4px !important;
}

#projectCommentText {
    font-family: inherit !important;
    line-height: 1.5 !important;
}

#submitProjectCommentBtn {
    font-size: 12px !important;
    padding: 8px 16px !important;
}

/* Dark mode adjustments */
.dark .file-upload-section label {
    background: #374151 !important;
    border-color: #4b5563 !important;
    color: #d1d5db !important;
}

.dark .file-upload-section label:hover {
    background: #4b5563 !important;
    border-color: #6b7280 !important;
}

.dark #selectedFiles div {
    border-color: #4b5563 !important;
}

/* Ensure big comment modal uses same styling as small comment box */
#commentsSidebar.bim-comment-panel {
    position: fixed !important;
    top: 50% !important;
    right: -480px !important;
    transform: translateY(-50%) !important;
    width: 480px !important;
    max-height: 80vh !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    z-index: 1000 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    display: flex !important;
    flex-direction: column !important;
}

#commentsSidebar.bim-comment-panel.active {
    right: 20px !important;
}

#commentsSidebar .bim-comment-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 6px 10px !important;
    background: #f8f9fa !important;
    color: #333 !important;
    position: relative !important;
    flex-shrink: 0 !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

#commentsSidebar .bim-comment-header h3 {
    margin: 0 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #333 !important;
}

#commentsSidebar .bim-comment-close {
    background: rgba(0, 0, 0, 0.05) !important;
    border: none !important;
    font-size: 16px !important;
    color: #666 !important;
    cursor: pointer !important;
    padding: 2px !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
}

#commentsSidebar .bim-comment-close:hover {
    background: rgba(0, 0, 0, 0.1) !important;
}

#commentsSidebar .bim-comment-content {
    padding: 8px !important;
    flex: 1 !important;
    overflow-y: auto !important;
    min-height: 0 !important;
}

#commentsSidebar .bim-comment-list {
    margin-bottom: 16px !important;
}

#commentsSidebar .bim-comment-item {
    background: #fff !important;
    border-radius: 4px !important;
    padding: 6px 8px !important;
    margin-bottom: 4px !important;
    border-left: 2px solid #2196f3 !important;
    border: 1px solid #e0e0e0 !important;
    border-left: 2px solid #2196f3 !important;
}

#commentsSidebar .bim-comment-footer {
    padding: 8px !important;
    border-top: 1px solid #e0e0e0 !important;
    background: #f8f9fa !important;
}

#commentsSidebar .bim-comment-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    position: relative !important;
    transition: opacity 0.3s ease !important;
}

#commentsSidebar .bim-loading-indicator {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    padding: 12px !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    z-index: 10 !important;
}

#commentsSidebar .bim-loading-spinner {
    width: 20px !important;
    height: 20px !important;
    border: 2px solid #f3f3f3 !important;
    border-top: 2px solid #2196f3 !important;
    border-radius: 50% !important;
    animation: spin 1s linear infinite !important;
}

#commentsSidebar .bim-loading-indicator span {
    font-size: 10px !important;
    color: #666 !important;
    font-weight: 500 !important;
}

#commentsSidebar .bim-file-upload {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

#commentsSidebar .bim-file-label {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    background: #f0f0f0 !important;
    border: 1px solid #d0d0d0 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    color: #666 !important;
    transition: all 0.2s ease !important;
}

#commentsSidebar .bim-file-label:hover {
    background: #e0e0e0 !important;
    border-color: #b0b0b0 !important;
}

#commentsSidebar .bim-file-label svg {
    width: 10px !important;
    height: 10px !important;
}

#commentsSidebar #commentFiles {
    display: none !important;
}

#commentsSidebar .bim-file-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    margin-top: 4px !important;
}

#commentsSidebar .bim-file-item {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    background: #f0f0f0 !important;
    border: 1px solid #d0d0d0 !important;
    border-radius: 3px !important;
    padding: 2px 6px !important;
    font-size: 10px !important;
    color: #666 !important;
}

#commentsSidebar .bim-file-name {
    max-width: 80px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#commentsSidebar .bim-file-remove {
    background: none !important;
    border: none !important;
    color: #999 !important;
    cursor: pointer !important;
    font-size: 12px !important;
    padding: 0 !important;
    width: 12px !important;
    height: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#commentsSidebar .bim-file-remove:hover {
    color: #666 !important;
}

#commentsSidebar #projectCommentText {
    width: 100% !important;
    padding: 6px 8px !important;
    border: 1px solid #d0d0d0 !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-family: inherit !important;
    resize: none !important;
    min-height: 32px !important;
    max-height: 80px !important;
    line-height: 1.4 !important;
}

#commentsSidebar #projectCommentText:focus {
    outline: none !important;
    border-color: #2196f3 !important;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1) !important;
}

      /* Custom scrollbar */
      ::-webkit-scrollbar {
        width: 8px;
    }
    ::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    ::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 4px;
    }
    ::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }

    /* Dark mode scrollbar */
    .dark ::-webkit-scrollbar-track {
        background: #374151;
    }
    .dark ::-webkit-scrollbar-thumb {
        background: #6b7280;
    }
    .dark ::-webkit-scrollbar-thumb:hover {
        background: #9ca3af;
    }

    /* Tree animations */
    .tree-node {
        transition: all 0.2s ease;
    }
    .tree-children {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    .tree-children.expanded {
        max-height: 2000px;
    }

    /* Smooth panel transitions */
    .panel-enter {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .panel-enter.show {
        transform: translateX(0);
    }

    /* Loading spinner */
    .loading-spinner {
        animation: spin 1s linear infinite;
    }
    @keyframes spin {
        from { transform: rotate(0deg); }
        to { transform: rotate(360deg); }
    }

    /* Modal backdrop */
    .modal-backdrop {
        backdrop-filter: blur(8px);
    }

    /* Comment pin animation */
    .comment-pin {
        animation: pinPulse 2s infinite;
    }
    @keyframes pinPulse {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.1); }
    }

    /* 3D viewer container */
    #ifc-viewer {
        position: relative;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    /* Canvas positioning */
    #ifc-canvas {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
    }

    #navCubeCanvas {
        position: absolute;
        bottom: 20px;
        right: 20px;
        width: 120px;
        height: 120px;
        z-index: 10;
    }

    /* Status badges */
    .status-badge {
        animation: statusPulse 3s ease-in-out infinite;
    }
    @keyframes statusPulse {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.7; }
    }