/* File Manager Styles */
.file-manager-container {
    display: flex;
    height: calc(100vh - 200px); /* Adjust based on header/nav height */
    min-height: 500px;
    border: 1px solid #333;
    border-radius: 8px;
    background-color: #1e1e1e;
    overflow: hidden;
}

.fm-sidebar {
    width: 250px;
    background-color: #252526;
    border-right: 1px solid #333;
    display: block; /* Remove flex, use block for absolute positioning context */
    position: relative; /* Anchor for absolute child */
    height: 100%;
    overflow: hidden;
}

.fm-header {
    height: 50px; /* Fixed height */
    padding: 0 10px; /* Adjust padding */
    background-color: #2d2d2d;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ccc;
    box-sizing: border-box; /* Ensure padding includes height */
}

.fm-header h3 {
    margin: 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.file-tree {
    position: absolute; /* Pin to sidebar */
    top: 50px; /* Starts below header */
    bottom: 0; /* Stretches to bottom */
    left: 0;
    width: 100%;
    overflow-y: auto; /* Enable scroll */
    padding: 5px 0;
    box-sizing: border-box;
}

.ft-item {
    padding: 4px 10px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ccc;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ft-item:hover {
    background-color: #2a2d2e;
}

.ft-item.active {
    background-color: #37373d;
    color: #fff;
}

.ft-item.is-dir {
    font-weight: bold;
    color: #dcb67a;
}

.ft-folder-content {
    margin-left: 15px;
    border-left: 1px solid #444;
}

.fm-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #1e1e1e;
}

.fm-editor-header {
    height: 40px;
    background-color: #2d2d2d;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
}

#currentFileName {
    color: #fff;
    font-family: monospace;
}

.file-editor {
    flex: 1;
    background-color: #1e1e1e;
    color: #d4d4d4;
    border: none;
    padding: 15px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
}

.file-editor:disabled {
    background-color: #1e1e1e;
    color: #666;
    cursor: not-allowed;
}

.btn-icon {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 5px;
}

.btn-icon:hover {
    color: #fff;
}
