/* =========================================================================
   bpm2bHeadlessCMS — Site Editor styles
   ========================================================================= */

/* --- Editor panel (right side of the editor) --------------------------- */

.editor-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.editor-panel .empty-state {
    padding: 24px;
    color: #888;
    text-align: center;
}

.editor-panel .editor-header {
    flex: 0 0 auto;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 12px;
}

.editor-panel .breadcrumb-line {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.editor-panel .dirty-marker {
    margin-left: 8px;
}

.editor-panel .editor-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.editor-panel .json-editor-mount-point {
    padding: 2px;
}

/* --- JSON tree editor (recursive object editor) ------------------------ */

.json-tree-editor-group {
    padding: 8px;
}

.json-tree-editor-group .empty-hint {
    padding: 8px 0;
    font-style: italic;
}

.json-tree-editor-group .cell.form-group {
    margin-bottom: 12px;
}

.json-tree-editor-group .cell.form-group > .control-label {
    font-weight: 600;
}

.json-tree-editor-group .cell {
    margin-bottom: 8px;
}

/* --- JSON tree array (array editor with add/remove/reorder) ------------ */

.json-tree-array {
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 8px;
    background: #fafafa;
}

.json-tree-array .empty-hint {
    padding: 8px 0;
    font-style: italic;
}

.json-tree-array .array-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    padding: 6px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
}

.json-tree-array .item-index {
    min-width: 28px;
    padding-top: 6px;
    color: #999;
    font-size: 12px;
}

.json-tree-array .item-body {
    flex: 1;
    min-width: 0;
}

.json-tree-array .item-controls {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.json-tree-array .array-toolbar {
    margin-top: 8px;
}

.json-tree-array .array-toolbar .toolbar-hint {
    margin-left: 12px;
    font-size: 12px;
}

.json-tree-array .array-item-readonly {
    margin-bottom: 6px;
}

/* --- Import modals ----------------------------------------------------- */

.import-site-data-form .json-info,
.import-page-data-form .json-info {
    margin-top: 6px;
    font-size: 12px;
}

.import-site-data-form .hint-line,
.import-page-data-form .hint-line {
    font-size: 12px;
}

/* --- json-array-table — overflow scroll -------------------------------- */

.json-array-table-scroll {
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: thin;
}

.json-array-table-scroll::-webkit-scrollbar {
    height: 6px;
}

.json-array-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 3px;
}

.json-array-table-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

.json-array-table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.json-array-table-scroll > .json-array-table {
    margin-bottom: 0;
}

/* --- svg-inline — preview sizing --------------------------------------- */

.svg-inline-preview {
    min-width: 120px;
    min-height: 80px;
    max-width: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.svg-inline-preview > svg {
    width: 100%;
    height: auto;
    min-height: 80px;
    max-height: 160px;
    display: block;
}

/* В модалке превью тянется по ширине модала, без ограничений миниатюры. */
.svg-preview-modal .svg-inline-preview {
    max-width: none;
    width: 100%;
}

.svg-preview-modal .svg-inline-preview > svg {
    max-height: none;
}

/* --- svg-list — колонка действий и «главное» изображение ----- */

/* Колонка с кнопками+селектором — по содержимому (приём width:1%). */
.svg-list-table .json-array-actions-cell {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
}

/* Мягкая подсветка строки с главным изображением. */
.svg-list-table .svg-list-row-main > td {
    background-color: rgba(120, 170, 120, 0.12);
}

/* Активная звезда — акцентный цвет (жёлтый), неактивная через text-muted. */
.svg-list-table [data-action="setMain"] .fa-star.fas {
    color: #e0a800;
}
