/* writer_sidebar.css — panneau explorateur de fichiers */

.files-sidebar {
    width: 240px;
    min-width: 240px;
    background: #1e1e2e;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.2s ease, min-width 0.2s ease;
    font-size: 13px;
    color: #cdd6f4;
}

.files-sidebar.hidden {
    width: 0;
    min-width: 0;
    border-right: none;
}

.sidebar-header {
    padding: 8px 10px;
    background: #181825;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sidebar-title {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a6adc8;
}

.sidebar-breadcrumb {
    padding: 6px 10px;
    background: #181825;
    border-bottom: 1px solid #2a2a3e;
    font-size: 11px;
    color: #a6adc8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.sidebar-breadcrumb .bc-item {
    cursor: pointer;
    color: #89b4fa;
}

.sidebar-breadcrumb .bc-item:hover {
    text-decoration: underline;
}

.sidebar-breadcrumb .bc-item.current {
    color: #cdd6f4;
    cursor: default;
    text-decoration: none;
}

.sidebar-file-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.sidebar-file-list::-webkit-scrollbar {
    width: 4px;
}

.sidebar-file-list::-webkit-scrollbar-thumb {
    background: #45475a;
    border-radius: 2px;
}

.sidebar-item {
    padding: 5px 12px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 4px;
    margin: 1px 4px;
    transition: background 0.1s;
}

.sidebar-item:hover {
    background: #313244;
}

.sidebar-item.sidebar-current {
    background: #45475a;
    color: #cba6f7;
    font-weight: 500;
}

.sidebar-item.sidebar-dir {
    color: #89dceb;
}

.sidebar-item.sidebar-back {
    color: #a6adc8;
    font-style: italic;
}

.sidebar-item.sidebar-file {
    color: #cdd6f4;
}

.sidebar-loading,
.sidebar-empty,
.sidebar-error {
    padding: 16px 12px;
    color: #585b70;
    font-style: italic;
    font-size: 12px;
}

.sidebar-error {
    color: #f38ba8;
}

/* Bouton "⋯" options par item */
.sidebar-item {
    position: relative;
    padding-right: 28px;
}

.sidebar-more {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    padding: 0 4px;
    border-radius: 3px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    color: #a6adc8;
    transition: opacity 0.1s;
}

.sidebar-item:hover .sidebar-more {
    opacity: 1;
}

.sidebar-more:hover {
    background: #585b70;
    color: #cdd6f4;
}

/* Boutons new folder / new file dans le header */
.sidebar-actions {
    display: flex;
    gap: 4px;
}

.sidebar-action-btn {
    background: none;
    border: none;
    color: #a6adc8;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 14px;
    transition: background 0.1s, color 0.1s;
}

.sidebar-action-btn:hover {
    background: #313244;
    color: #cdd6f4;
}

/* Context menu flottant */
.sidebar-context-menu {
    background: #1e1e2e;
    border: 1px solid #45475a;
    border-radius: 6px;
    padding: 4px 0;
    min-width: 150px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.ctx-item {
    padding: 7px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #cdd6f4;
    transition: background 0.1s;
}

.ctx-item:hover {
    background: #313244;
}

.ctx-danger {
    color: #f38ba8;
}

/* Modal déplacer */
.sidebar-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-modal {
    background: #1e1e2e;
    border: 1px solid #45475a;
    border-radius: 8px;
    width: 320px;
    max-height: 480px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid #313244;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #cdd6f4;
}

.sidebar-modal-close {
    background: none;
    border: none;
    color: #a6adc8;
    cursor: pointer;
    font-size: 16px;
}

.move-folder-tree {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

.move-folder-item {
    padding: 6px 12px;
    cursor: pointer;
    color: #89dceb;
    font-size: 13px;
    transition: background 0.1s;
}

.move-folder-item:hover {
    background: #313244;
}

.move-folder-item.selected {
    background: #45475a;
    color: #cba6f7;
}

.sidebar-modal-footer {
    padding: 10px 16px;
    border-top: 1px solid #313244;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Bouton toggle sidebar dans le header */
#btnFilesSidebar {
    opacity: 0.8;
    transition: opacity 0.15s;
}

#btnFilesSidebar:hover,
#btnFilesSidebar.active {
    opacity: 1;
    background: rgba(255,255,255,0.15);
}
