/* --- Исправленная навигация по статье --- */

/* Панель навигации */
.article-nav-panel {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100%;
    background-color: #ffffff;
    box-shadow: 2px 0 15px rgba(1, 163, 222, 0.15);
    z-index: 99999; /* Максимальный z-index */
    transition: left 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    font-family: 'Open Sans', sans-serif;
    border-right: 3px solid #01a3de;
}

.article-nav-panel.open {
    left: 0;
}

.article-nav-panel .menu-content {
    padding: 25px 20px;
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Заголовок */
.article-nav-panel .nav-title {
    font-weight: 700;
    color: #202c45;
    font-size: 18px;
    margin-bottom: 20px !important;
    padding-bottom: 12px;
    border-bottom: 2px solid #01a3de;
    text-align: center;
}

/* Кнопка закрытия */
.close-panel-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 22px;
    color: #202c45;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px;
    border-radius: 3px;
}

.close-panel-btn:hover {
    color: #01a3de;
    background-color: #f8f9fa;
}

/* Навигация */
.navigation-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: block;
    padding: 8px 12px;
    color: #202c45;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    border-radius: 5px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background-color: #f0f8ff;
    color: #01a3de !important;
    border-left-color: #01a3de;
    padding-left: 15px;
}

/* Группы с подссылками */
.nav-group {
    margin-bottom: 4px;
}

.nav-sublinks {
    padding-left: 15px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-sublink {
    display: block;
    padding: 5px 10px;
    color: #555;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 400;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.nav-sublink:hover {
    background-color: #f8f9fa;
    color: #01a3de !important;
    padding-left: 13px;
}

/* Кнопка-переключатель */
.article-nav-toggle {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #01a3de, #0091cc);
    color: #ffffff !important;
    width: 50px;
    height: 50px;
    border-radius: 0 25px 25px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99998;
    box-shadow: 2px 2px 12px rgba(1, 163, 222, 0.3);
    transition: all 0.3s cubic-bezier(0.77, 0, 0.175, 1);
    border: none;
    font-size: 20px;
    text-decoration: none !important;
}

.article-nav-toggle:hover {
    background: linear-gradient(135deg, #202c45, #1a2439);
    color: #ffffff !important;
    box-shadow: 3px 3px 15px rgba(32, 44, 69, 0.4);
    width: 55px;
}

/* Подсказка */
.article-nav-toggle .tooltip-text {
    position: absolute;
    left: 60px;
    background: #202c45;
    color: #fff;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    pointer-events: none;
    font-weight: 500;
}

.article-nav-toggle:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
}

/* Оверлей */
.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(32, 44, 69, 0.4);
    z-index: 99997;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    backdrop-filter: blur(2px);
}

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

/* Адаптивность */
@media (max-width: 768px) {
    .article-nav-panel {
        width: 280px;
        left: -280px;
    }
    .article-nav-toggle {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    .article-nav-toggle .tooltip-text {
        display: none;
    }
}
