/* model-files.css — проводник раздела «МОДЕЛИ» (src/platform/model-files-section.js; бриф model-files-folders §2.4):
   дерево слева, справа путь, кнопки, плитки и карточка выбранного. Цвета — переменные страницы (:root в platform.html). */

.model-files__layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 12px;
    align-items: start;
}

/* Дерево */
.model-tree {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 6px 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}
.model-tree__node {
    display: flex;
    align-items: center;
    gap: 2px;
    border-radius: 6px;
    border: 1px solid transparent;
}
.model-tree__node.is-current { background: var(--accent-glow); }
.model-tree__node.is-drop-target { border-color: var(--accent); background: var(--accent-glow); }
.model-tree__toggle {
    width: 16px;
    flex-shrink: 0;
    padding: 0;
    background: none;
    border: none;
    color: var(--accent-dim);
    cursor: pointer;
    font-size: 11px;
}
.model-tree__toggle:disabled { cursor: default; }
.model-tree__label {
    flex: 1;
    min-width: 0;
    padding: 4px 4px;
    background: none;
    border: none;
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.model-tree__label:hover { color: #fff; }

/* Правая часть */
.model-files__main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.model-files__crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; }
.model-files__crumb {
    padding: 2px 6px;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
}
.model-files__crumb:hover { background: var(--accent-glow); }
.model-files__sep { color: var(--muted); }
.model-files__here { color: var(--ink); font-weight: 600; padding: 2px 6px; }
.model-files__toolbar, .model-files__actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.model-files__toolbar .invite-button, .model-files__actions .invite-button { font-size: 11px; padding: 4px 10px; }

/* Плитки */
.model-files__tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.model-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-bg);
    cursor: pointer;
    user-select: none;
    min-width: 0;
}
.model-tile:hover { border-color: var(--accent-dim); }
.model-tile.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.model-tile.is-drop-target { border-color: var(--accent); background: var(--accent-glow); }
.model-tile__icon {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--accent-dim);
}
.model-tile__name { color: var(--ink); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-tile__meta { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Карточка выбранного */
.model-files__inspector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--accent-dim);
    border-radius: 10px;
    background: rgba(155, 109, 255, 0.05);
}
.model-files__inspector-title { color: var(--ink); font-size: 13px; font-weight: 600; }
.model-files__picker {
    min-width: 220px;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--panel-bg);
    color: var(--ink);
}

/* Файл с диска разбирается — плитка «импорт…»; область плиток под файлом подсвечена */
.model-tile--importing { opacity: 0.6; cursor: progress; border-style: dashed; }
.model-files__main.is-drop-target { outline: 1px dashed var(--accent); outline-offset: 4px; border-radius: 10px; }

/* Миниатюра (бриф §2.5): картинка 256×160 вписана в плитку; устаревшая — с пометкой */
.model-tile__thumb { position: relative; overflow: hidden; padding: 0; height: auto; aspect-ratio: 256 / 160; }
.model-tile__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.model-tile__stale {
    position: absolute; right: 4px; bottom: 4px; padding: 1px 6px; border-radius: 8px; font-size: 10px;
    background: rgba(240, 160, 60, 0.85); color: #1a1030;
}

/* Миниатюра на карточке сцены (src/platform/scene-thumbnail.js) */
.scene-thumb {
    margin-left: auto; width: 112px; height: 70px; flex-shrink: 0; position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center; border-radius: 8px;
    background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); color: var(--accent-dim); font-size: 26px;
}
.scene-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scene-thumb__stale {
    position: absolute; right: 3px; bottom: 3px; padding: 0 5px; border-radius: 6px; font-size: 9px;
    background: rgba(240, 160, 60, 0.85); color: #1a1030;
}
