/* Forum/forum.css */
.forum-main {
    padding: 30px 20px;
    min-height: 80vh;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-muted, #a1a1aa);
    margin-bottom: 20px;
}

.breadcrumb a:hover {
    color: var(--primary, #ff6b57);
}

.breadcrumb .sep {
    font-size: 10px;
}

.thread-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 5px;
}

.thread-header h1 {
    font-size: 24px;
    color: #fff;
    font-weight: 600;
}

.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.badge-green {
    background-color: #28a745;
    color: #fff;
}

.thread-meta {
    font-size: 13px;
    color: var(--text-muted, #a1a1aa);
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.posts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.forum-post {
    display: flex;
    background-color: var(--bg-card, #222222);
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
}

.post-sidebar {
    width: 180px;
    background-color: #1e1e1e;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid #2a2a2a;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    color: #555;
    margin-bottom: 15px;
}

.admin-avatar {
    background-color: #4a2121;
    color: var(--primary, #ff6b57);
}

.post-author-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 8px;
    text-align: center;
    word-break: break-all;
}

.post-role {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    text-align: center;
    width: 100%;
}

.role-admin {
    background-color: #8b0000;
    color: #fff;
}

.role-user {
    background-color: #333;
    color: #bbb;
}

.post-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.post-top {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted, #a1a1aa);
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.post-body {
    font-size: 15px;
    line-height: 1.6;
    color: #ddd;
}

.reply-section {
    background-color: var(--bg-card, #222222);
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 30px;
}

.reply-section h3 {
    margin-bottom: 20px;
    color: #fff;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-muted, #a1a1aa);
}

.reply-form input,
.reply-form textarea {
    width: 100%;
    background-color: #1e1e1e;
    border: 1px solid #333;
    color: #fff;
    padding: 12px 15px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border 0.3s;
}

.reply-form input:focus,
.reply-form textarea:focus {
    border-color: var(--primary, #ff6b57);
}

@media (max-width: 768px) {
    .forum-post {
        flex-direction: column;
    }
    
    .post-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #2a2a2a;
        flex-direction: row;
        justify-content: flex-start;
        gap: 15px;
        padding: 15px;
    }

    .avatar {
        width: 50px;
        height: 50px;
        font-size: 24px;
        margin-bottom: 0;
    }

    .post-role {
        width: auto;
    }
}

/* --- Выпадающее меню --- */
.dropdown { position: relative; display: inline-block; }
.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--bg-card);
    min-width: 200px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 5px;
    top: 100%;
}
.dropdown-content a { color: #fff; padding: 12px 16px; display: block; text-decoration: none; font-size: 14px; }
.dropdown-content a:hover { background: #333; color: var(--primary); }
.dropdown:hover .dropdown-content { display: block; }

/* --- Категории форума --- */
.category-block { margin-bottom: 30px; }
.category-header {
    background: var(--bg-secondary);
    padding: 12px 20px;
    border-left: 4px solid var(--primary);
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    margin-bottom: 10px;
}

.forum-item {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    padding: 15px 20px;
    border-bottom: 1px solid #2a2a2a;
    transition: 0.2s;
}

/* Стили для подразделов (маленький шрифт) */
.sub-forums {
    margin-top: 5px;
    font-size: 0.85rem; /* Маленький размер */
    color: var(--text-muted);
}

.sub-forums span {
    margin-right: 5px;
}

.sub-forums a {
    color: var(--primary);
    text-decoration: none;
    margin-right: 5px;
}

.sub-forums a:hover {
    text-decoration: underline;
}

/* Стили для кнопки создания */
.action-bar .btn {
    font-size: 14px;
}

/* --- Стили для ссылок на форумы --- */
.forum-details h4 a {
    color: #fff;
    text-decoration: none;
    transition: 0.2s;
}
.forum-details h4 a:hover {
    color: var(--primary);
}

/* --- Подразделы (маленький шрифт) --- */
.sub-forums {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px; /* Расстояние между подразделами */
}

.sub-forums a {
    font-size: 13px; /* Тот самый маленький шрифт */
    color: #ccc;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.sub-forums a i {
    font-size: 12px;
}

.sub-forums a:hover {
    color: var(--primary);
}

/* --- Категории форума --- */
.category-block { margin-bottom: 30px; }

.category-header {
    background: linear-gradient(90deg, var(--primary, #ff6b57) 0%, #cc2b14 100%);
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.forum-item {
    display: flex;
    align-items: center;
    background: var(--bg-card, #222222);
    padding: 20px;
    border-left: 1px solid #2a2a2a;
    border-right: 1px solid #2a2a2a;
    border-bottom: 1px solid #2a2a2a;
    transition: background-color 0.2s;
}

.forum-item:last-child {
    border-radius: 0 0 8px 8px;
}

.forum-item:hover { background: #2a2a2a; }

.forum-icon { 
    font-size: 28px; 
    color: var(--primary, #ff6b57); 
    margin-right: 20px; 
    width: 40px;
    text-align: center;
}

.forum-details { flex: 1; }
.forum-details h4 { margin: 0; font-size: 16px; }
.forum-details h4 a { color: #fff; text-decoration: none; transition: color 0.2s; }
.forum-details h4 a:hover { color: var(--primary, #ff6b57); }
.forum-details p { margin: 6px 0 0; color: var(--text-muted, #a1a1aa); font-size: 13px; }

/* --- Подразделы (маленький шрифт) --- */
.sub-forums {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.sub-forums a {
    font-size: 12px;
    color: #bbb;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.sub-forums a:hover { color: var(--primary, #ff6b57); }
.sub-forums a i { font-size: 11px; }

.forum-item:hover { background: #2a2a2a; }
.forum-icon { font-size: 24px; color: var(--primary); margin-right: 20px; }
.forum-details h4 { margin: 0; font-size: 16px; }
.forum-details p { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }

/* Стили для списка тем */
.topic-list { display: flex; flex-direction: column; gap: 10px; }
.topic-item { background-color: var(--bg-card); padding: 15px 20px; border-radius: 8px; border: 1px solid #2a2a2a; display: flex; justify-content: space-between; align-items: center; transition: 0.3s; cursor: pointer; }
.topic-item:hover { border-color: var(--primary); transform: translateX(5px); }
.topic-info h3 { font-size: 18px; color: #fff; margin-bottom: 5px; display: flex; align-items: center; gap: 10px;}
.topic-meta { font-size: 13px; color: var(--text-muted); display: flex; gap: 15px; }
.topic-stats { font-size: 13px; color: var(--text-muted); text-align: right; }

/* --- Двухблочная разметка форума --- */
.forum-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.forum-sections-wrapper {
    flex: 1; /* Основной контент занимает всё свободное место */
}

.forum-sidebar {
    width: 320px; /* Фиксированная ширина сайдбара как на скрине */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- Виджеты сайдбара --- */
.sidebar-widget {
    background: var(--bg-card, #222222);
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
}

.widget-header {
    background: #1a1a1a;
    padding: 12px 15px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid #2a2a2a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.widget-content {
    padding: 15px;
}

/* Статистика "Кто онлайн" */
.online-users-list {
    font-size: 13px;
    color: #ddd;
    line-height: 1.6;
}

.online-users-counter {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted, #a1a1aa);
    border-top: 1px solid #2a2a2a;
    padding-top: 8px;
}

/* Виджет "Новые сообщения" */
.sidebar-post-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #2a2a2a;
}

.sidebar-post-item:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.sidebar-post-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #274f7d;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.sidebar-post-avatar.admin-style {
    background: #cc2b14;
}

.sidebar-post-details {
    flex: 1;
    min-width: 0;
}

.sidebar-post-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-post-title a {
    color: var(--primary, #ff6b57);
    text-decoration: none;
}

.sidebar-post-title a:hover {
    text-decoration: underline;
}

.sidebar-post-meta {
    font-size: 11px;
    color: var(--text-muted, #a1a1aa);
}

.sidebar-post-meta span {
    color: #eee;
}

/* --- Стили для колонок статистики (Темы / Сообщения) --- */
.forum-stats-box {
    display: flex;
    gap: 25px;
    align-items: center;
    margin-left: auto;
}

.stat-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 65px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted, #a1a1aa);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 16px;
    color: #fff;
    font-weight: 600;
}

/* --- Дополнения для инлайн-стилей --- */

/* Шапка поиска */
.header-search-box {
    margin-right: 20px;
    position: relative;
}

.header-search-input {
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #2a2a2a;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 14px;
    width: 220px;
    outline: none;
}

.header-search-btn {
    position: absolute;
    right: 10px;
    top: 11px;
    color: #555;
    cursor: pointer;
}

/* Бейджи */
.badge-red {
    background-color: #cc0000;
    color: #fff;
}

/* Специфичные классы для страниц разделов и тем */
.action-bar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.action-bar-title {
    margin: 0;
    color: #fff;
    font-size: 24px;
}

.create-topic-box {
    margin-bottom: 30px;
    animation: fadeIn 0.3s ease;
}

.prefix-select {
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #2a2a2a;
    padding: 10px;
    border-radius: 6px;
    width: 160px;
    font-weight: bold;
    font-size: 14px;
}

.topic-title-input {
    flex: 1;
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #2a2a2a;
    padding: 10px;
    border-radius: 6px;
}

.sort-controls {
    text-align: right;
    margin-bottom: 15px;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.sort-select {
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #2a2a2a;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

.pinned-header {
    background: #2a2a2a;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    text-transform: none;
    color: #a1a1aa;
}

.pinned-list {
    border: 1px solid #2a2a2a;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 10px;
    background: var(--bg-card);
}

/* Страница поиска */
.search-results-title {
    color: #fff;
    font-size: 24px;
    margin-bottom: 20px;
}

.search-results-query {
    color: var(--primary);
}

.search-results-box {
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 10px;
    background: var(--bg-card);
}

.search-results-loading {
    color: var(--text-muted);
    padding: 20px;
}

/* Добавить в конец файла /Forum/forum.css */
@media (max-width: 768px) {
    .forum-layout { flex-direction: column; }
    .forum-sidebar { width: 100%; }
    
    .forum-item { flex-direction: column; align-items: flex-start; text-align: center; gap: 15px; }
    .forum-icon { margin: 0 auto; width: 100%; }
    .forum-stats-box { margin: 0 auto; width: 100%; justify-content: center; border-top: 1px solid #2a2a2a; padding-top: 15px; }
    .sub-forums { justify-content: center; }
    
    .header-search-box { width: 100%; margin: 10px 0 0 0; }
    .header-search-input { width: 100%; box-sizing: border-box; }
    
    .action-bar-container { flex-direction: column; align-items: stretch; gap: 15px; }
    .action-bar-container .btn { width: 100%; justify-content: center; }
    
    .create-topic-box .form-group > div { flex-direction: column; }
    .prefix-select { width: 100%; }
    
    .sort-controls { justify-content: center; flex-wrap: wrap; margin-top: 15px; }
    
    .topic-item { flex-direction: column; align-items: flex-start; gap: 15px; text-align: center; }
    .topic-info h3 { flex-direction: column; }
    .topic-stats { text-align: center; justify-content: center; padding-right: 0; width: 100%; border-top: 1px solid #2a2a2a; padding-top: 15px; margin-top: 5px; }
    
    .thread-header { flex-direction: column; align-items: flex-start; text-align: center; width: 100%; }
    .thread-meta { flex-direction: column; gap: 5px; align-items: center; width: 100%; }
    
    .post-sidebar { flex-direction: column; text-align: center; justify-content: center; border-right: none; border-bottom: 1px solid #2a2a2a; }
    .post-top { flex-direction: column; gap: 10px; align-items: flex-start; }
    .post-content > div { flex-direction: column; }
    .post-rating-arrows { flex-direction: row; width: 100%; padding: 10px; gap: 20px; }
}