:root {
    --forum-bg: #1E1E1E;
    --forum-border: #2f2f2f;
    --forum-accent: var(--accent-blue, #2f58a8);
    --forum-text-secondary: #aaa;
}

.forum-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--forum-border); }
.create-topic-btn { background-color: var(--forum-accent); color: #fff; padding: 10px 20px; text-decoration: none; border-radius: 8px; font-weight: bold; }

.topic-list-container { background-color: var(--forum-bg); border-radius: 8px; padding: 10px; }
.topic-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid var(--forum-border); }
.topic-item:last-child { border-bottom: none; }
.topic-title { color: #EAEAEA; text-decoration: none; font-size: 1.2rem; font-weight: 500; display: block; margin-bottom: 5px; }
.topic-title:hover { color: var(--forum-accent); }
.topic-author { color: var(--forum-text-secondary); font-size: 0.9rem; }
.topic-author i { margin-right: 5px; }
.topic-stats { display: flex; gap: 20px; color: var(--forum-text-secondary); }
.stat-item { display: flex; align-items: center; gap: 8px; }

.pagination { margin-top: 20px; text-align: center; }
.pagination a { color: #EAEAEA; text-decoration: none; padding: 8px 12px; margin: 0 4px; border-radius: 5px; background-color: var(--forum-border); }
.pagination a.active { background-color: var(--forum-accent); color: white; }

.form-container, .reply-form-container { background-color: var(--forum-bg); padding: 30px; border-radius: 8px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; }
.form-group input[type="text"], .form-group textarea { width: 100%; padding: 12px; background-color: #121212; border: 1px solid var(--forum-border); border-radius: 5px; color: #EAEAEA; font-size: 1rem; box-sizing: border-box; }
.form-group input[type="file"] { padding: 10px; }
.form-actions { display: flex; gap: 15px; }
.btn-submit { background-color: var(--forum-accent); color: #fff; border: none; padding: 12px 25px; border-radius: 8px; cursor: pointer; font-size: 1rem; font-weight: bold; transition: background 0.2s ease; }
.btn-submit:hover { background-color: #86b8ff; }
.btn-cancel { background-color: transparent; color: #EAEAEA; padding: 12px 25px; border-radius: 8px; text-decoration: none; border: 1px solid #444; }
.btn-cancel:hover { border-color: var(--forum-accent); color: #fff; }

.toggle-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; font-weight: 500; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { width: 44px; height: 24px; background-color: #555; border-radius: 12px; transition: background-color 0.2s; margin-right: 10px; }
.slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background-color: white; border-radius: 50%; transition: transform 0.2s; }
.toggle-switch input:checked + .slider { background-color: var(--forum-accent); }
.toggle-switch input:checked + .slider::before { transform: translateX(20px); }

.topic-view-header { border-bottom: 1px solid var(--forum-border); margin-bottom: 20px; }
.back-link { display: inline-block; color: var(--forum-text-secondary); text-decoration: none; margin-bottom: 15px; }

.post-item {
    background-color: var(--forum-bg);
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 20px;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--forum-border);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.post-author-info { display: flex; align-items: center; gap: 15px; }
.author-avatar { width: 48px; height: 48px; border-radius: 50%; }
.author-details { display: flex; flex-direction: column; }
.author-name { font-weight: bold; color: #EAEAEA; }
.post-date { font-size: 0.8rem; color: var(--forum-text-secondary); }

.post-content { line-height: 1.7; word-wrap: break-word; }
.post-content p { margin-top: 0; }
.post-content img { max-width: 100%; border-radius: 8px; margin-top: 15px; }

.replies-section, .reply-form-container { margin-top: 30px; }

.post-actions { position: relative; }
.ellipsis-btn { background: none; border: none; color: var(--forum-text-secondary); font-size: 1.2rem; cursor: pointer; padding: 5px 10px; border-radius: 5px; }
.ellipsis-btn:hover { background-color: var(--forum-border); }
.actions-menu { display: none; position: absolute; right: 0; top: 100%; background-color: #2f2f2f; border: 1px solid #444; border-radius: 5px; list-style: none; padding: 5px 0; margin: 0; z-index: 10; min-width: 150px; }
.actions-menu button, .actions-menu a { background: none; border: none; color: #EAEAEA; padding: 8px 15px; display: block; width: 100%; text-align: left; cursor: pointer; font-size: 0.9rem; text-decoration: none; }
.actions-menu button:hover, .actions-menu a:hover { background-color: var(--forum-accent); color: #050505; }
.actions-menu .delete-action { color: #ff4d4d; }

@media (max-width: 768px) {
    .forum-header { flex-direction: column; align-items: stretch; gap: 12px; }
    .create-topic-btn { text-align: center; }
    .topic-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .topic-stats { gap: 12px; }
    .form-container, .reply-form-container { padding: 18px; }
    .form-actions { flex-direction: column; align-items: stretch; }
    .btn-submit, .btn-cancel { width: 100%; text-align: center; }
}

.reply-actions-bar { display: flex; gap: 15px; align-items: center; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--forum-border); }
.like-reply-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #e2e2e2;
    transition: transform 0.2s ease, color 0.2s ease;
}
.like-reply-btn:hover { transform: translateY(-1px); }
.like-reply-btn.liked { color: #FF424D; }
.reply-heart-icon { display: inline-flex; }
.reply-like-count { font-size: 0.9rem; color: inherit; }
.reply-to-reply-btn,
.edit-reply-btn {
    background: none;
    border: 1px solid var(--forum-border);
    color: var(--forum-text-secondary);
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 5px 12px;
}
.reply-to-reply-btn:hover,
.edit-reply-btn:hover { background: var(--forum-border); }
.edit-reply-form { margin-top: 15px; padding: 15px; background: #2a2a2a; border-radius: 5px; }
.show-more-replies-btn { margin-top: 10px; padding: 8px 14px; background: none; border: 1px solid var(--forum-border); color: var(--forum-text-secondary); border-radius: 5px; cursor: pointer; font-size: 0.85rem; }
.show-more-replies-btn:hover { background: var(--forum-border); }
.reply-to-reply-form { margin-top: 15px; padding: 15px; background: #2a2a2a; border-radius: 5px; }
.replies-to-reply-container { margin-top: 15px; margin-left: 20px; padding-left: 20px; border-left: 2px solid var(--forum-border); }
.reply-to-reply-item { background-color: #2a2a2a; border-radius: 8px; margin-bottom: 10px; padding: 15px; }
.reply-to-reply-item .post-header { padding-bottom: 10px; margin-bottom: 10px; }
.reply-to-reply-item .author-avatar { width: 36px; height: 36px; }
.reply-to-reply-item .author-name { font-size: 0.9rem; }
.reply-to-reply-item .post-date { font-size: 0.75rem; }
.reply-to-reply-item .post-content { font-size: 0.9rem; }
.reply-to-reply-item .reply-actions-bar { margin-top: 10px; padding-top: 10px; }
.reply-to-reply-item .reply-heart-icon { font-size: 1rem; }
.reply-to-reply-item .reply-like-count { font-size: 0.8rem; }
.reply-to-reply-item .reply-to-reply-btn { font-size: 0.75rem; padding: 3px 8px; }
@keyframes like-burst { 0% { transform: scale(1); } 50% { transform: scale(1.4); } 100% { transform: scale(1); } }
.reply-heart-icon.burst { animation: like-burst 0.4s ease-in-out; }

@media (max-width: 420px) {
    .topic-title { font-size: 1.05rem; }
    .author-avatar { width: 40px; height: 40px; }
    .post-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}

