/* ====================== 07-MODAL.CSS ====================== */
/* Основные стили модального окна */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    max-width: 90%;
    width: 420px;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

body.theme-dark .modal-content {
    background: #2d2d2d;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-close {
    float: right;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    color: #666;
}

body.theme-dark .modal-close {
    color: #bbb;
}

.modal-body {
    max-height: 60vh;
    overflow-y: auto;
    margin-top: 15px;
}

/* Улучшенный стиль для редактирования */
#modalEditBody {
    max-height: 70vh;
    overflow-y: auto;
}

/* Скроллбар для модалок */
.modal-body::-webkit-scrollbar,
#modalEditBody::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-thumb,
#modalEditBody::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 10px;
}

body.theme-dark .modal-body::-webkit-scrollbar-thumb,
body.theme-dark #modalEditBody::-webkit-scrollbar-thumb {
    background: #555;
}

/* ====================== БЛОКИРОВКА ПОДСВЕТКИ ДЕРЕВА ПРИ ОТКРЫТОЙ МОДАЛКЕ ====================== */

/* Когда модалка открыта — полностью убираем активную подсветку дерева */
.modal[style*="display: flex"],
.modal[style*="display: block"] ~ #miniAppContent .node.active {
    background-color: transparent !important;
    box-shadow: none !important;
}

/* Дополнительная защита (на случай, если модалка имеет display:flex) */
body:has(.modal[style*="flex"]) #miniAppContent .node.active,
body:has(#modal[style*="flex"]) #miniAppContent .node.active {
    background-color: transparent !important;
}

/* Breadcrumb в модалке */
.modal-content .breadcrumb {
    background: #f0f7ff;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 18px;
    font-size: 0.92em;
}