/* --- 3. СТИЛИ СТРАНИЦЫ БАЗЫ ЗНАНИЙ --- */
.page-hero { padding-top: 200px; padding-bottom: 80px; text-align: center; }
.page-hero h1 { margin-bottom: 20px; }
.page-hero .subtitle { max-width: 600px; margin: 0 auto 40px; color: var(--text-secondary); font-size: 1.1rem; }
.search-wrapper { max-width: 700px; margin: 0 auto; position: relative; }
#support-search { width: 100%; padding: 18px 25px; padding-left: 60px; border-radius: 12px; border: 2px solid var(--border-color); background: var(--card-bg); color: var(--text-primary); font-size: 1.1rem; outline: none; transition: all 0.3s ease; }
#support-search:focus { border-color: var(--accent); box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 30%, transparent); }
#support-search::placeholder { color: var(--text-secondary); }
.search-wrapper::before { content: '🔍'; position: absolute; left: 25px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; opacity: 0.5; }
.search-results { position: absolute; top: 110%; left: 0; width: 100%; background: #1c0530; border-radius: 8px; border: 1px solid var(--border-color); overflow: hidden; max-height: 300px; overflow-y: auto; z-index: 10; display: none; }
.search-results a { display: block; padding: 15px 25px; text-decoration: none; color: var(--text-secondary); text-align: left; }
.search-results a:hover { background-color: var(--card-bg); color: var(--text-primary); }
.search-results a:not(:last-child) { border-bottom: 1px solid var(--border-color); }
.search-results .loader { padding: 20px; display: flex; justify-content: center; }
.search-results .spinner { width: 30px; height: 30px; border: 3px solid var(--border-color); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.kb-section { padding-top: 0; }
.kb-layout { display: grid; grid-template-columns: 280px 1fr; gap: 50px; }
.kb-sidebar { border-right: 1px solid var(--border-color); padding-right: 30px; }
.kb-category-title { font-size: 1.2rem; margin-top: 20px; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid var(--border-color); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.kb-category-title:first-child { margin-top: 0; }
.kb-category-title::after { content: '▾'; transition: transform 0.3s ease; }
.kb-category-title.collapsed::after { transform: rotate(-90deg); }
.kb-articles-list { list-style: none; padding-left: 10px; max-height: 1000px; overflow: hidden; transition: max-height 0.5s ease, opacity 0.5s ease; }
.kb-category-title.collapsed + .kb-articles-list { max-height: 0; opacity: 0; }
.kb-articles-list li a { display: block; padding: 10px 15px; color: var(--text-secondary); text-decoration: none; border-radius: 6px; }
.kb-articles-list li a:hover { color: var(--text-primary); background: var(--card-bg); }
.kb-articles-list li a.active { color: var(--accent); font-weight: 600; background: var(--card-bg); }

.kb-content {
    /* Это свойство предотвращает растягивание блока дочерними элементами,
       у которых нет переноса строк (например, длинные ссылки или код).
       Оно позволяет блоку сжиматься до доступной ширины на мобильных устройствах. */
    min-width: 0;
}
.kb-content .breadcrumbs { margin-bottom: 20px; font-size: 0.9rem; color: var(--text-secondary); }
.kb-content .breadcrumbs a { color: var(--text-secondary); }
.kb-content .breadcrumbs a:hover { color: var(--accent); }
.kb-content-title { font-size: 2.5rem; margin-bottom: 10px; }
.kb-content-date { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 30px; }
.kb-article-body { line-height: 1.8; }
.kb-article-body h3 { font-size: 1.5rem; margin-top: 40px; margin-bottom: 15px; }
.kb-article-body p { margin-bottom: 20px; }
.kb-article-body ul { margin-left: 20px; margin-bottom: 20px; }
.kb-article-body code { background: var(--card-bg); padding: 2px 6px; border-radius: 4px; font-family: monospace; word-break: break-all; /* Добавим перенос для очень длинных строк */; }
.kb-article-body img { max-width: 100%; border-radius: 8px; margin: 20px 0; border: 1px solid var(--border-color); }
.kb-article-body .info-block { background: var(--card-bg); border-left: 3px solid var(--accent); padding: 20px; margin: 30px 0; border-radius: 0 8px 8px 0; }
.feedback-box { text-align: center; margin-top: 50px; padding-top: 30px; border-top: 1px solid var(--border-color); }
.feedback-box p { margin-bottom: 20px; font-weight: 500; }
.feedback-box .btn { margin: 0 5px; }
.need-help-link { display: block; text-align: center; margin-top: 30px; color: var(--text-secondary); }

/* === ПОИСК С ВЫПАДАЮЩИМ СПИСКОМ === */
.search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 30px auto 0;
}
.search-results-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #1d0a30;
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    margin-top: 2px;
    z-index: 10;
    max-height: 400px;
    overflow-y: auto;
    display: none; /* Скрыт по умолчанию */
}
.search-result-item {
    display: block;
    padding: 15px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background-color: rgba(255, 255, 255, 0.1); color: var(--text-primary); }
.search-result-item .result-title { display: block; font-weight: 600; color: var(--text-primary); }
.search-result-item .result-category {
    font-size: 0.8rem;
    color: var(--accent);
    opacity: 0.8;
}
.search-results-container .no-results {
    padding: 20px;
    color: var(--text-secondary);
    text-align: center;
}

/* --- 10. RESPONSIVE STYLES --- */
@media (max-width: 992px) {
    .kb-layout {
        grid-template-columns: 1fr;
    }

    .kb-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 30px;
        margin-bottom: 30px;
    }
}
