/**
 * Forum Plugin - Public Styles
 * Uses theme variables for a consistent look & feel.
 */

/* Breadcrumb Styling & Visibility */
.forum-breadcrumb {
    margin-bottom: 2rem;
    padding: 0.75rem 1rem;
    background: var(--section-head-bg-color, #f8f9fa);
    border: 1px solid var(--form-border-color, #dee2e6);
    border-radius: 6px;
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: var(--font-secondary);
    font-size: 0.75rem;
    opacity: 0.5;
}

/* Traditional Forum Table Layout */
.forum-category-row {
    margin-bottom: 2.5rem;
    background: var(--section-bg-color, #fff);
    border: 1px solid var(--form-border-color, #dee2e6);
    border-radius: var(--section-radius, 8px);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.forum-category-header {
    background: var(--section-head-bg-color, #f8f9fa);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--form-border-color, #dee2e6);
}

.forum-category-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--font-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.forum-category-header h2 a {
    color: inherit;
    text-decoration: none;
}

.forum-table {
    width: 100%;
    border-collapse: collapse;
}

.forum-table th {
    text-align: left;
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.02);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--font-secondary);
    border-bottom: 1px solid var(--form-border-color, #eee);
}

.forum-row {
    border-bottom: 1px solid var(--form-border-color, #eee);
    transition: background 0.2s;
}

.forum-row:last-child {
    border-bottom: none;
}

.forum-row:hover {
    background: rgba(var(--primary-color-rgb, 102, 126, 234), 0.03);
}

.forum-col-icon {
    width: 60px;
    padding: 1.25rem 0 1.25rem 1.5rem;
    vertical-align: top;
}

.forum-icon-circle {
    width: 40px;
    height: 40px;
    background: rgba(var(--primary-color-rgb, 102, 126, 234), 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.forum-col-main {
    padding: 1.25rem 1.5rem;
}

.forum-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.forum-title a {
    color: var(--font-color);
    text-decoration: none;
}

.forum-title a:hover {
    color: var(--primary-color);
}

.forum-desc {
    font-size: 0.9rem;
    color: var(--font-secondary);
    margin: 0;
}

.forum-col-stats {
    width: 120px;
    padding: 1.25rem 1rem;
    text-align: center;
    font-size: 0.9rem;
}

.forum-stats-val {
    font-weight: 700;
    display: block;
    color: var(--font-color);
}

.forum-stats-lbl {
    font-size: 0.75rem;
    color: var(--font-secondary);
    text-transform: uppercase;
}

.forum-col-last {
    width: 250px;
    padding: 1.25rem 1.5rem;
    font-size: 0.85rem;
    color: var(--font-secondary);
}

.forum-last-title {
    display: block;
    font-weight: 600;
    color: var(--font-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    margin-bottom: 0.2rem;
}

.forum-last-meta {
    display: block;
    font-size: 0.8rem;
}

/* Discussion Rooms Grid (Alternative modern view for Level 3) */
.forum-rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.discussion-room-card {
    background: var(--section-bg-color, #fff);
    border: 1px solid var(--form-border-color, #dee2e6);
    border-radius: var(--section-radius, 8px);
    padding: 1.5rem;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.discussion-room-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Responsive Table */
@media (max-width: 768px) {

    .forum-col-stats,
    .forum-col-last {
        display: none;
    }

    .forum-col-main {
        padding-right: 1.5rem;
    }
}

/* Additional Styles for Topic & Posts */
.forum-topic-list-container {
    background: var(--section-bg-color, #fff);
    border: 1px solid var(--form-border-color, #dee2e6);
    border-radius: var(--section-radius, 8px);
    overflow: hidden;
}

.forum-topics-table {
    width: 100%;
    border-collapse: collapse;
}

.forum-topics-table th {
    background: var(--section-head-bg-color, #f8f9fa);
    padding: 1rem;
    text-align: left;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--form-border-color);
}

.forum-topics-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--form-border-color, #eee);
}

.avatar-xs,
.avatar-xs-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-xs-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Badges */
.forum-badge-pinned,
.forum-badge-locked,
.forum-badge-verified {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.forum-badge-pinned {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
}

.forum-badge-locked {
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
}

.forum-badge-verified {
    background: rgba(40, 167, 69, 0.1);
    color: #155724;
}

/* Post Styling */
.forum-post {
    background: var(--section-bg-color, #fff);
    border: 1px solid var(--form-border-color, #dee2e6);
    border-radius: var(--section-radius, 8px);
    margin-bottom: 1.5rem;
    overflow: hidden;
    padding: 0;
    /* Ensure header touches edges */
}

.forum-post__header {
    background: var(--section-head-bg-color, #f8f9fa);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* Changed to flex-start from duplicate */
    border-bottom: 1px solid var(--form-border-color, #eee);
    gap: 1rem;
    /* Added from duplicate */
}

.forum-author-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.forum-avatar img,
.forum-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--form-border-color, #eee);
}

.forum-post__content {
    padding: 1.5rem;
    line-height: 1.6;
}

.author-meta-detail {
    font-size: 0.75rem;
    color: var(--font-secondary);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.author-meta-detail i {
    width: 14px;
    text-align: center;
    opacity: 0.7;
}

.forum-post-actions {
    display: flex;
    gap: 0.75rem;
}

/* Reply Section */
.forum-reply-section {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--section-head-bg-color, #f8f9fa);
    border-radius: var(--section-radius, 8px);
    border: 1px solid var(--form-border-color);
}

/* Topic Header */
.forum-topic__header {
    background: var(--section-bg-color, #fff);
    border: 1px solid var(--form-border-color, #dee2e6);
    border-radius: var(--section-radius, 8px);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.forum-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.forum-stats-box {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--font-secondary);
}

.forum-moderation-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Post Header */

.forum-post-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    align-items: flex-start;
}

.forum-post-actions .inline-form {
    margin: 0;
}

/* Forum Badges */
.forum-badge-verified,
.forum-badge-group {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.forum-badge-verified {
    background: rgba(var(--success-color-rgb, 16, 185, 129), 0.1);
    color: var(--success-color, #10b981);
    border: 1px solid rgba(var(--success-color-rgb, 16, 185, 129), 0.2);
}

.forum-badge-group {
    background: rgba(var(--primary-color-rgb, 102, 126, 234), 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(var(--primary-color-rgb, 102, 126, 234), 0.2);
}

/* Unified Topic Card Styles */
.forum-topic-main-card {
    background: var(--section-bg-color, #fff);
    border: 1px solid var(--form-border-color, #dee2e6);
    border-radius: var(--section-radius, 8px);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* Légère ombre pour mise en avant */
}

.forum-topic-main-header {
    background: var(--section-head-bg-color, #f8f9fa);
    padding: 1.5rem;
    border-bottom: 1px solid var(--form-border-color, #eee);
}

.forum-topic__title {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: var(--font-color);
}

.forum-post__header--first {
    /* background: #fff; */
    /* Fond blanc supprimé pour unification */
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--form-border-color, #f0f0f0);
}

.forum-post__content--first {
    padding: 1.5rem;
    font-size: 1.05rem;
    /* Légèrement plus grand pour le post principal */
}