/**
 * ==========================================================================
 * MPSET.pro — Knowledge Base Unique Styles
 * Путь: /frontend/public/css/pages/cabinet/knowledge-base.css
 * Версия: 4.3 (2026-07-15)
 * Описание: Добавлен стиль для кнопки «Скопировать ссылку» (иконка-призрак).
 * ==========================================================================
 */

/* Боковое меню (фиксированное) */
.kb-sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 99;
}

/* Основной контент */
.kb-content {
    margin-left: 260px;
    margin-top: 64px;
    padding: 24px 32px 70px 32px;
    min-height: calc(100vh - 64px);
}

/* Хлебные крошки */
.kb-breadcrumbs {
    margin-bottom: 24px;
}

/* Меню */
.kb-nav {
    padding: 20px 0;
}
.kb-nav .kb-section {
    margin-bottom: 8px;
}
.kb-nav .kb-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.kb-nav .kb-section-header:hover {
    background: var(--gray-100);
    color: var(--text-primary);
    transform: translateX(4px);
}
.kb-nav .kb-section-header i {
    width: 20px;
    color: var(--text-secondary);
    transition: transform 0.2s;
}
.kb-nav .kb-section-header:hover i {
    color: var(--text-primary);
    transform: scale(1.1);
}
.kb-nav .kb-section-header .kb-section-title {
    flex: 1;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}
.kb-nav .kb-section-toggle {
    color: var(--text-muted);
    font-size: 12px;
    transition: transform 0.2s;
}
.kb-nav .kb-subsections {
    margin-left: 32px;
    margin-top: 4px;
}
.kb-nav .kb-subsection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}
.kb-nav .kb-subsection-header:hover {
    background: var(--gray-50);
}
.kb-nav .kb-subsection-header span {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}
.kb-nav .kb-subsection-toggle {
    color: var(--text-muted);
    font-size: 10px;
    transition: transform 0.2s;
}
.kb-nav .kb-articles {
    margin-left: 16px;
    margin-top: 4px;
}
.kb-nav .kb-article-item {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.kb-nav .kb-article-item a {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-decoration: none;
    display: block;
}
.kb-nav .kb-article-item:hover {
    background: rgba(0, 91, 255, 0.08);
}
.kb-nav .kb-article-item:hover a {
    color: var(--ozon-blue);
}
.kb-nav .kb-article-item--active {
    background: rgba(0, 91, 255, 0.08);
}
.kb-nav .kb-article-item--active a {
    color: var(--ozon-blue);
    font-weight: var(--font-weight-medium);
}

/* Анимации */
.rotate-180 { transform: rotate(180deg); }
.rotate-90 { transform: rotate(90deg); }
.kb-section-toggle,
.kb-subsection-toggle {
    transition: transform 0.2s ease;
}

.hidden { display: none; }

/* Оверлей */
.kb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 98;
    display: none;
}
.kb-overlay.visible {
    display: block;
}

/* Ширина обёртки поиска */
.kb-search-width {
    width: 260px;
}
@media (max-width: 768px) {
    .kb-search-width {
        width: 180px;
    }
}
@media (max-width: 480px) {
    .kb-search-width {
        width: 140px;
    }
}

/* Результаты поиска */
.kb-search-results {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 360px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}
.kb-search-results.hidden {
    display: none;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Изображения в статьях (ограничение ширины) */
.kb-article img,
.kb-article-content img {
    max-width: 100%;
    height: auto;
    transition: transform 0.2s ease;
    cursor: pointer;
}
.kb-article img:hover,
.kb-article-content img:hover {
    transform: scale(1.02);
}

/* Кнопка «Скопировать ссылку» (иконка-призрак) */
.kb-copy-link-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.kb-copy-link-btn:hover {
    color: var(--ozon-blue);
    transform: scale(1.1);
}
.kb-copy-link-btn:active {
    transform: scale(0.95);
}
.kb-copy-link-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 91, 255, 0.3);
}

/* Тосты */
.kb-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    min-width: 280px;
    max-width: 400px;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .kb-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .kb-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .kb-content {
        margin-left: 0;
    }
    .kb-search-results {
        width: calc(100vw - 32px);
        right: auto;
        left: 16px;
    }
}