/* Management Console Styles */

/* Reset any max-width constraints from parent styles */
body, html {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Override any container constraints */
main, .container, .content, .wrapper {
    max-width: none !important;
    width: 100% !important;
}

/* Ensure header spans full width */
header {
    max-width: none !important;
    width: 100vw !important;
}

/* Header Jobs Button */
.header-jobs-button {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: inherit;
    font-family: inherit;
}

.header-jobs-button:hover {
    background: var(--surface-hover-color);
}

/* Layout Container */
.management-console {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height, 60px)); /* Subtract header height */
    background: var(--surface-color);
    position: fixed;
    top: var(--header-height, 60px);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw; /* Ensure full viewport width */
    box-sizing: border-box;
    max-width: none !important;
}

/* Main content area - horizontal layout for tree and tabs */
.main-content {
    display: flex;
    flex: 1 1 auto;
    overflow: hidden;
    min-height: 0; /* Important for nested flexbox */
    position: relative;
    width: 100%;
    max-width: none; /* Remove any width constraints */
}

/* Tree Panel (Left) */
.tree-panel {
    width: 300px;
    min-width: 60px;
    max-width: 800px;
    background: var(--surface-color);
    border-right: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    resize: none; /* Remove native resize, we'll handle it manually */
    flex-shrink: 0; /* Don't shrink */
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

/* Disable transitions during resize */
.tree-panel.resizing,
.tree-panel.resizing ~ .content-panel {
    transition: none !important;
}

/* Disable transitions during initial load */
.tree-panel.no-transition,
.tree-panel.no-transition ~ .content-panel {
    transition: none !important;
}

/* Collapsed state */
.tree-panel.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    resize: none;
    border-right: none;
    overflow: hidden;
}

/* Collapse Toggle Button (also resize handle) */
.tree-collapse-toggle {
    position: relative;
    width: 8px;
    background: var(--surface-color);
    border-left: none;
    border-right: 1px solid var(--border-color);
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.2s ease;
    z-index: 3;
    flex-shrink: 0;
    user-select: none;
}

/* Change cursor to pointer when tree is collapsed */
.tree-panel.collapsed + .tree-collapse-toggle {
    cursor: pointer;
}

/* Invisible extended hit area for easier grabbing */
.tree-collapse-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -6px;
    right: -6px;
    z-index: -1;
}

/* Hover effect without scaling */
.tree-collapse-toggle:hover {
    background: var(--surface-hover-color);
}

/* Container for chevron and dots */
.toggle-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    justify-content: center;
}

/* Active resize state */
.tree-collapse-toggle.resizing {
    background: var(--primary-color);
    opacity: 0.8;
}

/* Resize overlay to capture mouse events during resize */
.resize-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000; /* High z-index to cover iframes */
    cursor: col-resize;
    display: none;
    background: transparent; /* Invisible but captures events */
    pointer-events: auto; /* Ensure it captures mouse events */
}

.resize-overlay.active {
    display: block;
}

.collapse-icon {
    font-size: 14px;
    color: var(--text-muted-color);
    transition: transform 0.3s ease, opacity 0.2s;
    user-select: none;
    pointer-events: none;
    font-family: Arial, sans-serif;
    line-height: 1;
    opacity: 0.5;
    font-weight: bold;
}

/* Resize handle dots */
.resize-handle-dots {
    display: flex;
    flex-direction: column;
    gap: 3px;
    opacity: 0.5;
    transition: opacity 0.2s;
    pointer-events: none;
    align-items: center;
}

.tree-collapse-toggle:hover .resize-handle-dots {
    opacity: 0.8;
}

.tree-collapse-toggle:hover .collapse-icon {
    opacity: 0.8;
}

.resize-handle-dots span {
    width: 4px;
    height: 4px;
    background: var(--text-muted-color);
    border-radius: 50%;
}

.tree-panel.collapsed + .tree-collapse-toggle .collapse-icon {
    transform: rotate(180deg);
}

/* Style both chevrons consistently */
.collapse-icon:first-child {
    margin-bottom: 2px;
}

.collapse-icon:last-child {
    margin-top: 2px;
}

/* Adjust content panel when tree is collapsed */
.content-panel {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tree-panel.collapsed ~ .content-panel {
    width: calc(100% - 8px); /* Full width minus toggle button */
}

.tree-header {
    padding: 6px 8px;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tree-header-row {
    display: flex;
    gap: 6px;
    align-items: center;
    width: 100%;
}

.tree-view-mode {
    padding: 4px 8px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--text-color);
    font-size: 12px;
    height: 24px;
    cursor: pointer;
    min-width: 100px;
}

.tree-view-mode:hover {
    background: var(--surface-hover-color);
}

.tree-search {
    width: 100%;
    padding: 4px 8px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--text-color);
    font-size: 13px;
    height: 28px;
}

.tree-refresh,
.tree-dashboard,
.tree-terminal-sessions {
    padding: 4px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    height: 24px;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
}

.tree-refresh:hover,
.tree-dashboard:hover,
.tree-terminal-sessions:hover {
    background: var(--surface-hover-color);
}

.tree-content {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
}

.tree-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted-color);
}

/* Tree Items */
.tree-node {
    user-select: none;
}

.tree-item {
    display: flex;
    align-items: center;
    padding: 1px 4px;
    cursor: pointer;
    border-radius: 2px;
    position: relative;
    font-size: 13px;
    line-height: 22px;
    height: 22px;
}

.tree-item:hover {
    background: var(--surface-hover-color);
}

.tree-item.selected {
    background: var(--primary-color);
    color: white;
}

.tree-arrow {
    width: 12px;
    text-align: center;
    color: var(--text-muted-color);
    font-size: 10px;
    flex-shrink: 0;
}

.tree-arrow.expanded {
    transform: rotate(90deg);
}

.tree-icon {
    margin: 0 4px;
    font-size: 14px;
    flex-shrink: 0;
}

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

.tree-actions {
    display: none;
    gap: 4px;
    align-items: center;
}

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

.tree-action {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.tree-action:hover {
    background: var(--surface-hover-color);
    border-color: var(--primary-color);
}

.tree-children {
    margin-left: 0;
}

/* Depth-based indentation system */
.tree-depth-1 {
    padding-left: 16px;
}
.tree-depth-2 {
    padding-left: 32px;
}
.tree-depth-3 {
    padding-left: 48px;
}
.tree-depth-4 {
    padding-left: 64px;
}
.tree-depth-5 {
    padding-left: 80px;
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-running,
.status-online { color: #4caf50; }
.status-stopped,
.status-offline { color: #f44336; }
.status-warning { color: #ff9800; }
.status-creating { color: #2196f3; }
.status-error { color: #f44336; }
.status-unknown { color: #666; }

/* Content Panel (Right) */
.content-panel {
    flex: 1 1 0%; /* Take all remaining space */
    display: flex;
    flex-direction: column;
    background: var(--surface-color);
    min-width: 0;
    min-height: 0; /* Critical for nested flexbox */
    overflow: hidden;
    margin: 0;
    padding: 0;
    width: calc(100% - 300px - 8px); /* Full width minus tree panel and toggle button */
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tab Bar Container */
.tab-bar-container {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    height: 32px;
    flex-shrink: 0;
    z-index: auto;
}

/* Tab Bar */
.tab-bar {
    display: flex;
    align-items: center;
    flex: 1;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    position: relative;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.tab-bar::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

/* Tab Scroll Buttons */
.tab-scroll-button {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    background: var(--surface-color);
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--text-muted-color);
    font-size: 12px;
    z-index: 10;
    transition: all 0.2s ease;
}

.tab-scroll-button:hover {
    background: var(--surface-hover-color);
    color: var(--text-color);
}

.tab-scroll-button.left {
    left: 0;
    background: linear-gradient(to right, var(--surface-color) 70%, transparent);
}

.tab-scroll-button.right {
    right: 0;
    background: linear-gradient(to left, var(--surface-color) 70%, transparent);
}

.tab-scroll-button.visible {
    display: flex;
}

/* Tab List Dropdown */
.tab-list-button {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: var(--surface-color);
    border: none;
    border-left: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted-color);
    font-size: 12px;
    z-index: 11;
    transition: all 0.2s ease;
}

.tab-list-button:hover {
    background: var(--surface-hover-color);
    color: var(--text-color);
}

.tab-list-dropdown {
    position: fixed;
    top: calc(var(--header-height, 60px) + 32px);
    right: 0;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    max-width: 300px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
    pointer-events: auto;
}

.tab-list-dropdown.open {
    display: block;
}

.tab-list-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s;
    gap: 8px;
    color: var(--text-color);
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
}

.tab-list-item:hover {
    background: var(--surface-hover-color);
}

.tab-list-item.active {
    background: var(--surface-hover-color);
    font-weight: 500;
}

/* Overlay for dropdown menus */
.dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1000;
    display: none;
    pointer-events: auto;
}

.dropdown-overlay.active {
    display: block;
}

.tab {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    cursor: pointer;
    white-space: nowrap;
    font-size: 13px;
    transition: all 0.2s;
    height: 100%;
    min-width: 120px;
    max-width: 300px;
    flex-shrink: 1;
    gap: 4px;
    position: relative;
}

.tab:hover {
    background: var(--surface-hover-color);
}

.tab.active {
    background: var(--surface-color);
    border-bottom: 2px solid var(--primary-color);
}

.tab-icon {
    font-size: 15px;
    flex-shrink: 0;
}

.tab-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.tab-close {
    margin-left: auto;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 11px;
    opacity: 0;
    transition: all 0.2s;
    flex-shrink: 0;
}

.tab:hover .tab-close {
    opacity: 0.6;
}

.tab-close:hover {
    opacity: 1;
    background: var(--surface-hover-color);
}

/* Temporary (unpinned) tab styles */
.tab:not(.pinned) {
    font-style: normal;
    opacity: 0.9;
}

/* Visual separator between temporary and pinned tabs */
.tab.pinned:first-of-type {
    position: relative;
    margin-left: 20px;
}

.tab.pinned:first-of-type::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 25%;
    bottom: 25%;
    width: 1px;
    background: var(--border-color);
    opacity: 0.5;
}

/* Pin button styles */
.tab-pin {
    margin-left: 8px;
    padding: 2px 4px;
    background: transparent;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
    line-height: 1;
}

.tab-pin:hover {
    opacity: 1;
    background: var(--surface-hover-color);
}

/* Adjust close button when following pin button */
.tab-pin + .tab-close {
    margin-left: 4px;
}

.tab-bar-placeholder {
    padding: 0 20px;
    color: var(--text-muted-color);
    font-style: italic;
    display: flex;
    align-items: center;
    height: 100%;
}

/* Tab Content Area */
#tabContent {
    flex: 1 1 auto;
    position: relative;
    background: var(--surface-color);
    overflow: hidden;
    min-height: 0; /* Critical for flexbox children */
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.tab-pane {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    visibility: hidden;
    z-index: 0;
    margin: 0;
    padding: 0;
}

.tab-pane.active {
    visibility: visible;
    z-index: 1;
}

.tab-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: var(--surface-color);
    display: block;
    margin: 0;
    padding: 0;
}

/* Tab Drag and Drop Styles */
.tab {
    user-select: none;
    position: relative;
}

.tab.dragging {
    opacity: 0;
    cursor: grabbing !important;
}

.tab-drag-clone {
    background: #2d2d2d !important;
    background-color: #2d2d2d !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 1 !important;
    cursor: grabbing !important;
    transform-origin: center center;
    border: none !important;
    border-left: 1px solid #3e3e3e !important;
    border-right: 1px solid #3e3e3e !important;
    border-bottom: 1px solid #3e3e3e !important;
}

/* Active tab drag clone */
.tab-drag-clone.active {
    background: #1e1e1e !important;
    background-color: #1e1e1e !important;
    border-bottom: 2px solid var(--primary-color) !important;
}

/* Light theme override */
.light-theme .tab-drag-clone {
    background: #f3f3f3 !important;
    background-color: #f3f3f3 !important;
    border: none !important;
    border-left: 1px solid #d4d4d4 !important;
    border-right: 1px solid #d4d4d4 !important;
    border-bottom: 1px solid #d4d4d4 !important;
}

.light-theme .tab-drag-clone.active {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-bottom: 2px solid var(--primary-color) !important;
}

body.dragging-tab {
    cursor: grabbing !important;
}

body.dragging-tab * {
    cursor: grabbing !important;
}

/* Disable transitions during drag */
body.dragging-tab .tab {
    transition: none !important;
}

/* Visual drop indicator */
.tab-drop-indicator {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-color);
    pointer-events: none;
    z-index: 9999;
    transition: left 0.1s ease-out;
}

/* Invalid drop visual feedback */
.tab-drag-clone.invalid-drop {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    filter: grayscale(0.5);
    border-color: #ff6b6b !important;
}

.tab-drag-clone.invalid-drop::after {
    content: '🚫';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    pointer-events: none;
}

.welcome-message {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface-color);
    padding: 40px;
    text-align: center;
}

.welcome-message h2 {
    font-size: 28px;
    margin-bottom: 16px;
    color: var(--text-color);
}

.welcome-message p {
    font-size: 16px;
    color: var(--text-muted-color);
    margin-bottom: 32px;
    max-width: 600px;
}

.quick-actions {
    display: flex;
    gap: 16px;
}


/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--surface-hover-color);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .tree-panel {
        width: 250px;
        min-width: 60px;
    }
    
    .content-panel {
        width: calc(100% - 250px - 8px);
    }
    
    /* Auto-collapse on tablets */
    .tree-panel {
        width: 0;
        min-width: 0;
        border-right: none;
    }
    
    .tree-panel.expanded {
        width: 250px;
        min-width: 60px;
        border-right: none;
    }
    
    /* Fix for tablet collapsed state */
    .tree-panel.collapsed {
        width: 0 !important;
        min-width: 0 !important;
        border-right: none;
    }
    
    .tree-panel.expanded + .tree-collapse-toggle .collapse-icon,
    .tree-panel:not(.collapsed) + .tree-collapse-toggle .collapse-icon {
        transform: rotate(0deg);
    }
    
    .tree-panel:not(.expanded) + .tree-collapse-toggle .collapse-icon,
    .tree-panel.collapsed + .tree-collapse-toggle .collapse-icon {
        transform: rotate(180deg);
    }
    
    .tree-panel:not(.expanded) ~ .content-panel,
    .tree-panel.collapsed ~ .content-panel {
        width: calc(100% - 8px);
    }
    
    .tree-panel.expanded ~ .content-panel {
        width: calc(100% - 250px - 8px);
    }
    
    /* Change cursor for collapsed state on tablets */
    .tree-panel:not(.expanded) + .tree-collapse-toggle {
        cursor: pointer;
    }
}

@media (max-width: 768px) {
    /* Hide collapse toggle on mobile - use overlay instead */
    .tree-collapse-toggle {
        display: none;
    }
    
    .tree-panel {
        position: fixed;
        left: -300px;
        top: var(--header-height, 60px);
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s;
        width: 300px !important;
        max-width: 80vw;
        min-width: 300px !important;
        border-right: 1px solid var(--border-color) !important;
    }
    
    .tree-panel.open {
        left: 0;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    }
    
    .content-panel {
        width: 100% !important;
    }
    
    /* Add mobile menu button */
    .mobile-menu-btn {
        display: block;
        position: fixed;
        bottom: 20px;
        left: 20px;
        z-index: 1001;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--primary-color);
        color: white;
        border: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        cursor: pointer;
        font-size: 24px;
    }
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted-color);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--surface-hover-color);
    color: var(--text-color);
}

.modal-body {
    padding: 20px;
}

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

.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    background: var(--surface-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    font-size: 14px;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--surface-color);
}

.form-control[readonly] {
    opacity: 0.7;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .tree-panel.open ~ .mobile-menu-overlay {
        display: block;
    }
}

/* Hide mobile button by default */
.mobile-menu-btn {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block !important;
    }
}

/* Loading States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted-color);
}

.loading::after {
    content: "";
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tree Create Button */
.tree-create-pool {
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}

.tree-create-pool .tree-item {
    color: var(--primary-color);
    font-weight: 500;
}

.tree-create-pool .tree-item:hover {
    background: var(--primary-color);
    color: white;
}

/* File Menu Styles - VS Code Style */
.file-menu {
    padding: 0 4px;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    position: relative;
    height: 30px;
    display: flex;
    align-items: center;
}

.file-menu-button {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 0 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    height: 100%;
    display: flex;
    align-items: center;
    transition: background 0.1s;
    position: relative;
}

.file-menu-button:hover {
    background: #3C3C3C; /* Opaque gray instead of transparent white */
}

.file-menu.open .file-menu-button {
    background: #505050; /* Slightly lighter opaque gray */
}

.file-menu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #252526;
    background-color: rgb(37, 37, 38); /* Ensure full opacity */
    border: 1px solid #454545;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    min-width: 220px;
    display: none;
    z-index: 1000;
    margin-top: 2px;
    padding: 6px;
    opacity: 1; /* Ensure full opacity */
}

.file-menu.open .file-menu-dropdown {
    display: block;
}

/* Light theme adjustments */
.light-theme .file-menu-button:hover {
    background: #E8E8E8; /* Opaque light gray */
}

.light-theme .file-menu.open .file-menu-button {
    background: #D4D4D4; /* Slightly darker opaque gray */
}

.light-theme .file-menu-dropdown {
    background: #F3F3F3;
    background-color: rgb(243, 243, 243); /* Ensure full opacity */
    border-color: #D4D4D4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
    opacity: 1; /* Ensure full opacity */
}

.light-theme .file-menu-item {
    color: #424242;
}

.light-theme .file-menu-item:hover {
    background: #E8E8E8;
    color: #000000;
}

.file-menu-item {
    display: flex;
    align-items: center;
    width: calc(100% - 4px);
    background: transparent;
    background-color: transparent;
    border: 0;
    outline: none;
    box-shadow: none;
    color: #CCCCCC;
    padding: 8px 24px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    transition: background-color 0.1s;
    white-space: nowrap;
    height: 28px;
    line-height: 28px;
    margin: 1px 2px;
    border-radius: 4px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Menu separator */
.file-menu-separator {
    height: 1px;
    background: #454545;
    margin: 4px 6px;
}

.light-theme .file-menu-separator {
    background: #D4D4D4;
}

.file-menu-item:hover {
    background: #094771;
    color: #FFFFFF;
    border-radius: 4px;
}

.file-menu-item:focus {
    outline: none;
}

/* Display Size Classes */
.management-console.display-compact {
    --tree-item-height: 20px;
    --tree-item-padding: 0px 4px;
    --tree-font-size: 12px;
    --tree-icon-size: 12px;
    --tree-indent: 10px;
}

.management-console.display-normal {
    --tree-item-height: 22px;
    --tree-item-padding: 1px 4px;
    --tree-font-size: 13px;
    --tree-icon-size: 14px;
    --tree-indent: 12px;
}

.management-console.display-large {
    --tree-item-height: 28px;
    --tree-item-padding: 4px 8px;
    --tree-font-size: 14px;
    --tree-icon-size: 16px;
    --tree-indent: 16px;
}

.management-console.display-xlarge {
    --tree-item-height: 32px;
    --tree-item-padding: 6px 10px;
    --tree-font-size: 15px;
    --tree-icon-size: 18px;
    --tree-indent: 20px;
}

/* Apply display size variables */
.display-compact .tree-item,
.display-normal .tree-item,
.display-large .tree-item,
.display-xlarge .tree-item {
    height: var(--tree-item-height);
    line-height: var(--tree-item-height);
    padding: var(--tree-item-padding);
    font-size: var(--tree-font-size);
}

.display-compact .tree-icon,
.display-normal .tree-icon,
.display-large .tree-icon,
.display-xlarge .tree-icon {
    font-size: var(--tree-icon-size);
}

/* Display size depth indentations */
.display-compact .tree-depth-1 { padding-left: 10px; }
.display-compact .tree-depth-2 { padding-left: 20px; }
.display-compact .tree-depth-3 { padding-left: 30px; }
.display-compact .tree-depth-4 { padding-left: 40px; }
.display-compact .tree-depth-5 { padding-left: 50px; }

.display-normal .tree-depth-1 { padding-left: 12px; }
.display-normal .tree-depth-2 { padding-left: 24px; }
.display-normal .tree-depth-3 { padding-left: 36px; }
.display-normal .tree-depth-4 { padding-left: 48px; }
.display-normal .tree-depth-5 { padding-left: 60px; }

.display-large .tree-depth-1 { padding-left: 16px; }
.display-large .tree-depth-2 { padding-left: 32px; }
.display-large .tree-depth-3 { padding-left: 48px; }
.display-large .tree-depth-4 { padding-left: 64px; }
.display-large .tree-depth-5 { padding-left: 80px; }

.display-xlarge .tree-depth-1 { padding-left: 20px; }
.display-xlarge .tree-depth-2 { padding-left: 40px; }
.display-xlarge .tree-depth-3 { padding-left: 60px; }
.display-xlarge .tree-depth-4 { padding-left: 80px; }
.display-xlarge .tree-depth-5 { padding-left: 100px; }