/* ===== РАЗМЕТКА ФОРУМА ===== */
.forum-stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    margin-bottom: 20px;
    background: rgba(15, 15, 20, 0.5);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-dim);
}

.forum-stats-bar strong {
    color: var(--accent-green);
    font-family: monospace;
}

.forum-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 25px;
    padding: 30px;
}

/* ===== БОКОВАЯ ПАНЕЛЬ ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.sidebar-section {
    background: linear-gradient(160deg, #24283b, #1f2335);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.sidebar-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-purple), transparent);
    opacity: 0.6;
}

.sidebar-title {
    font-family: 'Courier New', monospace;
    color: var(--accent-cyan);
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--panel-border);
    letter-spacing: 1px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(15, 15, 20, 0.4);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.sidebar-link:hover {
    background: rgba(122, 162, 247, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    transform: translateX(3px);
}

.sidebar-link.active {
    background: rgba(122, 162, 247, 0.15);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(122, 162, 247, 0.2);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--panel-border);
    font-size: 12px;
}

.stat-item:last-child { border-bottom: none; }

.stat-label { color: var(--text-dim); }
.stat-value { color: var(--accent-green); font-family: monospace; font-weight: bold; }
.stat-value-small { color: var(--accent-purple); font-size: 11px; text-align: right; max-width: 140px; word-break: break-word; }

.user-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(115, 218, 202, 0.1);
    border: 1px solid var(--accent-green);
    border-radius: 8px;
    margin-bottom: 15px;
}

.user-avatar-sidebar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f0f14;
    font-weight: bold;
    font-size: 18px;
}

.user-name-sidebar {
    color: var(--accent-green);
    font-family: monospace;
    font-size: 14px;
    font-weight: bold;
}

.sidebar-btn {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid var(--panel-border);
    background: linear-gradient(180deg, #414868, #292e42);
    color: var(--text-main);
    margin-bottom: 8px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 3px 0 #16161e, 0 4px 6px rgba(0,0,0,0.3);
}

.sidebar-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 0 #16161e, 0 6px 8px rgba(0,0,0,0.4);
}

.sidebar-btn:active {
    transform: translateY(3px);
    box-shadow: 0 0 0 #16161e, inset 0 2px 4px rgba(0,0,0,0.5);
}

.sidebar-btn.primary {
    background: linear-gradient(180deg, var(--accent-cyan), #5a82d4);
    color: #0f0f14;
    border-color: #3b5998;
    box-shadow: 0 3px 0 #3b5998, 0 4px 6px rgba(0,0,0,0.3);
}

.sidebar-btn.primary:hover {
    box-shadow: 0 4px 0 #3b5998, 0 6px 10px rgba(122, 162, 247, 0.4);
}

.sidebar-btn.danger {
    background: linear-gradient(180deg, var(--accent-pink), #d45a6e);
    color: #0f0f14;
    border-color: #a83a4e;
    box-shadow: 0 3px 0 #a83a4e, 0 4px 6px rgba(0,0,0,0.3);
}

.sidebar-text {
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 12px;
}

/* ===== ОСНОВНОЙ КОНТЕНТ ===== */
.main-content {
    min-width: 0;
}

.forum-header {
    background: linear-gradient(180deg, #3b405a 0%, #24283b 100%);
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    border: 1px solid #414868;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 6px 12px rgba(0, 0, 0, 0.4);
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.forum-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
}

.forum-title {
    font-family: 'Courier New', monospace;
    color: var(--accent-cyan);
    font-size: 24px;
    text-shadow: 0 0 15px rgba(122, 162, 247, 0.5);
    letter-spacing: 2px;
}

.forum-subtitle {
    color: var(--text-dim);
    font-size: 12px;
    margin-top: 8px;
    letter-spacing: 1px;
}

/* ===== СПИСОК ТЕМ ===== */
.topics-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.topic-card {
    background: linear-gradient(160deg, #24283b, #1f2335);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.topic-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--accent-purple);
}

.topic-card:hover {
    border-color: var(--accent-cyan);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(122, 162, 247, 0.2);
}

.topic-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 10px;
}

.topic-card-title {
    color: var(--accent-cyan);
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    flex: 1;
}

.topic-card-stats {
    display: flex;
    gap: 15px;
    font-size: 11px;
    color: var(--text-dim);
    font-family: monospace;
    white-space: nowrap;
}

.topic-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.topic-stat-value {
    color: var(--accent-green);
    font-weight: bold;
}

.topic-card-meta {
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.topic-author {
    color: var(--accent-purple);
}

.topic-last-reply {
    color: var(--text-dim);
    font-style: italic;
}

.topic-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.mini-btn {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid;
    background: transparent;
    transition: all 0.2s;
    text-transform: uppercase;
}

.mini-btn.delete {
    color: var(--accent-pink);
    border-color: var(--accent-pink);
}

.mini-btn.delete:hover {
    background: var(--accent-pink);
    color: #0f0f14;
}

/* ===== ПРОСМОТР ТЕМЫ ===== */
.topic-view {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, #6b7280, #4b5563);
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    border: 1px solid #374151;
    box-shadow: 0 4px 0 #1f2937, 0 6px 8px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: fit-content;
}

.back-btn:hover { transform: translateY(-2px); }
.back-btn:active { transform: translateY(4px); box-shadow: 0 0 0 #1f2937, inset 0 3px 6px rgba(0,0,0,0.6); }

.topic-header {
    background: linear-gradient(160deg, #24283b, #1f2335);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 20px;
}

.topic-header h2 {
    color: var(--accent-cyan);
    font-family: 'Courier New', monospace;
    font-size: 20px;
    margin-bottom: 8px;
}

.topic-meta {
    color: var(--text-dim);
    font-size: 12px;
    font-family: monospace;
}

.topic-meta span { color: var(--accent-purple); }

/* ===== ПОСТЫ ===== */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-card {
    background: linear-gradient(160deg, #24283b, #1f2335);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.post-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--accent-green);
}

.post-card.op::before {
    background: var(--accent-cyan);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--panel-border);
}

.post-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f0f14;
    font-weight: bold;
    font-size: 14px;
}

.post-author-name {
    color: var(--accent-purple);
    font-family: monospace;
    font-weight: bold;
    font-size: 13px;
}

.post-date {
    color: var(--text-dim);
    font-size: 11px;
    font-family: monospace;
}

.post-content {
    padding: 18px;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.post-footer {
    padding: 10px 18px;
    border-top: 1px solid var(--panel-border);
    display: flex;
    justify-content: flex-end;
}

/* ===== ФОРМА ОТВЕТА ===== */
.reply-form {
    background: linear-gradient(160deg, #24283b, #1f2335);
    border: 1px solid var(--accent-green);
    border-radius: 10px;
    padding: 20px;
    margin-top: 10px;
}

.reply-form .section-title {
    font-family: 'Courier New', monospace;
    color: var(--accent-green);
    font-size: 13px;
    margin-bottom: 12px;
}

.login-hint {
    background: rgba(247, 118, 142, 0.1);
    border: 1px solid var(--accent-pink);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    color: var(--accent-pink);
    font-size: 13px;
}

.login-hint a {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: bold;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-dim);
    font-family: monospace;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-dim);
    background: linear-gradient(160deg, #24283b, #1f2335);
    border: 1px dashed var(--panel-border);
    border-radius: 10px;
}

.post-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-purple);
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 900px) {
    .forum-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    .topic-card-header { flex-direction: column; }
    .topic-card-stats { justify-content: flex-start; }
}