/* ===== CUSTOM STYLES ===== */
/* Объединенные стили для поиска, wiki и дополнительных функций */

/* ===== SEARCH STYLES ===== */

.wiki-search-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.wiki-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.wiki-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    font-family: inherit;
}

.wiki-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
}

.wiki-search-input::placeholder {
    color: #999;
}

.search-results-count {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: #999;
    pointer-events: none;
}

/* Hidden articles when searching */
.wiki-article.hidden {
    display: none;
}

/* Hidden categories when all articles are hidden */
.wiki-category.hidden {
    display: none;
}

/* Highlight search results */
.wiki-article.search-highlight {
    animation: highlightPulse 0.3s ease;
}

@keyframes highlightPulse {
    0% {
        background-color: #fff;
    }
    50% {
        background-color: #fffacd;
    }
    100% {
        background-color: #fff;
    }
}

/* Responsive search */
@media (max-width: 768px) {
    .wiki-search-wrapper {
        max-width: 100%;
    }

    .wiki-search-input {
        padding: 0.65rem 0.85rem;
        font-size: 0.95rem;
    }

    .search-results-count {
        font-size: 0.8rem;
        right: 0.85rem;
    }
}

/* ===== WIKI STYLES ===== */

/* Принудительное отображение wiki-контента */
.wiki-content {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.wiki-content section {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.wiki-content .wiki-main {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.wiki-content .wiki-article {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.wiki-content section h2 {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.wiki-content section p {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.wiki-content section ul,
.wiki-content section li {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Wiki-блоки показываем, но они будут анимироваться отдельно */
.wiki-highlight, 
.wiki-warning, 
.wiki-info {
    display: block !important;
    visibility: visible !important;
}

/* Показываем контейнер */
.container {
    display: block !important;
    visibility: visible !important;
}

/* Показываем сайдбар */
.wiki-sidebar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Показываем навигацию */
.wiki-breadcrumb {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ===== АНИМАЦИЯ WIKI-БЛОКОВ ===== */

/* Начальное состояние для анимации */
.wiki-block-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

/* Финальное состояние после появления в viewport */
.wiki-block-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ===== */

/* Улучшенные переходы для wiki-элементов */
.wiki-content section {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hover эффекты для wiki-блоков */
.wiki-highlight:hover,
.wiki-warning:hover,
.wiki-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

/* Плавные переходы для навигации */
.wiki-menu a {
    transition: color 0.2s ease, background-color 0.2s ease;
}

/* Анимация для breadcrumb */
.wiki-breadcrumb a {
    transition: color 0.2s ease;
}

.wiki-breadcrumb a:hover {
    opacity: 0.8;
}

/* ===== WIKI SECTION STYLES ===== */

.wiki-section {
    padding: 2rem 0;
    background: #f8f9fa;
    min-height: 70vh;
}

.wiki-content {
    display: block;
}

/* Category Styles */
.wiki-category {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #667eea;
    display: inline-block;
    font-weight: 700;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Wiki Article Card */
.wiki-article {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid #667eea;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.wiki-article:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.2);
    border-left-color: #764ba2;
}

.article-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: inline-block;
}

.wiki-article h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    flex-grow: 1;
}

.wiki-article h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.wiki-article h3 a:hover {
    color: #667eea;
}

.wiki-article p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.read-more {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-top: auto;
}

.read-more:hover {
    color: #764ba2;
    transform: translateX(4px);
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }

    .category-title {
        font-size: 1.4rem;
    }

    .wiki-article {
        padding: 1.25rem;
    }
}

/* Page Header Enhancement */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.page-header p {
    font-size: 1.1rem;
    opacity: 0.95;
}