.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--filesystem-width);
    transition: width 0.1s ease;
    background-color: rgba(31, 31, 31, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: auto;
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* Internet Explorer and Edge */
}

/* Add this to hide WebKit scrollbar (Chrome, Safari, newer Edge) */
.sidebar::-webkit-scrollbar {
    display: none;
}

.file-tree {
    padding: 16px;
}

.file-tree ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.file-tree li {
    margin: 4px 0;
    list-style-type: none;
    list-style-position: inside;
    display: block;
}

.folder, .file {
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.folder:hover, .file:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.folder:active, .file:active {
    transform: translateY(0px);
}

.folder::before {
    content: "";
    margin-right: 10px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230077ED' width='24' height='24'%3E%3Cpath d='M4 4C2.89543 4 2 4.89543 2 6V18C2 19.1046 2.89543 20 4 20H20C21.1046 20 22 19.1046 22 18V8C22 6.89543 21.1046 6 20 6H12L10 4H4Z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: brightness(1.2);
}

.folder.open::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232186F2' width='24' height='24'%3E%3Cpath d='M4 4C2.89543 4 2 4.89543 2 6V18C2 19.1046 2.89543 20 4 20H20C21.1046 20 22 19.1046 22 18V8C22 6.89543 21.1046 6 20 6H12L10 4H4Z'/%3E%3C/svg%3E");
}

.file::before {
    content: attr(data-ext);
    margin-right: 10px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    text-transform: lowercase;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.folder + ul {
    margin-left: 16px;
    padding-left: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(31, 31, 31, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1;
    cursor: default;
}

.sidebar-header img {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    cursor: pointer;
}

.sidebar-header h2 {
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.folder.open {
    background: rgba(0, 119, 237, 0.1);
    border: 1px solid rgba(0, 119, 237, 0.2);
    margin-bottom: 8px;
}

/* Add this new style to handle the text truncation */
.folder span, .file span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0; /* This is crucial for text truncation to work in a flex container */
}

.add-to-context-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 2px 8px;
    font-size: 16px;
    margin-left: auto;
    transition: color 0.3s ease;
}

.add-to-context-btn:hover {
    color: rgba(255, 255, 255, 0.9);
}

.add-to-context-btn.active {
    color: #0077ED;
}

.file {
    display: flex;
    align-items: center;
}

.file.active {
    background: rgba(0, 119, 237, 0.3);
    border: 1px solid rgba(0, 119, 237, 0.5);
    box-shadow: 0 0 12px rgba(0, 119, 237, 0.2);
}

.file.active:hover {
    background: rgba(0, 119, 237, 0.35);
    transform: none;
    box-shadow: 0 0 12px rgba(0, 119, 237, 0.25);
}