/* ============================================================
   МОБИЛЬНОЕ ДЕРЕВО ДЛЯ ПОДМЕНЮ ПРОГРАММИРОВАНИЯ
   ============================================================ */

.mobile-programming-tree {
    padding: 8px 0;
    background-color: #1e1e1e;

}

/* Стили для мобильного дерева */
.mobile-programming-tree .sidebar-tree-mobile {

    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-programming-tree .tree-item {
    list-style: none;
    margin: 2px 0;

}

/* Заголовок элемента */
.mobile-programming-tree .tree-item-header {
    display: flex;
    align-items: center;
    padding: 10px 12px 10px 16px;
    border-radius: 6px;
    margin: 0 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    background: linear-gradient(90deg, #303030 0%, transparent 100%);

}

/* ============================================================
   СТИЛИ ДЛЯ ГЛАВ (ЖЕЛТЫЕ ТОНА) - МОБИЛЬНАЯ ВЕРСИЯ
   ============================================================ */

/* Ховер для заголовков глав */
.mobile-programming-tree .tree-item-header:hover .tree-chapter-title {
    color: #f1772e;
}

.mobile-programming-tree .tree-item-header:hover:has(.tree-chapter-title) {
    background-color: #ffaa0022;
}

/* Иконка разворота/сворачивания */
.mobile-programming-tree .toggle-icon {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    font-size: 10px;
    margin-right: 8px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

/* Цвет иконки для глав */
.mobile-programming-tree .tree-chapter-title + .toggle-icon,
.mobile-programming-tree .tree-item-header .toggle-icon {
    color: #ffaa66;

}

.mobile-programming-tree .toggle-icon:hover {    
    color: #ffcc44;
}

/* Название главы */
.mobile-programming-tree .tree-chapter-title {
    flex: 1;
    color: #e0c080;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;

}

/* Активная глава (если внутри неё открыта статья) */
.mobile-programming-tree .tree-item.active > .tree-item-header .tree-chapter-title {
    color: #ffaa00;
    font-weight: bold;
    text-shadow: 0 0 4px rgba(255, 170, 0, 0.5);
}

.mobile-programming-tree .tree-item.active > .tree-item-header:has(.tree-chapter-title) {
    background: linear-gradient(90deg, #9f6a00 0%, transparent 100%);
    border-left: 4px solid #bf4700;
}

/* ============================================================
   СТИЛИ ДЛЯ СТАТЕЙ (СИНИЕ ТОНА) - МОБИЛЬНАЯ ВЕРСИЯ
   ============================================================ */

/* Ссылка на статью */
.mobile-programming-tree .tree-link {
    flex: 1;
    text-decoration: none;
    padding: 4px 0;
    transition: all 0.2s ease;
    display: block;
    font-size: 0.95rem;
    color: #27acf8;
}

/* Ховер/актив для статей */
.mobile-programming-tree .tree-item-header:hover .tree-link {
    color: #44aaff;
    transform: translateX(4px);
}

.mobile-programming-tree .tree-item-header:hover:has(.tree-link) {
    background-color: #0088ff22;
}

/* Активная статья */
.mobile-programming-tree .tree-item.active > .tree-item-header .tree-link {
    color: #002340;
    font-weight: bold;
    text-shadow: 0 0 4px rgba(68, 170, 255, 0.5);
}

.mobile-programming-tree .tree-item.active > .tree-item-header:has(.tree-link) {
    background: linear-gradient(90deg, #fad465 0%, transparent 100%);
    border-left: 4px solid #df5300;
}

/* ============================================================
   ОБЩИЕ СТИЛИ ДЛЯ МОБИЛЬНОЙ ВЕРСИИ
   ============================================================ */

/* Дочерние элементы */
.mobile-programming-tree .tree-children {
    list-style: none;
    padding-left: 28px;
    margin: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    border-left: 1px dashed #3a3a3a;
    margin-left: 18px;
    padding-left: 10px;
}

/* Разделители между элементами */
.mobile-programming-tree .tree-item:not(:last-child) {
    border-bottom: 1px solid #2a2a2a;
    margin-bottom: 4px;
    padding-bottom: 2px;
}

/* Иконка для статей через псевдоэлемент */
.mobile-programming-tree .tree-item-header:has(.tree-link)::before {
    content: "•";
    font-size: 1.2rem;
    margin-right: 8px;
    color: #88aaff;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.mobile-programming-tree .tree-item-header:has(.tree-link):hover::before {
    opacity: 1;
}

/* Иконка для глав через псевдоэлемент */
.mobile-programming-tree .tree-item-header:has(.tree-chapter-title)::before {
    content: "📁";
    font-size: 0.9rem;
    margin-right: 8px;
    opacity: 0.7;
}

/* Активная глава — иконка меняется */
.mobile-programming-tree .tree-item.active > .tree-item-header:has(.tree-chapter-title)::before {
    content: "📂";
    opacity: 1;
}

/* Подсветка при наведении */
.mobile-programming-tree .tree-item-header {
    position: relative;
    transition: all 0.2s ease;
}

.mobile-programming-tree .tree-item-header:hover {
    background-color: #2a2a2a;
    transform: translateX(2px);
}

/* Тень для активного элемента */
.mobile-programming-tree .tree-item.active > .tree-item-header {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}