/* ============================================
   СОВРЕМЕННОЕ МЕНЮ ДЕРЕВА ЭВОЛЮЦИИ
   В стиле других modern меню
   ============================================ */

/* Основной контейнер */
.tree-menu-modern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Главное окно */
.tree-modern-window {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #00ff88;
    border-radius: 0;
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.3),
                inset 0 0 60px rgba(0, 255, 136, 0.05);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideIn {
    from {
        transform: scale(0.8) translateY(50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Заголовок */
.tree-modern-header {
    background: linear-gradient(180deg, rgba(0, 255, 136, 0.1) 0%, transparent 100%);
    border-bottom: 2px solid rgba(0, 255, 136, 0.3);
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    min-height: 80px;
}

.tree-modern-title {
    color: #00ff88;
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.tree-modern-title-icon {
    font-size: 32px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Кнопка закрытия */
.tree-modern-close {
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid rgba(255, 0, 0, 0.3);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 10001;
    flex-shrink: 0;
}

.tree-modern-close img {
    display: block;
    margin: 0 auto;
}

.tree-modern-close:hover {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.6);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
}

/* Панель управления */
.tree-modern-controls {
    background: linear-gradient(180deg, rgba(0, 255, 136, 0.08) 0%, rgba(0, 255, 136, 0.02) 100%);
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

/* Поиск и фильтры */
.tree-search-filter {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.tree-search-box {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.tree-search-input {
    width: 100%;
    padding: 10px 35px 10px 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 20px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.tree-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.tree-search-input:focus {
    border-color: rgba(0, 255, 136, 0.6);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.tree-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 0, 0, 0.2);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tree-search-clear:hover {
    background: rgba(255, 0, 0, 0.4);
}

.tree-filters {
    display: flex;
    gap: 8px;
}

.tree-filter-btn {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.tree-filter-btn:hover {
    background: rgba(0, 255, 136, 0.1);
    border-color: rgba(0, 255, 136, 0.5);
    color: white;
}

.tree-filter-btn.active {
    background: rgba(0, 255, 136, 0.2);
    border-color: rgba(0, 255, 136, 0.6);
    color: #00ff88;
    font-weight: 600;
}

.tree-zoom-control {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    border: 1px solid rgba(0, 255, 136, 0.2);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
}

.tree-zoom-control::after {
    content: 'Ctrl/⌘ + колесико';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    pointer-events: none;
}

.tree-zoom-label {
    color: #00ff88;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.tree-zoomslider {
    width: 200px;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, 
        rgba(0, 173, 241, 0.3) 0%, 
        rgba(0, 255, 136, 0.3) 100%);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Заполненная часть слайдера */
.tree-zoomslider::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 4px;
}

.tree-zoomslider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ff88, #00adf1);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4),
                0 0 15px rgba(0, 255, 136, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    margin-top: -8px;
}

.tree-zoomslider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5),
                0 0 25px rgba(0, 255, 136, 0.8),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.tree-zoomslider::-webkit-slider-thumb:active {
    transform: scale(1.1);
}

.tree-zoomslider::-moz-range-track {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, 
        rgba(0, 173, 241, 0.3) 0%, 
        rgba(0, 255, 136, 0.3) 100%);
}

.tree-zoomslider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ff88, #00adf1);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4),
                0 0 15px rgba(0, 255, 136, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.tree-zoomslider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.tree-zoom-value {
    color: #00ff88;
    font-size: 16px;
    font-weight: 700;
    min-width: 50px;
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    background: rgba(0, 255, 136, 0.1);
    padding: 5px 12px;
    border-radius: 15px;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

/* Контент */
.tree-modern-content {
    flex: 1;
    overflow: auto;
    padding: 20px;
    position: relative;
    background: radial-gradient(ellipse at center, rgba(0, 255, 136, 0.03) 0%, transparent 70%);
}

/* ============================================
   ИНДИКАТОР ЗАГРУЗКИ
   ============================================ */

.tree-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 100;
}

.tree-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 255, 136, 0.2);
    border-top-color: #00ff88;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.tree-loading-text {
    color: #00ff88;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: pulse 1.5s ease-in-out infinite;
}

/* ============================================
   СТАТИСТИКА ДЕРЕВА
   ============================================ */

.tree-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.tree-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.tree-stat-icon {
    font-size: 18px;
}

.tree-stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tree-stat-value {
    color: #00ff88;
    font-size: 16px;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.tree-stat-separator {
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
}

/* Контейнер дерева */
.tree-modern-content .tree-container {
    width: 100%;
    min-height: 100%;
    height: auto;
    position: relative;
}

/* Убедимся что Treant контейнер виден */
.tree-modern-content .Treant {
    position: relative !important;
    overflow: visible !important;
    padding: 0 !important;
}

/* Узлы и псевдо-узлы должны быть видны */
.tree-modern-content .Treant > .node,
.tree-modern-content .Treant > .pseudo {
    position: absolute;
    display: block;
}

.tree-modern-content .Treant.loaded .node,
.tree-modern-content .Treant.loaded .pseudo {
    visibility: visible !important;
}

/* ============================================
   УЗЛЫ ДЕРЕВА - СОВРЕМЕННЫЙ ДИЗАЙН
   ============================================ */

/* Базовый стиль узла */
.tree-modern-content .evolution-tree {
    background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%) !important;
    border: 2px solid rgba(0, 173, 241, 0.4) !important;
    border-radius: 8px !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: visible;
    will-change: transform;
    /* Сохраняем базовые размеры из treant.css */
}

/* Свечение вокруг узла */
.tree-modern-content .evolution-tree::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(135deg, #00adf1, #00ff88);
    border-radius: 10px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Не мешает кликам */
}

/* Изображение внутри узла */
.tree-modern-content .evolution-tree img {
    border-radius: 4px !important;
    filter: brightness(0.9) contrast(1.1);
    transition: all 0.3s ease;
    /* Сохраняем размеры из treant.css: 40x40 */
}

/* Название узла */
.tree-modern-content .evolution-tree .node-name {
    background: linear-gradient(135deg, rgba(0, 173, 241, 0.9), rgba(0, 255, 136, 0.9)) !important;
    color: white !important;
    font-weight: 600;
    font-size: 10px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    padding: 2px 6px;
    letter-spacing: 0.3px;
    /* Позиционирование */
    text-align: center !important;
    position: absolute !important;
    width: auto !important;
    max-width: 100px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-top: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Hover эффект - упрощенный для производительности */
.tree-modern-content .evolution-tree:hover {
    transform: scale(1.1);
    z-index: 100;
    border-color: rgba(0, 255, 136, 0.8) !important;
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.4),
                0 0 20px rgba(0, 255, 136, 0.3) !important;
}

.tree-modern-content .evolution-tree:hover::before {
    opacity: 0.5;
}

.tree-modern-content .evolution-tree:hover img {
    filter: brightness(1.1) contrast(1.1);
}

.tree-modern-content .evolution-tree:hover .node-name {
    background: linear-gradient(135deg, #00ff88, #00adf1) !important;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
}

/* ============================================
   ОСВОЕННЫЕ УЗЛЫ (MASTERED)
   ============================================ */

.tree-modern-content .evolution-mastered {
    background: linear-gradient(135deg, #3a4a2e 0%, #2a3a1e 100%) !important;
    border: 2px solid rgba(154, 205, 50, 0.6) !important;
    box-shadow: 0 4px 15px rgba(154, 205, 50, 0.3),
                0 0 20px rgba(154, 205, 50, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

.tree-modern-content .evolution-mastered::before {
    background: linear-gradient(135deg, #9acd32, #7cfc00);
}

.tree-modern-content .evolution-mastered .node-name {
    background: linear-gradient(135deg, rgba(154, 205, 50, 0.95), rgba(124, 252, 0, 0.95)) !important;
    color: #1a1a1a !important;
    font-weight: 700;
}

.tree-modern-content .evolution-mastered:hover {
    border-color: rgba(154, 205, 50, 1);
    box-shadow: 0 8px 25px rgba(154, 205, 50, 0.5),
                0 0 40px rgba(154, 205, 50, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tree-modern-content .evolution-mastered:hover::before {
    opacity: 0.8;
}

/* Убрана анимация glow для производительности */

/* ============================================
   КОРНЕВОЙ УЗЕЛ (THE-PARENT)
   ============================================ */

.tree-modern-content .evolution-tree.the-parent {
    background: radial-gradient(circle, #00ff88 0%, #00adf1 50%, #1a1a2e 100%) !important;
    border: 3px solid #00ff88 !important;
    border-radius: 50% !important;
    /* Размеры из treant.css: 3x3, но делаем чуть больше для видимости */
    min-width: 20px !important;
    min-height: 20px !important;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.6),
                0 0 60px rgba(0, 255, 136, 0.3),
                inset 0 0 20px rgba(255, 255, 255, 0.2) !important;
    animation: rootPulse 3s ease-in-out infinite;
}

.tree-modern-content .evolution-tree.the-parent .node-name {
    background: rgba(0, 0, 0, 0.8) !important;
    color: #00ff88 !important;
    font-weight: 700 !important;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes rootPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 255, 136, 0.7);
    }
}

/* Скроллбар */
.tree-modern-content::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.tree-modern-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.tree-modern-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00ff88, #00adf1);
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.2);
}

.tree-modern-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #00adf1, #00ff88);
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media (max-width: 1024px) {
    .tree-modern-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .tree-stats {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .tree-zoom-control {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .tree-modern-header {
        padding: 15px 20px;
        min-height: 60px;
    }
    
    .tree-modern-title {
        font-size: 18px;
        letter-spacing: 1px;
    }
    
    .tree-modern-title-icon {
        font-size: 24px;
    }
    
    .tree-modern-close {
        width: 40px;
        height: 40px;
        top: 15px;
        right: 20px;
    }
    
    .tree-modern-controls {
        padding: 10px 15px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .tree-search-filter {
        flex-direction: column;
        width: 100%;
    }
    
    .tree-search-box {
        max-width: 100%;
    }
    
    .tree-filters {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .tree-filter-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .tree-stats {
        gap: 10px;
    }
    
    .tree-stat-item {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .tree-stat-icon {
        font-size: 16px;
    }
    
    .tree-stat-value {
        font-size: 14px;
    }
    
    .tree-zoom-control {
        padding: 8px 15px;
    }
    
    .tree-zoom-label {
        font-size: 11px;
    }
    
    .tree-zoomslider {
        width: 120px;
    }
    
    .tree-zoom-value {
        font-size: 14px;
        padding: 4px 10px;
    }
    
    .tree-modern-content {
        padding: 10px;
    }
    
    /* Упрощаем hover эффекты на мобильных */
    .tree-modern-content .evolution-tree:hover {
        transform: scale(1.05);
    }
    
    /* Убираем сложные анимации на мобильных для производительности */
    .tree-modern-content .evolution-tree::before {
        display: none;
    }
}

@media (max-width: 480px) {
    .tree-modern-title {
        font-size: 16px;
        gap: 10px;
    }
    
    .tree-modern-title-icon {
        font-size: 20px;
    }
    
    .tree-stats {
        flex-direction: column;
        gap: 8px;
    }
    
    .tree-stat-item {
        width: 100%;
        justify-content: center;
    }
    
    .tree-zoomslider {
        width: 100px;
    }
    
    /* Меньше узлов с анимацией задержки на маленьких экранах */
    .tree-modern-content .evolution-tree:nth-child(n+11) { 
        animation-delay: 0.35s !important;
        animation-duration: 0.2s !important;
    }
}

/* ============================================
   АНИМАЦИИ ПОЯВЛЕНИЯ УЗЛОВ
   ============================================ */

/* Базовая анимация появления - только после загрузки */
.tree-modern-content .Treant.loaded .evolution-tree {
    animation: nodeAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes nodeAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Каскадный эффект появления - только первые 10 узлов для производительности */
.tree-modern-content .Treant.loaded .evolution-tree:nth-child(1) { animation-delay: 0.05s; }
.tree-modern-content .Treant.loaded .evolution-tree:nth-child(2) { animation-delay: 0.08s; }
.tree-modern-content .Treant.loaded .evolution-tree:nth-child(3) { animation-delay: 0.11s; }
.tree-modern-content .Treant.loaded .evolution-tree:nth-child(4) { animation-delay: 0.14s; }
.tree-modern-content .Treant.loaded .evolution-tree:nth-child(5) { animation-delay: 0.17s; }
.tree-modern-content .Treant.loaded .evolution-tree:nth-child(6) { animation-delay: 0.20s; }
.tree-modern-content .Treant.loaded .evolution-tree:nth-child(7) { animation-delay: 0.23s; }
.tree-modern-content .Treant.loaded .evolution-tree:nth-child(8) { animation-delay: 0.26s; }
.tree-modern-content .Treant.loaded .evolution-tree:nth-child(9) { animation-delay: 0.29s; }
.tree-modern-content .Treant.loaded .evolution-tree:nth-child(10) { animation-delay: 0.32s; }

/* Остальные узлы появляются быстро без задержки */
.tree-modern-content .Treant.loaded .evolution-tree:nth-child(n+11) { 
    animation-delay: 0.1s; 
    animation-duration: 0.2s;
}

/* Специальная анимация для освоенных узлов */
.tree-modern-content .Treant.loaded .evolution-mastered {
    animation: masteredAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes masteredAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   ЛИНИИ СВЯЗЕЙ (КОННЕКТОРЫ)
   ============================================ */

/* Базовые линии между узлами */
.tree-modern-content .Treant .node-connector {
    stroke: rgba(0, 173, 241, 0.4);
    stroke-width: 2px;
    transition: all 0.3s ease;
}

/* Линии к освоенным узлам */
.tree-modern-content .evolution-mastered ~ .node-connector,
.tree-modern-content path[stroke="yellowgreen"] {
    stroke: rgba(154, 205, 50, 0.6) !important;
    stroke-width: 3px !important;
    filter: drop-shadow(0 0 4px rgba(154, 205, 50, 0.5));
}

/* Hover эффект на линиях */
.tree-modern-content .evolution-tree:hover ~ .node-connector {
    stroke: rgba(0, 255, 136, 0.8);
    stroke-width: 3px;
    filter: drop-shadow(0 0 6px rgba(0, 255, 136, 0.6));
}

/* ============================================
   ДОПОЛНИТЕЛЬНЫЕ УЛУЧШЕНИЯ
   ============================================ */

/* Псевдо-узлы (технические) */
.tree-modern-content .pseudo {
    opacity: 0;
}

/* Tooltip использует стандартный браузерный title */

/* ============================================
   ПОИСК И ФИЛЬТРАЦИЯ
   ============================================ */

/* Подсветка найденного узла */
.tree-modern-content .evolution-tree.search-highlight {
    border-color: #ffd700 !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6),
                0 0 40px rgba(255, 215, 0, 0.3) !important;
    animation: searchPulse 1s ease-in-out infinite;
}

@keyframes searchPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Скрытые узлы при фильтрации */
.tree-modern-content .evolution-tree.filtered-hidden {
    opacity: 0.2 !important;
    pointer-events: none;
}

/* Путь к узлу */
.tree-modern-content .evolution-tree.path-highlight {
    border-color: #00adf1 !important;
    box-shadow: 0 0 15px rgba(0, 173, 241, 0.5) !important;
}

/* ============================================
   LOADING STATE
   ============================================ */

.tree-modern-content .tree-container.invisible {
    visibility: hidden !important;
    opacity: 0;
}

.tree-modern-content .tree-container:not(.invisible) {
    visibility: visible !important;
    opacity: 1;
    animation: treeAppear 0.6s ease forwards;
}

@keyframes treeAppear {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Скрыть меню */
.tree-menu-modern.hidden {
    display: none;
}

/* ============================================
   МОБИЛЬНОЕ МОДАЛЬНОЕ ОКНО С ОПИСАНИЕМ
   ============================================ */

.tree-node-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.tree-node-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #00ff88;
    border-radius: 16px;
    padding: 25px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.4);
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.tree-node-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 15px;
}

.tree-node-modal-title {
    color: #00ff88;
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    flex: 1;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.tree-node-modal-close {
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid rgba(255, 0, 0, 0.3);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    font-size: 20px;
    color: #ff4444;
}

.tree-node-modal-close:active {
    background: rgba(255, 0, 0, 0.3);
    border-color: rgba(255, 0, 0, 0.6);
    transform: scale(0.95);
}

.tree-node-modal-body {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    line-height: 1.6;
}

.tree-node-modal-body p {
    margin: 0 0 10px 0;
}

.tree-node-modal-body p:last-child {
    margin-bottom: 0;
}

/* Скроллбар для модального окна */
.tree-node-modal-content::-webkit-scrollbar {
    width: 8px;
}

.tree-node-modal-content::-webkit-scrollbar-track {
    background: rgba(0, 255, 136, 0.05);
    border-radius: 10px;
}

.tree-node-modal-content::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.3);
    border-radius: 10px;
}

.tree-node-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 136, 0.5);
}

/* Адаптация для маленьких экранов */
@media (max-width: 480px) {
    .tree-node-modal {
        padding: 15px;
    }
    
    .tree-node-modal-content {
        padding: 20px;
        max-height: 70vh;
    }
    
    .tree-node-modal-title {
        font-size: 18px;
    }
    
    .tree-node-modal-body {
        font-size: 14px;
    }
}
