/* ============================================
   ПРАВЫЙ САЙДБАР: ПРОВОДНИК ПРОЕКТА
   ============================================ */

.app {
    grid-template-columns: 280px 1fr auto;
}

.right-sidebar {
    width: 320px;
    background: var(--bg-4);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    transition: width 0.2s ease;
}
.right-sidebar.hidden { display: none; }

.right-sidebar-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.right-sidebar-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
}
.right-sidebar-title i { font-size: 15px; }

.right-sidebar-close {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.right-sidebar-close:hover { color: var(--alert); background: rgba(255,111,97,0.08); }

.right-sidebar-search {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.right-sidebar-search input {
    width: 100%;
    padding: 7px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font: inherit;
    font-size: 12px;
    outline: none;
}
.right-sidebar-search input:focus { border-color: var(--accent); }

.right-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 6px;
    min-height: 0;
    font-size: 13px;
}
.right-sidebar-body::-webkit-scrollbar { width: 6px; }
.right-sidebar-body::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 3px; }

.file-tree-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
}

/* Дерево */
.ft-node {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px 5px 6px;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    color: var(--text);
    transition: background 0.15s, color 0.15s;
}
.ft-node:hover { background: rgba(255,255,255,0.04); color: var(--accent); }
.ft-node.is-file:hover { color: var(--info); }
.ft-node .ft-icon { font-size: 14px; width: 16px; text-align: center; flex-shrink: 0; }
.ft-node.ft-dir .ft-icon { color: var(--accent); }
.ft-node.is-file .ft-icon { color: var(--text-dim); }
.ft-node .ft-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ft-node .ft-size {
    font-size: 10px;
    color: var(--text-dim);
    opacity: 0.7;
    flex-shrink: 0;
}
.ft-node .ft-eye {
    font-size: 14px;
    color: var(--text-dim);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}
.ft-node:hover .ft-eye { opacity: 1; }
.ft-node .ft-eye:hover { color: var(--accent); background: rgba(251,209,87,0.1); }

.ft-children { display: flex; flex-direction: column; }
.ft-children.collapsed { display: none; }
.ft-children .ft-node { padding-left: 22px; }
.ft-children .ft-children .ft-node { padding-left: 38px; }
.ft-children .ft-children .ft-children .ft-node { padding-left: 54px; }

.ft-chevron {
    font-size: 12px;
    color: var(--text-dim);
    transition: transform 0.15s;
    flex-shrink: 0;
    width: 12px;
    text-align: center;
}
.ft-chevron.open { transform: rotate(90deg); }

/* ===== МОДАЛКА ФАЙЛА ===== */
.modal-xl { max-width: 960px; width: 92%; }

.file-modal-body {
    padding: 0;
    background: var(--bg);
    overflow: hidden;
}
.file-modal-content {
    margin: 0;
    padding: 16px 20px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text);
    white-space: pre;
    overflow: auto;
    max-height: 68vh;
    tab-size: 4;
}
.file-modal-content::-webkit-scrollbar { width: 8px; height: 8px; }
.file-modal-content::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 4px; }

#file-modal-path {
    font-family: "Manrope", monospace;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: none;
    font-size: 12px;
}

@media (max-width: 1100px) {
    .app { grid-template-columns: 260px 1fr; }
    .right-sidebar {
        position: fixed;
        top: 0; right: 0; bottom: 0;
        width: 320px;
        z-index: 120;
        box-shadow: -8px 0 24px rgba(0,0,0,0.4);
    }
}

@media (max-width: 700px) {
    .right-sidebar { width: 100%; }
}