/*header-burger-menu.css*/
/* ========== MOBILE NAVIGATION ========== */
.mobile-menu {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100vh;
    background-color: #1e1e1e;
    padding: 24px 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    transition: left 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu.open {
    left: 0;
}

/* Контент меню */
.mobile-menu-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Список */
.mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Общие стили для всех пунктов меню */
.mobile-menu-list li {
    list-style: none;
    margin: 0;
}

.mobile-menu-list li a,
.mobile-menu-list .trigger-link,
.mobile-menu-list .submenu-title {
    color: white;
    text-decoration: none;
    display: block;
    padding: 12px 0;
    font-size: 1.1rem;
    cursor: pointer;
}

/* Разделители между пунктами (кроме последнего) */
.mobile-menu-list > li:not(:last-child) {
    border-bottom: 1px solid #333;
}

/* Ховер */
.mobile-menu-list li a:hover,
.mobile-menu-list .trigger-link:hover,
.mobile-menu-list .submenu-title:hover {
    color: #ff6600;
}

/* Активная ссылка */
.mobile-menu-list a.active,
.mobile-menu-list .trigger-link.active,
.mobile-menu-list .submenu-title.active {
    color: #00BFFF;
    font-weight: bold;
    border-left: 3px solid #00BFFF;
    padding-left: 12px;
    margin-left: -12px;
}

/* ========== АККОРДЕОН ДЛЯ ПРОГРАММИРОВАНИЯ ========== */
.submenu {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    padding-left: 20px;
    margin: 0;
    list-style: none;
}

.submenu.open {
    max-height: 500px;
    opacity: 1;
}

/* Стили для пунктов книг */
.submenu li {
    list-style: none;
    margin: 0;
    padding: 4px 0;  /* ← вертикальные отступы между пунктами */
}

.submenu .book-link {
    color: #ccc;
    text-decoration: none;
    display: block;
    padding: 10px 12px;  /* ← внутренние отступы */
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 6px;  /* ← скругление углов */
    transition: all 0.2s ease;
}

.submenu .book-link:hover {
    background-color: #2a2a2a;  /* ← фон при наведении */
    color: #ff6600;
}

/* Активная книга */
.submenu .book-link.active {
    color: #00BFFF;
    font-weight: bold;
    background: linear-gradient(90deg, #00BFFF11 0%, transparent 100%);
    border-left: 3px solid #00BFFF;
    padding-left: 9px;
    margin-left: -12px;
}

/* Разделители между книгами (опционально) */
.submenu li:not(:last-child) {
    border-bottom: 1px solid #2a2a2a;
}

/* ========== ШАПКА МЕНЮ (КРЕСТИК) ========== */
.mobile-menu-header {
    display: flex;
    justify-content: flex-end;
    padding-bottom: 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid #333;
}

.mobile-menu-close {
    font-size: 1.3rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    line-height: 1;
}

/* ========== ОВЕРЛЕЙ ========== */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========== ПОДМЕНЮ (выезжающее) ========== */
.mobile-submenu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1e1e1e;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-submenu.open {
    transform: translateX(0);
}

.mobile-submenu-header {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #333;
}

.mobile-submenu-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px;
    margin-right: 16px;
    line-height: 1;
}

.mobile-submenu-title {
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
}

.mobile-submenu-content {
    flex: 1;
    padding: 16px;
}

/* ========== ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКОВ ========== */
#mobile-lang-layout {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #333;
}

/* Стрелочка для пунктов с подменю */
.submenu-arrow {
    color: white;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    cursor: pointer;
    padding: 12px 0 12px 12px;
}

.submenu-arrow.open {
    transform: rotate(90deg);
}

/* Ссылка в пункте с подменю */
.mobile-menu-list .trigger-link {
    flex: 1;
    padding: 12px 0;
}



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

.mobile-reference-tree {
    padding: 8px 0;
}

.mobile-ref-type-item {
    margin-bottom: 4px;
}

.mobile-ref-type-toggle {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ccc;
}

.mobile-ref-type-toggle:hover {
    background-color: #2a2a2a;
    color: #ff6600;
}

.mobile-ref-type-toggle .type-icon {
    margin-right: 10px;
    font-size: 1rem;
}

.mobile-ref-type-toggle .type-name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

.mobile-ref-type-toggle .type-toggle-icon {
    font-size: 0.65rem;
    color: #666;
    transition: transform 0.3s ease;
}

.mobile-ref-type-toggle.open .type-toggle-icon {
    transform: rotate(90deg);
    color: #ff6600;
}

.mobile-ref-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding-left: 20px;
}

.mobile-ref-category-list.open {
    max-height: 500px;
    padding: 4px 0 8px 20px;
}

.mobile-ref-category-list li {
    padding: 3px 0;
}

.mobile-ref-category-list a {
    color: #999;
    text-decoration: none;
    font-size: 0.85rem;
    display: block;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mobile-ref-category-list a:hover {
    background-color: #2a2a2a;
    color: #fff;
}

.mobile-ref-category-list li.active a {
    color: #ff6600;
    background-color: #ff660022;
    border-left: 2px solid #ff6600;
}

.empty-message {
    color: #555;
    font-size: 0.8rem;
    padding: 6px 12px;
    font-style: italic;
}