/* /Istraforum/css/style.css */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: linear-gradient(135deg, #f5f7fa 0%, #e4eaf5 100%); 
    color: #333; 
    line-height: 1.6;
    min-height: 100vh;
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
}

/* Header Styles */
header { 
    background: linear-gradient(135deg, #1a3b5d 0%, #2c5282 100%); 
    color: white; 
    padding: 1.2rem 0; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 a { 
    color: white; 
    text-decoration: none; 
    font-size: 1.8rem; 
    font-weight: 700;
    transition: transform 0.3s ease;
}

header h1 a:hover {
    transform: scale(1.05);
}

nav { 
    display: flex;
    align-items: center;
}

nav a { 
    color: white; 
    margin-left: 1.5rem; 
    text-decoration: none; 
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #a0d8f1;
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

nav a:hover { 
    color: #a0d8f1; 
}

/* Main Content */
main { 
    padding: 3rem 0; 
    min-height: 70vh; 
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #1a3b5d;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    color: #555;
    max-width: 700px;
    margin: 0 auto;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #1a3b5d, #2c5282);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #1a3b5d;
}

.card p {
    margin-bottom: 1.5rem;
    color: #555;
}

/* Button Styles */
.btn { 
    display: inline-block; 
    padding: 0.8rem 1.5rem; 
    background: linear-gradient(135deg, #1a3b5d 0%, #2c5282 100%); 
    color: white; 
    text-decoration: none; 
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(26, 59, 93, 0.3);
}

.btn:hover { 
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(26, 59, 93, 0.4);
}

/* Form Styles */
form { 
    background: white; 
    padding: 2rem; 
    border-radius: 12px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); 
    margin-bottom: 2rem;
}

input, textarea, select { 
    width: 100%; 
    padding: 0.8rem; 
    margin: 0.5rem 0; 
    border: 1px solid #ddd; 
    border-radius: 8px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: #1a3b5d;
    box-shadow: 0 0 0 3px rgba(26, 59, 93, 0.1);
    outline: none;
}

/* Footer */
footer { 
    background: #111; 
    color: #aaa; 
    text-align: center; 
    padding: 2rem 0; 
    font-size: 0.9rem;
    margin-top: 3rem;
}

/* Alert Styles */
.errors {
    background: #ffebee;
    color: #c62828;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    list-style: none;
    border-left: 4px solid #c62828;
}

.errors li { 
    margin: 0.3rem 0; 
}

.success {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #2e7d32;
}

/* User Info in Navigation */
nav span {
    color: #a0d8f1;
    margin-left: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    header h1 {
        margin-bottom: 1rem;
    }
    
    nav {
        width: 100%;
        flex-wrap: wrap;
    }
    
    nav a {
        margin: 0.5rem 1rem 0.5rem 0;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Animation for page load */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.6s ease forwards;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }


.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #1a3b5d;
}
.profile-bio {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
}

/* --- Стили для страницы Вики --- */

/* Основной контейнер для страницы вики */
.wiki-home {
    display: flex;
    flex-direction: column;
    gap: 2.5rem; /* Расстояние между шапкой и сеткой */
}

/* Шапка страницы вики */
.wiki-header {
    text-align: center;
    padding: 2rem 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.wiki-header h1 {
    font-size: 2.5rem;
    color: #1a3b5d;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.wiki-header p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 2rem;
}

/* Контейнер для поиска и кнопок действий */
.wiki-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap; /* Переносим кнопки на новую строку на маленьких экранах */
}

/* Стилизация формы поиска */
.search-form {
    display: flex;
    max-width: 400px;
    width: 100%;
    flex-grow: 1; /* Позволяет форме занимать доступное место */
}

.search-form input[type="text"] {
    flex-grow: 1; /* Поле ввода растягивается */
    padding: 0.8rem 1.2rem;
    border: 1px solid #ddd;
    border-right: none; /* Убираем правую границу, чтобы слиться с кнопкой */
    border-radius: 50px 0 0 50px; /* Скругляем только левую сторону */
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-form input[type="text"]:focus {
    border-color: #1a3b5d;
    box-shadow: 0 0 0 3px rgba(26, 59, 93, 0.1);
    outline: none;
}

.search-form button {
    border-radius: 0 50px 50px 0; /* Скругляем только правую сторону */
    border: none;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}

/* Вторичная кнопка */
.btn.secondary {
    background: transparent;
    color: #1a3b5d;
    border: 2px solid #1a3b5d;
    box-shadow: none;
}

.btn.secondary:hover {
    background: #1a3b5d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(26, 59, 93, 0.2);
}


/* Сетка для блоков "Новые", "Обновлённые", "Популярные" */
.wiki-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Стилизация каждого блока */
.wiki-block {
    background: white;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.wiki-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.wiki-block h3 {
    font-size: 1.3rem;
    color: #1a3b5d;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #eef2f7;
}

/* Список статей */
.article-list {
    list-style: none;
    flex-grow: 1; /* Позволяет списку занять все доступное место в блоке */
}

.article-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.article-list li:last-child {
    border-bottom: none;
}

.article-list li:hover {
    background-color: #f8f9fa;
    margin: 0 -1rem; /* Растягиваем фон на всю ширину блока */
    padding-left: 1rem;
    padding-right: 1rem;
    border-radius: 8px;
}

.article-list a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    display: block;
    margin-bottom: 0.25rem;
    transition: color 0.2s ease;
}

.article-list a:hover {
    color: #1a3b5d;
}

.article-list small {
    color: #777;
    font-size: 0.85rem;
}

/* Сообщение об отсутствии статей */
.wiki-block > p {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 2rem 0;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .wiki-header h1 {
        font-size: 2rem;
    }

    .wiki-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        max-width: 100%;
    }

    .wiki-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

form label {
    display: block;
    margin: 1rem 0 0.4rem;
    font-weight: 500;
    color: #1a3b5d;
}
form input[type="text"],
form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border 0.2s;
}
form input:focus, form textarea:focus {
    border-color: #1a3b5d;
    outline: none;
}
.form-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

.article-view {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}
.article-header h1 {
    margin: 0 0 1rem;
    color: white;
    font-size: 2.2rem;
}
.article-meta {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
.article-meta a {
    color: #1a3b5d;
    text-decoration: none;
    font-weight: 500;
}
.article-meta a:hover { text-decoration: underline; }
.article-actions {
    margin: 1rem 0;
}

.article-tags {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px dashed #ddd;
}
.tag {
    display: inline-block;
    background: #e3f2fd;
    color: #1565c0;
    padding: 0.3rem 0.7rem;
    margin: 0.3rem;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
}
.tag:hover {
    background: #bbdefb;
}
.back-link {
    text-align: center;
    margin: 2rem 0;
}
.back-link a {
    color: #666;
    text-decoration: none;
}
.back-link a:hover { text-decoration: underline; }

/* === ВИКИ: СТРАНИЦА СТАТЬИ (УЛУЧШЕННАЯ ВЕРСИЯ) === */
.wiki-article { 
    max-width: 1200px; 
    margin: 2rem auto; 
    padding: 0 1rem; 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.article-wrapper {
    display: grid;
    /* Основная колонка занимает всё доступное место, боковая - всего 220px */
    grid-template-columns: 1fr 220px; 
    gap: 2rem;
    align-items: start;
}

/* --- ОСНОВНАЯ КОЛОНКА --- */
.article-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.article-header {
    background: linear-gradient(135deg, #1a3b5d, #2c5282);
    color: white;
    padding: 2rem 2.5rem;
    position: relative;
}

.article-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    padding-right: 3rem; /* Место для кнопки редактирования */
}

.edit-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255,255,255,0.15);
    color: white;
    padding: 0.6rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
}
.edit-btn:hover { background: rgba(255,255,255,0.25); }

.article-content {
    padding: 1.5rem 1.5rem; /* Увеличены горизонтальные отступы для лучшей читаемости */
    font-size: 1rem;
    line-height: 1.8;
    color: #374151;
}

/* Теги теперь в самом низу */
.article-tags {
    padding: 1.5rem 2.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    border-top: 1px solid #f0f0f0; /* Граница сверху для разделения */
    margin-top: 1rem; /* Отступ от контента */
}
.tag {
    background: #e3f2fd;
    color: #1565c0;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}
.tag:hover { background: #bbdefb; transform: translateY(-1px); }

/* --- БОКОВАЯ ПАНЕЛЬ (УМЕНЬШЕНА) --- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.2rem; /* Уменьшен отступ между блоками */
}

/* Оглавление */
.toc-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 1.2rem; /* Уменьшены отступы */
    position: sticky;
    top: 2rem;
}
.toc-title {
    margin: 0 0 0.8rem 0; /* Уменьшен отступ */
    font-size: 1rem; /* Уменьшен размер шрифта */
    color: #1a3b5d;
    font-weight: 600;
}
.toc-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
}
.toc-item { margin-bottom: 0.5rem; }
.toc-item a {
    color: #4b5563;
    text-decoration: none;
    font-size: 0.9rem; /* Уменьшен размер шрифта */
    display: block;
    padding: 0.2rem 0;
    border-left: 2px solid transparent;
    padding-left: 0.8rem;
    transition: all 0.2s;
}
.toc-item a:hover {
    color: #1a3b5d;
    border-left-color: #1a3b5d;
}
.toc-level-3 { padding-left: 1.5rem; }
.toc-level-3 a { font-size: 0.85rem; color: #6b7280; }

/* Метаданные */
.meta-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 1.2rem; /* Уменьшены отступы */
    font-size: 0.85rem; /* Уменьшен размер шрифта */
}
.meta-item {
    margin-bottom: 0.8rem; /* Уменьшен отступ */
    line-height: 1.5;
}
.meta-item:last-child { margin-bottom: 0; }
.meta-item strong {
    color: #1a3b5d;
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.8rem; /* Уменьшен размер шрифта */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.meta-item a {
    color: #1565c0;
    text-decoration: none;
    font-weight: 500;
}
.meta-item a:hover { text-decoration: underline; }

.meta-actions {
    margin-top: 1.2rem; /* Уменьшен отступ */
    padding-top: 1.2rem;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 0.6rem; /* Уменьшен отступ */
}
.action-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem; /* Уменьшены отступы */
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem; /* Уменьшен размер шрифта */
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-family: inherit;
    font-weight: 500;
}
.edit-action {
    background: #e3f2fd;
    color: #1565c0;
}
.edit-action:hover { background: #bbdefb; }
.share-action {
    background: #f5f7fa;
    color: #4b5563;
}
.share-action:hover { background: #e5e7eb; }

/* --- СТИЛИ КОНТЕНТА СТАТЬИ --- */
.article-content h2 {
    font-size: 0.8rem;
    color: #1a3b5d;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}
.article-content h3 {
    margin: 2rem 0 1rem 0;
    font-size: 1.3rem;
    color: #1a3b5d;
}
.article-content p { margin-bottom: 1.2rem; }
.article-content ul, .article-content ol { margin-bottom: 1.2rem; padding-left: 1.8rem; }
.article-content li { margin-bottom: 0.5rem; }
.article-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid #1a3b5d;
    background-color: #f8fafc;
    font-style: italic;
    color: #4b5563;
}
.article-content code {
    background-color: #f1f5f9;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
    color: #d6336c;
}
.article-content pre {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}
.article-content pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}
.article-content .table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.article-content table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
    font-size: 0.95rem;
}
.article-content th, .article-content td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
.article-content th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #374151;
}
.article-content .article-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* --- ОБЩИЕ ЭЛЕМЕНТЫ --- */
.back-link {
    text-align: center;
    margin-top: 3rem;
    font-size: 1rem;
}
.back-link a {
    color: #1565c0;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background 0.2s;
}
.back-link a:hover { 
    text-decoration: underline;
    background: #f0f4f8;
}

.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a3b5d;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* --- АДАПТИВНОСТЬ --- */
@media (max-width: 1024px) {
    .article-wrapper {
        grid-template-columns: 1fr; /* Боковая панель становится полной шириной */
    }
    .sidebar {
        order: -1; /* Показываем боковую панель первой */
    }
    .toc-container, .meta-card {
        position: static; /* Отменяем sticky */
    }
}

@media (max-width: 600px) {
    .article-header, .article-content, .article-tags {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    .article-title {
        font-size: 1.6rem;
    }
    .article-content {
        font-size: 1rem;
    }
    .article-content h2 {
        font-size: 1.4rem;
    }
    .article-content h3 {
        font-size: 1.2rem;
    }
}

.toc {
    background: #f8f9fa;
    padding: 1.2rem;
    border-radius: 8px;
    margin: 2rem 0;
    border: 1px solid #e3f2fd;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.toc h3 {
    margin: 0 0 0.8rem;
    color: #1a3b5d;
    font-size: 1.1rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5rem;
}
.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.toc li {
    margin: 0.4rem 0;
}
.toc a {
    color: #1565c0;
    text-decoration: none;
    font-size: 0.95rem;
}
.toc a:hover {
    text-decoration: underline;
    color: #0d47a1;
}

/* === ПОИСК === */
.wiki-search {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.search-form-inline {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.search-form-inline input {
    flex: 1;
    min-width: 250px;
    padding: 0.8rem 1rem;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 1.1rem;
}
.search-info {
    color: #555;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}
.search-results {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}
.search-result {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #1a3b5d;
}
.search-result h3 {
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
}
.search-result h3 a {
    color: #1a3b5d;
    text-decoration: none;
}
.search-result h3 a:hover {
    text-decoration: underline;
}
.search-result .snippet {
    color: #333;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0.5rem 0;
}
.search-result .meta {
    color: #666;
    font-size: 0.9rem;
    margin: 0.8rem 0 0;
}
.search-result .meta a {
    color: #1565c0;
    text-decoration: none;
}
.search-result .meta a:hover {
    text-decoration: underline;
}
mark {
    background: #fff3cd;
    color: #d39e00;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    font-weight: 600;
}
.no-results {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 2rem;
}
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2.5rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}
.pagination span {
    color: #555;
    font-weight: 500;
}

/* Адаптивность */
@media (max-width: 600px) {
    .search-form-inline {
        flex-direction: column;
    }
    .search-form-inline input {
        width: 100%;
    }
}

.search-form-inline select {
    padding: 0.8rem 1rem;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}
.search-info em {
    color: #1a3b5d;
    font-weight: 500;
    font-style: normal;
}

/* === ПРОФИЛЬ ПОЛЬЗОВАТЕЛЯ === */
.profile { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }
.profile-header {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 1.5rem;
}
.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e3f2fd;
}
.profile-info h2 { margin: 0 0 0.5rem; color: #1a3b5d; }
.profile-info p { margin: 0.3rem 0; color: #555; }

.profile-bio {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 1.5rem;
}
.profile-bio h3 { margin-top: 0; color: #1a3b5d; }

.profile-articles {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.profile-articles h3 { margin-top: 0; color: #1a3b5d; }
.articles-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.articles-list li {
    padding: 0.7rem 0;
    border-bottom: 1px dashed #eee;
}
.articles-list li:last-child { border-bottom: none; }
.articles-list a {
    color: #1565c0;
    text-decoration: none;
    font-weight: 500;
}
.articles-list a:hover { text-decoration: underline; }
.articles-list small { color: #777; font-size: 0.9rem; }

.admin-note { font-style: italic; color: #d32f2f; background: #ffebee; padding: 0.8rem; border-radius: 6px; }

.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 500; }
.form-group input[type="file"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 0.7rem;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}
.form-group input[type="checkbox"] { width: auto; margin-right: 0.5rem; }

/* === ИНФОБОКС === */
.article-infobox {
    float: right;
    width: 300px;
    margin: 0 0 1.5rem 1.5rem;
    background: #f8f9fa;
    border: 1px solid #e3f2fd;
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.95rem;
}
.infobox-image {
    width: 100%;
    height: auto;
    display: block;
}
.infobox-table {
    width: 100%;
    border-collapse: collapse;
}
.infobox-table th {
    background: #1a3b5d;
    color: white;
    padding: 0.8rem;
    font-size: 1.1rem;
    text-align: center;
}
.infobox-table td, .infobox-table th {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #eee;
}
.infobox-table tr:last-child td {
    border-bottom: none;
}
.infobox-list {
    margin: 0;
    padding-left: 1.2rem;
}
.infobox-list li {
    margin: 0.4rem 0;
}
.infobox-list strong { color: #1a3b5d; }

/* Адаптивность */
@media (max-width: 900px) {
    .article-infobox {
        float: none;
        width: 100%;
        margin: 0 0 1.5rem 0;
    }
}

/* === ВИДЕО-ХОСТИНГ === */
.video-home { max-width: 1200px; margin: 2rem auto; padding: 0 1rem; }
.page-title { text-align: center; color: #1a3b5d; margin-bottom: 1.5rem; }

.upload-btn-wrapper { text-align: center; margin-bottom: 2rem; }

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.video-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}
.video-card:hover { transform: translateY(-4px); }

.video-link { text-decoration: none; color: inherit; display: block; }
.video-thumb {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: #000;
}
.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.play-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    pointer-events: none;
}

.video-title {
    margin: 0.8rem 1rem 0.4rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a3b5d;
    line-height: 1.3;
}
.video-meta {
    margin: 0 1rem 1rem;
    font-size: 0.9rem;
    color: #666;
}
.video-meta .channel { color: #1565c0; }

.pagination { text-align: center; margin: 3rem 0; }
.no-content { text-align: center; color: #888; font-style: italic; }

/* Форма загрузки */
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

/* === ВИДЕО-ХОСТИНГ: СПИСОК И ПРОСМОТР === */
.video-home { max-width: 1200px; margin: 2rem auto; padding: 0 1rem; }
.page-title { text-align: center; color: #1a3b5d; margin-bottom: 1.5rem; font-size: 2rem; }
.upload-btn-wrapper { text-align: center; margin-bottom: 2rem; }

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.video-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}
.video-card:hover { transform: translateY(-4px); }
.video-link { text-decoration: none; color: inherit; display: block; }

.video-thumb {
    position: relative;
    width: 100%;
    height: 160px;
    background: #000;
    overflow: hidden;
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.play-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    width: 50px; height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    pointer-events: none;
}

.video-title {
    margin: 0.8rem 1rem 0.4rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a3b5d;
    line-height: 1.3;
}
.video-meta { margin: 0 1rem 1rem; font-size: 0.9rem; color: #666; }
.video-meta .channel { color: #1565c0; font-weight: 500; }

/* Пагинация */
.pagination { text-align: center; margin: 3rem 0; display: flex; justify-content: center; align-items: center; gap: 1rem; }
.page-btn, .page-info { padding: 0.5rem 1rem; border-radius: 6px; }
.page-btn { background: #e3f2fd; color: #1565c0; text-decoration: none; }
.page-btn:hover { background: #bbdefb; }
.page-info { background: #f8f9fa; color: #555; }

/* Страница видео */
.video-player-page { max-width: 1100px; margin: 2rem auto; padding: 0 1rem; }
.video-main { background: white; border-radius: 12px; padding: 1.5rem; box-shadow: 0 2px 12px rgba(0,0,0,0.06); margin-bottom: 2rem; }
.video-container { margin-bottom: 1.5rem; }
.video-info { border-top: 1px solid #eee; padding-top: 1rem; }
.video-title { margin: 0 0 0.5rem; font-size: 1.8rem; color: #1a3b5d; }
.video-stats { color: #666; font-size: 0.95rem; margin-bottom: 1rem; }
.video-actions { margin-bottom: 1rem; }
.vote-btn {
    background: #f8f9fa; border: 1px solid #ddd; padding: 0.5rem 1rem; margin-right: 0.5rem;
    border-radius: 6px; cursor: pointer; font-size: 0.9rem;
}
.vote-btn.active { background: #e3f2fd; border-color: #1565c0; color: #1565c0; }
.channel-info { margin-bottom: 1rem; font-size: 1rem; }
.channel-info a { color: #1565c0; text-decoration: none; font-weight: 500; }
.channel-info a:hover { text-decoration: underline; }
.video-description { line-height: 1.6; color: #333; }

/* Комментарии */
.comments-section { background: white; border-radius: 12px; padding: 1.5rem; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.comments-section h3 { margin-top: 0; color: #1a3b5d; }
.comment-form { margin-bottom: 1.5rem; }
.comment-form textarea { width: 100%; padding: 0.8rem; border: 1.5px solid #ddd; border-radius: 6px; resize: vertical; }
.comment-form button { margin-top: 0.5rem; }
.comments-list { border-top: 1px solid #eee; padding-top: 1rem; }
.comment { padding: 1rem 0; border-bottom: 1px dashed #eee; }
.comment:last-child { border-bottom: none; }
.comment-header { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 0.4rem; }
.comment-header strong { color: #1a3b5d; }
.comment p { margin: 0; color: #333; line-height: 1.5; }
.no-comments, .no-content { text-align: center; color: #888; font-style: italic; padding: 2rem; }

/* Адаптивность */
@media (max-width: 768px) {
    .video-grid { grid-template-columns: 1fr; }
    .video-title { font-size: 1.5rem; }
}

/* === УЛУЧШЕННЫЙ ИНФОБОКС ДЛЯ ВИКИ === */
.article-infobox {
    float: right;
    width: 320px;
    margin: 0 0 1.5rem 1.8rem;
    background: #f8f9fa;
    border: 1px solid #e3f2fd;
    border-radius: 14px;
    overflow: hidden;
    font-size: 0.94rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}
.article-infobox:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.infobox-image-wrapper {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #000;
}
.infobox-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.article-infobox:hover .infobox-image {
    transform: scale(1.05);
}

.infobox-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}
.infobox-table thead th.infobox-title {
    background: linear-gradient(135deg, #1a3b5d, #1565c0);
    color: white;
    padding: 1rem 0.8rem;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.infobox-subtitle {
    text-align: center;
    padding: 0.6rem 0.8rem;
    font-style: italic;
    color: #555;
    background: #e3f2fd;
    font-size: 0.95rem;
}
.infobox-table th {
    background: #bbdefb;
    color: #1a3b5d;
    padding: 0.75rem 0.9rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.92rem;
    width: 38%;
}
.infobox-table td {
    padding: 0.75rem 0.9rem;
    background: #ffffff;
    color: #333;
}
.infobox-table tr:last-child td,
.infobox-table tr:last-child th {
    border-bottom: none;
}
.infobox-list {
    margin: 0;
    padding-left: 1.1rem;
    line-height: 1.5;
}
.infobox-list li {
    margin: 0.45rem 0;
}
.infobox-list strong {
    color: #1a3b5d;
}
.infobox-list em {
    color: #666;
    font-size: 0.92rem;
}

/* Адаптивность */
@media (max-width: 900px) {
    .article-infobox {
        float: none;
        width: 100%;
        margin: 0 0 1.8rem 0;
    }
    .infobox-image-wrapper {
        height: 200px;
    }
}