/* === Форум TsepeshLand — общие стили === */

.forum-hero {
    padding: 6rem 1rem 2rem;
    text-align: center;
}
.forum-hero h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 0.5rem;
}
.forum-hero p {
    color: #a1a1aa;
    max-width: 40rem;
    margin: 0 auto;
}
@media (min-width: 768px) {
    .forum-hero h1 { font-size: 3rem; }
}

.forum-wrap {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1rem 4rem;
}

/* Категории */
.forum-cat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2rem;
}
@media (min-width: 768px) {
    .forum-cat-grid { grid-template-columns: 1fr 1fr; }
}

.forum-cat-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(26, 26, 32, 0.75);
    border: 1px solid rgba(249, 115, 22, 0.15);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    text-decoration: none;
    color: inherit;
}
.forum-cat-card:hover {
    border-color: rgba(249, 115, 22, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.12);
}
.forum-cat-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(249, 115, 22, 0.1);
    border-radius: 0.5rem;
}
.forum-cat-body { flex: 1; min-width: 0; }
.forum-cat-title {
    font-weight: 700;
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.forum-cat-desc {
    color: #a1a1aa;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}
.forum-cat-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #71717a;
}
.forum-cat-meta b { color: #f97316; font-weight: 600; }

/* Список тем */
.forum-thread-list { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }

.forum-thread-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: rgba(26, 26, 32, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    transition: all 0.15s ease;
    text-decoration: none;
    color: inherit;
}
.forum-thread-row:hover {
    border-color: rgba(249, 115, 22, 0.35);
    background: rgba(26, 26, 32, 0.85);
}
.forum-thread-row.is-pinned {
    border-color: rgba(249, 115, 22, 0.35);
    background: rgba(249, 115, 22, 0.05);
}
.forum-thread-row.is-hidden {
    opacity: 0.6;
    border-style: dashed;
}
.forum-thread-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #27272a;
}
.forum-thread-main { flex: 1; min-width: 0; }
.forum-thread-title {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.forum-thread-title .pin { color: #f97316; font-size: 0.85rem; }
.forum-thread-title .lock { color: #f87171; font-size: 0.85rem; }
.forum-thread-title .hidden-badge {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.forum-thread-sub {
    color: #71717a;
    font-size: 0.8rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.forum-thread-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.75rem;
    color: #71717a;
    flex-shrink: 0;
    text-align: right;
}
.forum-thread-stats b { color: #e4e4e7; font-weight: 600; }

/* Посты в теме */
.forum-posts { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }

.forum-post {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(26, 26, 32, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
}
.forum-post.is-hidden {
    opacity: 0.6;
    border-style: dashed;
    border-color: rgba(239, 68, 68, 0.3);
}
.forum-post-author {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #27272a;
}
.forum-post-body { flex: 1; min-width: 0; }
.forum-post-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.forum-post-name { color: #fff; font-weight: 600; }
.forum-post-role {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.forum-post-role.role-owner { background: rgba(234, 179, 8, 0.2); color: #facc15; }
.forum-post-role.role-admin { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.forum-post-role.role-helper { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.forum-post-role.role-user { background: rgba(113, 113, 122, 0.2); color: #a1a1aa; }
.forum-post-date { color: #71717a; font-size: 0.75rem; }
.forum-post-edited { color: #a16207; font-size: 0.7rem; font-style: italic; }
.forum-post-content {
    color: #d4d4d8;
    line-height: 1.6;
    font-size: 0.925rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.forum-post-content p { margin-bottom: 0.75rem; }
.forum-post-content p:last-child { margin-bottom: 0; }
.forum-post-content a { color: #f97316; text-decoration: underline; }
.forum-post-content code {
    background: rgba(0,0,0,0.4);
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.85em;
}
.forum-post-content pre {
    background: rgba(0,0,0,0.5);
    padding: 0.75rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 0.5rem 0;
}
.forum-post-content blockquote {
    border-left: 3px solid #f97316;
    padding-left: 0.75rem;
    color: #a1a1aa;
    margin: 0.5rem 0;
}
.forum-post-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
}
.forum-post-actions button {
    background: none;
    border: none;
    color: #71717a;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}
.forum-post-actions button:hover { color: #f97316; }
.forum-post-actions button.danger:hover { color: #f87171; }

/* Формы */
.forum-form-box {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: rgba(26, 26, 32, 0.75);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 0.75rem;
}
.forum-form-box h3 { color: #fff; font-weight: 700; margin-bottom: 0.75rem; }
.forum-input, .forum-textarea {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.5rem;
    padding: 0.625rem 0.75rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.925rem;
    transition: border-color 0.15s;
}
.forum-input:focus, .forum-textarea:focus {
    outline: none;
    border-color: #f97316;
}
.forum-textarea { resize: vertical; min-height: 7rem; line-height: 1.5; }
.forum-form-row { margin-bottom: 0.75rem; }
.forum-form-row:last-child { margin-bottom: 0; }

.forum-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}
.forum-btn.primary {
    background: linear-gradient(135deg, #f97316, #dc2626);
    color: #fff;
}
.forum-btn.primary:hover { filter: brightness(1.1); }
.forum-btn.ghost {
    background: rgba(255,255,255,0.05);
    color: #e4e4e7;
    border: 1px solid rgba(255,255,255,0.1);
}
.forum-btn.ghost:hover { background: rgba(255,255,255,0.1); }
.forum-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Модалка */
.forum-modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.forum-modal-bg.open { display: flex; }
.forum-modal {
    background: #1a1a20;
    border: 1px solid rgba(249,115,22,0.3);
    border-radius: 0.75rem;
    max-width: 40rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
}
.forum-modal h2 { color: #fff; font-weight: 700; margin-bottom: 1rem; }

/* Пагинация */
.forum-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}
.forum-pagination button {
    padding: 0.4rem 0.8rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.375rem;
    color: #e4e4e7;
    cursor: pointer;
    font-size: 0.8rem;
}
.forum-pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.forum-pagination span { color: #a1a1aa; font-size: 0.8rem; }

/* Заглушка/пусто/лоадер */
.forum-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #71717a;
    font-size: 0.925rem;
}
.forum-loading {
    text-align: center;
    padding: 2rem;
    color: #f97316;
}

/* Тулбар сортировки */
.forum-toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.forum-toolbar .sort-btn {
    padding: 0.35rem 0.75rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.375rem;
    color: #a1a1aa;
    cursor: pointer;
    font-size: 0.8rem;
}
.forum-toolbar .sort-btn.active {
    background: rgba(249,115,22,0.2);
    border-color: rgba(249,115,22,0.5);
    color: #f97316;
}
.forum-toolbar .spacer { flex: 1; }

/* Хэллоуин-режим — лёгкая адаптация */
body.halloween-mode .forum-cat-card,
body.halloween-mode .forum-thread-row,
body.halloween-mode .forum-post,
body.halloween-mode .forum-form-box {
    border-color: rgba(168, 85, 247, 0.25);
}
body.halloween-mode .forum-cat-icon {
    background: rgba(168, 85, 247, 0.15);
}
body.halloween-mode .forum-btn.primary {
    background: linear-gradient(135deg, #a855f7, #f97316);
}

/* Фикс: кнопки внутри .forum-post-actions не должны наследовать сброс стилей */
.forum-post-actions button.forum-btn {
    padding: 0.4rem 0.8rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.375rem;
    color: #e4e4e7;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: all 0.15s;
}
.forum-post-actions button.forum-btn.primary {
    background: linear-gradient(135deg, #f97316, #dc2626);
    color: #fff;
    border: none;
}
.forum-post-actions button.forum-btn.ghost {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
}
.forum-post-actions button.forum-btn:hover {
    filter: brightness(1.1);
}
