/* ============================================
   bbPress Forum Custom Styles
   Matching Góc Toán Chuyên LTV Theme
   ============================================ */

/* === Forum Layout === */
#bbpress-forums {
    font-family: 'Be Vietnam Pro', sans-serif;
}

#bbpress-forums .bbp-header,
#bbpress-forums .bbp-footer {
    background: #0D1F4D;
    color: white;
    border-radius: 8px;
    padding: 12px 16px;
}

#bbpress-forums .bbp-header a,
#bbpress-forums .bbp-footer a {
    color: rgba(255, 255, 255, 0.9);
}

/* === Forum List === */
#bbpress-forums li.bbp-body ul.forum,
#bbpress-forums li.bbp-body ul.topic {
    padding: 16px;
    border-bottom: 1px solid #E2E8F0;
    transition: background 0.2s ease;
}

#bbpress-forums li.bbp-body ul.forum:hover,
#bbpress-forums li.bbp-body ul.topic:hover {
    background: #F0F4FA;
}

/* === Forum/Topic Titles === */
#bbpress-forums .bbp-forum-title,
#bbpress-forums .bbp-topic-permalink {
    font-weight: 600;
    color: #1A3C8F;
    text-decoration: none;
    font-size: 1.05rem;
    transition: color 0.2s ease;
}

#bbpress-forums .bbp-forum-title:hover,
#bbpress-forums .bbp-topic-permalink:hover {
    color: #E31E24;
}

/* === Forum Description === */
#bbpress-forums .bbp-forum-content {
    color: #64748B;
    font-size: 0.9rem;
    margin-top: 4px;
}

/* === Topic Meta === */
#bbpress-forums .bbp-topic-meta {
    font-size: 0.8rem;
    color: #64748B;
    margin-top: 6px;
}

#bbpress-forums .bbp-topic-meta a {
    color: #1A3C8F;
    font-weight: 500;
}

/* === Reply/Post === */
#bbpress-forums div.bbp-reply-author {
    background: #F0F4FA;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

#bbpress-forums div.bbp-reply-author img.avatar {
    border-radius: 50%;
    border: 3px solid #1A3C8F;
    margin-bottom: 8px;
}

#bbpress-forums div.bbp-reply-author .bbp-author-name {
    font-weight: 600;
    color: #0D1F4D;
    display: block;
    margin-bottom: 4px;
}

#bbpress-forums div.bbp-reply-author .bbp-author-role {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748B;
    font-weight: 600;
}

/* === Reply Content === */
#bbpress-forums div.bbp-reply-content {
    padding: 20px;
    line-height: 1.8;
    border-bottom: 1px solid #E2E8F0;
}

#bbpress-forums div.bbp-reply-content p {
    margin-bottom: 1rem;
}

/* === Topic/Reply Forms === */
#bbpress-forums #new-topic,
#bbpress-forums #new-post,
#bbpress-forums .bbp-reply-form,
#bbpress-forums .bbp-topic-form {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

#bbpress-forums fieldset.bbp-form label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1A1A2E;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

#bbpress-forums fieldset.bbp-form input[type="text"],
#bbpress-forums fieldset.bbp-form select,
#bbpress-forums fieldset.bbp-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 0.95rem;
    color: #1A1A2E;
    background: #F0F4FA;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

#bbpress-forums fieldset.bbp-form input[type="text"]:focus,
#bbpress-forums fieldset.bbp-form select:focus,
#bbpress-forums fieldset.bbp-form textarea:focus {
    border-color: #1A3C8F;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(26, 60, 143, 0.1);
}

#bbpress-forums fieldset.bbp-form textarea {
    min-height: 180px;
    resize: vertical;
    line-height: 1.7;
}

/* === Submit Button === */
#bbpress-forums button.button.submit,
#bbpress-forums input.button.submit,
#bbpress-forums #bbp_reply_submit,
#bbpress-forums #bbp_topic_submit {
    display: inline-block;
    padding: 14px 36px;
    background: #1A3C8F;
    color: white;
    border: none;
    border-radius: 30px;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

#bbpress-forums button.button.submit:hover,
#bbpress-forums input.button.submit:hover,
#bbpress-forums #bbp_reply_submit:hover,
#bbpress-forums #bbp_topic_submit:hover {
    background: #0D1F4D;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(13, 31, 77, 0.25);
}

/* === Breadcrumbs === */
#bbpress-forums .bbp-breadcrumb {
    font-size: 0.85rem;
    color: #64748B;
    padding: 12px 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #E2E8F0;
}

#bbpress-forums .bbp-breadcrumb a {
    color: #1A3C8F;
    font-weight: 500;
}

#bbpress-forums .bbp-breadcrumb a:hover {
    color: #E31E24;
}

/* === Pagination === */
#bbpress-forums .bbp-pagination-links a,
#bbpress-forums .bbp-pagination-links span.current {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 3px;
    transition: all 0.2s ease;
}

#bbpress-forums .bbp-pagination-links a {
    color: #1A3C8F;
    background: #F0F4FA;
    text-decoration: none;
}

#bbpress-forums .bbp-pagination-links a:hover {
    background: #1A3C8F;
    color: white;
}

#bbpress-forums .bbp-pagination-links span.current {
    background: #1A3C8F;
    color: white;
}

/* === Topic Tags === */
#bbpress-forums .bbp-topic-tags a {
    display: inline-block;
    padding: 3px 10px;
    background: #F0F4FA;
    color: #1A3C8F;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 2px 3px;
    text-decoration: none;
    transition: all 0.2s ease;
}

#bbpress-forums .bbp-topic-tags a:hover {
    background: #1A3C8F;
    color: white;
}

/* === Freshness (time ago) === */
#bbpress-forums .bbp-topic-freshness .bbp-topic-freshness-author {
    color: #1A3C8F;
    font-weight: 500;
}

/* === Login Notice === */
#bbpress-forums .bbp-template-notice {
    background: #F0F4FA;
    border-left: 4px solid #1A3C8F;
    border-radius: 0 10px 10px 0;
    padding: 16px 20px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #0D1F4D;
}

#bbpress-forums .bbp-template-notice.important {
    border-left-color: #E31E24;
    background: #FFF5F5;
}

/* === Private Forum Notice === */
.bbp-forum-visibility-private::before {
    content: '🔒 ';
}

/* === Responsive === */
@media (max-width: 768px) {
    #bbpress-forums div.bbp-reply-author {
        padding: 10px;
    }

    #bbpress-forums .bbp-topic-form,
    #bbpress-forums .bbp-reply-form {
        padding: 1.25rem;
    }

    #bbpress-forums fieldset.bbp-form textarea {
        min-height: 120px;
    }
}

/* ============================================
   Math Preview Panel
   ============================================ */
.math-preview-wrapper {
    margin-top: 12px;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.math-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #F0F4FA;
    border-bottom: 1px solid #E2E8F0;
    flex-wrap: wrap;
    gap: 8px;
}

.math-preview-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #0D1F4D;
}

.math-preview-hint {
    font-size: 0.75rem;
    color: #64748B;
}

.math-preview-hint code {
    background: #E2E8F0;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.math-preview-content {
    padding: 16px 20px;
    min-height: 60px;
    line-height: 1.8;
    font-size: 0.95rem;
    color: #1A1A2E;
    overflow-x: auto;
}

.math-preview-placeholder {
    color: #94A3B8;
    font-style: italic;
    margin: 0;
}

/* === Math Insert Button === */
.math-insert-btn {
    background: #1A3C8F !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    margin-left: 4px !important;
}

.math-insert-btn:hover {
    background: #0D1F4D !important;
}

/* ============================================
   Image Upload
   ============================================ */
.forum-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    margin-bottom: 4px;
}

.forum-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #F0F4FA;
    border: 2px dashed #CBD5E1;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1A3C8F;
    cursor: pointer;
    transition: all 0.2s ease;
}

.forum-upload-btn:hover {
    background: #E2E8F0;
    border-color: #1A3C8F;
}

.forum-upload-hint {
    font-size: 0.75rem;
    color: #94A3B8;
}

/* Drag over state */
#bbpress-forums fieldset.bbp-form textarea.drag-over {
    border-color: #1A3C8F;
    background: #EEF2FF;
    box-shadow: 0 0 0 4px rgba(26, 60, 143, 0.15);
}