/* ============================================
   Forum Styles
   ============================================ */

/* ============================================
   Forum Page Header (full-width section)
   ============================================ */
.forum-header {
    padding: 4rem 0 2rem;
    text-align: center;
}

.forum-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: rgb(var(--color-text));
}

.forum-header p {
    font-size: 1.25rem;
    color: rgb(var(--color-text-secondary));
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.forum-header-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ============================================
   Forum Content Layout
   ============================================ */
.forum-content {
    padding: 6rem 0 4rem;
}

.forum-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* 2-Column Layout with User Panel */
.forum-layout-3col {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
}

.forum-main {
    min-width: 0;
}

/* ============================================
   Search Bar
   ============================================ */
.forum-search-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    width: 100%;
}

.forum-search-bar .forum-search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(var(--color-border), 0.15);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    background: rgb(var(--color-surface));
    color: rgb(var(--color-text));
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.forum-search-bar .forum-search-input:focus {
    border-color: rgb(var(--color-action));
    box-shadow: 0 0 0 2px rgba(var(--color-action), 0.15);
}

.forum-search-bar .forum-search-input::placeholder {
    color: rgb(var(--color-text-secondary));
}

.forum-search-bar .search-btn {
    padding: 0.75rem 1.5rem;
    background: rgb(var(--color-action));
    color: rgb(var(--color-surface));
    border: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: none;
}

.forum-search-bar .search-btn:hover {
    background: rgb(var(--color-primary-dark));
    transform: none;
}

/* ============================================
   User Panel (Left Sidebar)
   ============================================ */
.user-panel {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.user-panel-card {
    background: rgb(var(--color-surface));
    border: 1px solid rgba(var(--color-border), 0.15);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* User Profile Header */
.user-profile-header {
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    border-bottom: 1px solid rgba(var(--color-border), 0.12);
}

.user-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.user-avatar-wrapper .user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(var(--color-border), 0.15);
}

.edit-avatar-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 22px;
    height: 22px;
    background: rgb(var(--color-action));
    color: rgb(var(--color-surface));
    border: 2px solid rgb(var(--color-surface));
    border-radius: 50%;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: none;
}

.edit-avatar-btn:hover {
    background: rgb(var(--color-primary-dark));
    transform: none;
}

.user-profile-info {
    flex: 1;
    min-width: 0;
}

.user-profile-info .user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgb(var(--color-text));
    margin: 0 0 0.15rem;
}

.user-title-editable {
    font-size: 0.75rem;
    color: rgb(var(--color-text-secondary));
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.user-title-editable[contenteditable="true"] {
    background: rgb(var(--color-surface-elevated));
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    outline: none;
    border: 1px solid rgb(var(--color-action));
}

.edit-title-btn {
    background: transparent;
    border: none;
    color: rgb(var(--color-action));
    font-size: 0.7rem;
    padding: 0;
    cursor: pointer;
    font-weight: 600;
    box-shadow: none;
}

.edit-title-btn:hover {
    text-decoration: underline;
    transform: none;
    background: transparent;
}

/* Action Buttons */
.user-actions {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(var(--color-border), 0.12);
}

.btn-new-post,
.btn-new-article {
    display: block;
    text-align: center;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-new-post {
    background: rgb(var(--color-action));
    color: rgb(var(--color-surface));
}

.btn-new-post:hover {
    background: rgb(var(--color-primary-dark));
    color: rgb(var(--color-surface));
}

.btn-new-article {
    background: transparent;
    color: rgb(var(--color-action));
    border: 1px solid rgb(var(--color-action));
}

.btn-new-article:hover {
    background: rgba(var(--color-action), 0.1);
    color: rgb(var(--color-primary-dark));
}

/* User Stats Section */
.user-stats-section {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(var(--color-border), 0.12);
}

.user-stats-section h4,
.user-categories-section h4,
.user-badges-section h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(var(--color-text-secondary));
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0 0 0.5rem;
}

.user-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
}

.user-stat-row .stat-label {
    font-size: 0.8rem;
    color: rgb(var(--color-text));
}

.user-stat-row .stat-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgb(var(--color-text));
}

.user-stat-row .stat-value.pending {
    color: rgb(var(--color-warning));
}

.user-stat-row .stat-value.points {
    color: rgb(var(--color-action));
}

/* Posts by Category */
.user-categories-section {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(var(--color-border), 0.12);
}

.category-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.category-stat-row .cat-name {
    font-size: 0.75rem;
    color: rgb(var(--color-text-secondary));
}

.category-stat-row .cat-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(var(--color-text));
    background: rgb(var(--color-surface-elevated));
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-xl);
}

/* Badges Section */
.user-badges-section {
    padding: 0.75rem 1rem;
}

.badges-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.badges-display .badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    background: rgb(var(--color-surface-elevated));
    border: 1px solid rgba(var(--color-border), 0.15);
}

.badges-display .no-badges,
.user-categories-section .no-data {
    font-size: 0.75rem;
    color: rgb(var(--color-text-muted));
    font-style: italic;
}

/* ============================================
   Topic Placeholder
   ============================================ */
.topic-placeholder {
    padding: 3rem 2rem;
    text-align: center;
    color: rgb(var(--color-text-secondary));
    background: rgb(var(--color-surface));
    border: 1px solid rgba(var(--color-border), 0.15);
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
}

.topic-placeholder a {
    color: rgb(var(--color-action));
    text-decoration: none;
}

.topic-placeholder a:hover {
    text-decoration: underline;
}

/* ============================================
   Topic Feed (LinkedIn-style)
   ============================================ */
.topic-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ============================================
   Topic Card - LinkedIn/Facebook Style
   ============================================ */
.topic-card {
    background: rgb(var(--color-surface));
    border: 1px solid rgba(var(--color-border), 0.15);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1rem;
}

/* Header Row: Avatar + Meta Info */
.topic-card .card-header-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1rem 0.5rem;
}

.topic-card .card-avatar-lg {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.topic-card .card-meta {
    flex: 1;
    min-width: 0;
}

.topic-card .card-meta-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.topic-card .card-author {
    font-weight: 600;
    font-size: 0.95rem;
    color: rgb(var(--color-text));
}

.topic-card .card-stats {
    color: rgb(var(--color-text-muted));
    font-size: 0.8rem;
    margin-left: auto;
    flex-shrink: 0;
}

.topic-card .card-meta-bottom {
    margin-top: 0.15rem;
}

.topic-card .card-headline {
    color: rgb(var(--color-text-secondary));
    font-size: 0.8rem;
}

/* Status Badges */
.topic-card .card-badge {
    background: rgb(var(--color-warning));
    color: rgb(var(--color-surface));
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-xs);
    font-size: 0.65rem;
    font-weight: 600;
    flex-shrink: 0;
}

.topic-card .card-badge.pending {
    background: rgb(var(--color-warning));
}

.topic-card .card-badge.rejected {
    background: rgb(var(--color-error));
    opacity: 0.8;
}

.topic-card .card-badge.featured {
    background: rgb(var(--color-warning));
}

.topic-card .card-badge.draft {
    background: rgb(var(--color-info));
}

/* Author Menu (hamburger dropdown) */
.author-menu {
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
}

.author-menu-btn {
    background: transparent;
    border: none;
    padding: 0.25rem 0.5rem;
    font-size: 1.25rem;
    cursor: pointer;
    color: rgb(var(--color-text-secondary));
    border-radius: var(--radius-sm);
    transition: background 0.2s, color 0.2s;
    line-height: 1;
}

.author-menu-btn:hover {
    background: rgba(var(--color-text), 0.1);
    color: rgb(var(--color-text));
}

.author-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 140px;
    background: rgb(var(--color-surface));
    border: 1px solid rgba(var(--color-border), 0.2);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 100;
    display: none;
    overflow: hidden;
}

.author-menu-dropdown.show {
    display: block;
}

/* Comment menus open upward to avoid clipping */
.inline-reply .author-menu-dropdown,
.comment .author-menu-dropdown {
    top: auto;
    bottom: 100%;
    margin-bottom: 0.25rem;
}

.author-menu-dropdown .menu-item {
    display: block;
    width: 100%;
    padding: 0.6rem 0.9rem;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: rgb(var(--color-text));
    transition: background 0.15s;
}

.author-menu-dropdown .menu-item:hover {
    background: rgba(var(--color-action), 0.1);
}

.author-menu-dropdown .menu-item[data-action="delete"],
.author-menu-dropdown .menu-item[data-action="reject"] {
    color: rgb(var(--color-error));
}

.author-menu-dropdown .menu-item[data-action="delete"]:hover,
.author-menu-dropdown .menu-item[data-action="reject"]:hover {
    background: rgba(var(--color-error), 0.1);
}

.author-menu-dropdown .menu-item[data-action="approve"] {
    color: rgb(var(--color-success));
}

.author-menu-dropdown .menu-item[data-action="approve"]:hover {
    background: rgba(var(--color-success), 0.1);
}

.author-menu-dropdown .menu-item[data-action="hide"] {
    color: rgb(var(--color-warning));
}

.author-menu-dropdown .menu-item[data-action="hide"]:hover {
    background: rgba(var(--color-warning), 0.1);
}

/* Card Body Link (Title + Excerpt) */
.topic-card .card-body-link {
    display: block;
    text-decoration: none;
    padding: 0 1rem;
    color: inherit;
}

/* ============================================
   Unified Card Grid Layout - Avatar spans 2 rows
   (Applies to all topic cards: blog and forum)
   ============================================ */
.topic-card .card-content-grid {
    display: grid;
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto auto;
    gap: 0 0.75rem;
    padding: 1rem 1rem 0.5rem;
}

.topic-card .card-content-grid .card-avatar-lg {
    grid-row: 1 / 3;
    align-self: start;
}

.topic-card .card-meta-row {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-height: 24px;
}

.topic-card .card-title-row {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 0.25rem 0;
    text-decoration: none;
    color: inherit;
}

.topic-card .card-title-row:hover .card-title {
    color: rgb(var(--color-action));
}

.topic-card .card-title-row .card-title {
    margin: 0;
}

.topic-card .card-title-row .card-subtitle {
    margin: 0;
    color: rgb(var(--color-text-secondary));
    font-size: 0.9rem;
}

/* Excerpt box - transparent with border */
.topic-card .card-excerpt-box {
    grid-column: 1 / 3;
    grid-row: 3;
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid rgba(var(--color-border), 0.15);
    border-radius: var(--radius-md);
    background: transparent;
}

.topic-card .card-excerpt-box .card-body-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 0;
    margin: 0;
}

.topic-card .card-excerpt-box .card-excerpt {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgb(var(--color-text-secondary));
}

.topic-card .card-excerpt-box .card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.25rem;
    padding: 0;
    margin: 0;
    border: none;
}

/* Menu inside meta-row - follows card-stats (which has margin-left: auto) */
.topic-card .card-meta-row .author-menu {
    margin-left: 0;
    flex-shrink: 0;
}

/* Hide default card-actions (moved inside excerpt box) */
.topic-card > .card-actions {
    display: none;
}

/* Comments in cards - span full width */
.topic-card .card-content-grid .card-comments {
    grid-column: 1 / 3;
    grid-row: 4;
    width: 100%;
}

.topic-card .card-body-link:hover .card-title {
    color: rgb(var(--color-action));
}

.topic-card .card-title {
    margin: 0 0 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: rgb(var(--color-text));
    line-height: 1.3;
}

.topic-card .card-excerpt {
    margin: 0 0 0.75rem;
    color: rgb(var(--color-text-secondary));
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.topic-card .card-subtitle {
    margin: 0.25rem 0 0.75rem;
    color: rgb(var(--color-text-secondary));
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Card Actions (Like, Reply, Share) - compact style */
.card-actions {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem 0;
    margin-top: 0.5rem;
}

.card-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: rgb(var(--color-text-tertiary));
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.card-action-btn:hover {
    background: rgba(var(--color-action), 0.1);
    color: rgb(var(--color-action));
}

.card-action-btn .action-icon {
    font-size: 0.8rem;
}

/* Topic card actions - under the content */
.topic-card .card-actions {
    padding: 0.25rem 1rem 0.5rem;
    border-top: none;
}

/* ============================================
   Inline Comments in Card
   ============================================ */
.topic-card .card-comments {
    padding: 0 1rem 0.75rem;
    border-top: 1px solid rgba(var(--color-border), 0.1);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}

/* Legacy support */
.topic-card .card-replies {
    padding: 0 1rem 0.75rem;
    border-top: 1px solid rgba(var(--color-border), 0.1);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}

/* Comments show/hide toggle */
.comments-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: rgb(var(--color-action));
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.5rem 0;
    cursor: pointer;
    transition: color 0.2s;
}

.comments-toggle:hover {
    color: rgb(var(--color-action-dark, var(--color-action)));
    text-decoration: underline;
}

.comments-toggle .toggle-icon {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

/* Legacy inline-reply styles (keeping for backwards compat) */
.inline-reply {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(var(--color-text), 0.1);
}

.inline-reply.nested-reply {
    margin-left: 2.5rem;
    padding-left: 0.75rem;
    border-left: 2px solid rgba(var(--color-border), 0.15);
}

.inline-reply-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.inline-reply-content {
    flex: 1;
    min-width: 0;
    background: rgba(var(--color-overlay), 0.05);
    border-radius: var(--radius-lg);
    padding: 0.5rem 0.75rem;
}

.inline-reply-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

/* Actions push to right, menu follows */
.inline-reply-header .inline-reply-actions {
    margin-left: auto;
}

.inline-reply-header .author-menu {
    margin-left: 0;
}

.inline-reply-author {
    font-weight: 600;
    font-size: 0.8rem;
    color: rgb(var(--color-text));
    margin-right: 0.5rem;
}

.inline-reply-text {
    font-size: 0.85rem;
    color: rgb(var(--color-text-secondary));
}

.inline-reply-time {
    font-size: 0.7rem;
    color: rgb(var(--color-text-muted));
}

/* Inline reply action buttons */
.inline-reply-actions {
    display: flex;
    gap: 0.25rem;
}

.inline-reply-action {
    background: none;
    border: none;
    font-size: 0.7rem;
    color: rgb(var(--color-text-tertiary));
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    border-radius: var(--radius-xs);
    transition: background 0.2s, color 0.2s;
}

.inline-reply-action:hover {
    background: rgba(var(--color-action), 0.1);
    color: rgb(var(--color-action));
}

.inline-reply-action.liked {
    color: rgb(var(--color-action));
}

.inline-reply-btn {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: rgb(var(--color-text-secondary));
    cursor: pointer;
    padding: 0;
    font-weight: 500;
}

.inline-reply-btn:hover {
    color: rgb(var(--color-action));
    text-decoration: underline;
}

/* Nested Reply Form (inline) */
.nested-reply-form {
    margin-top: 0.5rem;
    margin-left: 2rem;
    padding: 0.5rem;
    background: rgba(var(--color-overlay), 0.05);
    border-radius: var(--radius-md);
}

.nested-reply-form textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid rgba(var(--color-border), 0.2);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.85rem;
    resize: vertical;
    background: rgb(var(--color-surface));
    color: rgb(var(--color-text));
}

.nested-reply-form textarea:focus {
    outline: none;
    border-color: rgb(var(--color-action));
}

.nested-reply-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-cancel-nested,
.btn-submit-nested {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    cursor: pointer;
    border: none;
}

.btn-cancel-nested {
    background: rgba(var(--color-border), 0.2);
    color: rgb(var(--color-text-secondary));
}

.btn-cancel-nested:hover {
    background: rgba(var(--color-border), 0.3);
}

.btn-submit-nested {
    background: rgb(var(--color-action));
    color: rgb(var(--color-text));
}

.btn-submit-nested:hover {
    background: rgb(var(--color-primary-dark));
}

/* Legacy card-link support (for backwards compatibility) */
.topic-card .card-link {
    display: block;
    text-decoration: none;
    padding: 0.75rem 1rem;
    color: inherit;
    transition: background 0.2s;
}

.topic-card .card-link:hover {
    background: rgba(var(--color-overlay), 0.03);
}

/* Topic Header - Author Info */
.topic-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem 0;
    position: relative;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-info {
    flex: 1;
    min-width: 0;
}

.author-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.author-name {
    font-weight: 600;
    color: rgb(var(--color-text));
    text-decoration: none;
    font-size: 0.9rem;
}

.author-name:hover {
    color: rgb(var(--color-action));
    text-decoration: underline;
}

.author-badge {
    background: rgb(var(--color-action));
    color: rgb(var(--color-surface));
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-xs);
    font-size: 0.65rem;
    font-weight: 600;
}

.author-badge.pending {
    background: rgb(var(--color-warning));
}

.author-badge.rejected {
    background: rgb(var(--color-error));
    opacity: 0.8;
}

.post-time {
    color: rgb(var(--color-text-secondary));
    font-size: 0.75rem;
}

.author-title {
    color: rgb(var(--color-text-secondary));
    font-size: 0.75rem;
    margin: 0;
    line-height: 1.3;
}

.topic-header .topic-category {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: rgb(var(--color-surface-elevated));
    color: rgb(var(--color-action));
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-xl);
    font-size: 0.7rem;
    font-weight: 600;
}

/* Topic Body */
.topic-body {
    padding: 0.5rem 1rem 0.75rem;
}

.topic-body .topic-title {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.topic-body .topic-title a {
    color: rgb(var(--color-text));
    text-decoration: none;
}

.topic-body .topic-title a:hover {
    color: rgb(var(--color-action));
}

.topic-content {
    color: rgb(var(--color-text));
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

/* Topic Stats */
.topic-stats {
    padding: 0.4rem 1rem;
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: rgb(var(--color-text-secondary));
    border-bottom: 1px solid rgba(var(--color-border), 0.12);
}

/* Topic Actions */
.topic-actions {
    display: flex;
    padding: 0.25rem 1rem;
    border-bottom: 1px solid rgba(var(--color-border), 0.12);
}

.action-btn {
    flex: 1;
    background: transparent;
    border: 1px solid rgb(var(--color-action));
    color: rgb(var(--color-action));
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: var(--radius-full);
    margin: 0 0.25rem;
}

.action-btn:hover {
    background: rgba(var(--color-action), 0.1);
    color: rgb(var(--color-primary-dark));
}

/* Replies Section */
.replies-section {
    padding: 0.5rem 1rem 0.75rem;
    background: rgb(var(--color-surface));
}

.see-replies {
    display: block;
    color: rgb(var(--color-text-secondary));
    font-size: 0.8rem;
    text-decoration: none;
    padding: 0.25rem 0;
    margin-bottom: 0.25rem;
}

.see-replies:hover {
    color: rgb(var(--color-action));
}

/* Reply Item - Compact LinkedIn style */
.reply-item {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.reply-item + .reply-item {
    border-top: 1px solid rgba(var(--color-border), 0.12);
}

.reply-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.reply-content {
    flex: 1;
    min-width: 0;
}

.reply-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.reply-author {
    font-weight: 600;
    color: rgb(var(--color-text));
    text-decoration: none;
    font-size: 0.8rem;
}

.reply-author:hover {
    color: rgb(var(--color-action));
    text-decoration: underline;
}

.reply-time {
    color: rgb(var(--color-text-secondary));
    font-size: 0.7rem;
}

.reply-title {
    color: rgb(var(--color-text-secondary));
    font-size: 0.7rem;
    margin: 0 0 0.25rem;
    line-height: 1.2;
}

.reply-text {
    color: rgb(var(--color-text));
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0;
}

/* Reply Actions */
.reply-actions {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.action-btn-sm {
    background: transparent;
    border: 1px solid rgb(var(--color-action));
    color: rgb(var(--color-action));
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: var(--radius-2xl);
}

.action-btn-sm:hover {
    background: rgba(var(--color-action), 0.1);
    color: rgb(var(--color-primary-dark));
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background: rgb(var(--color-surface));
    border: 1px solid rgba(var(--color-border), var(--border-opacity));
    border-radius: var(--radius-md);
    color: rgb(var(--color-text-secondary));
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.pagination-ellipsis {
    padding: 0.5rem 0.25rem;
    color: rgb(var(--color-text-secondary));
}

.pagination-btn:hover {
    border-color: rgb(var(--color-primary));
    color: rgb(var(--color-text));
}

.pagination-btn.active {
    background: rgb(var(--color-primary));
    border-color: rgb(var(--color-primary));
    color: rgb(var(--color-background));
    font-weight: 600;
}

/* ============================================
   Forum Sidebar (Right) - Black & White Theme
   ============================================ */
.forum-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 80px;
    height: fit-content;
}

.forum-sidebar-card {
    background: rgb(var(--color-surface));
    border: 1px solid rgba(var(--color-border), 0.15);
    border-radius: var(--radius-lg);
    padding: 1rem;
}

.forum-sidebar-card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgb(var(--color-text));
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(var(--color-border), 0.12);
}

/* Category List */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 0.25rem;
}

.category-item:last-child {
    margin-bottom: 0;
}

.category-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.5rem;
    color: rgb(var(--color-text));
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.category-item a:hover {
    background: rgb(var(--color-surface-elevated));
    color: rgb(var(--color-text));
}

.category-count {
    background: rgb(var(--color-surface-elevated));
    color: rgb(var(--color-text-secondary));
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-xl);
    font-size: 0.7rem;
    font-weight: 600;
}

/* Forum Stats */
.forum-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.forum-stat {
    text-align: center;
    padding: 0.5rem;
    background: rgb(var(--color-surface));
    border-radius: var(--radius-md);
}

.forum-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: rgb(var(--color-text));
    line-height: 1.2;
}

.forum-stat-label {
    font-size: 0.65rem;
    color: rgb(var(--color-text-secondary));
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 0.15rem;
}

/* ============================================
   Responsive Forum Layout
   ============================================ */
@media (max-width: 1200px) {
    .forum-layout-3col {
        grid-template-columns: 240px 1fr 260px;
        gap: 1rem;
    }
}

@media (max-width: 992px) {
    .forum-layout {
        grid-template-columns: 1fr;
    }

    .forum-layout-3col {
        grid-template-columns: 1fr;
    }

    .user-panel {
        position: static;
        order: -1;
    }

    .user-panel-card {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .user-profile-header {
        flex: 1;
        min-width: 200px;
        border-bottom: none;
        border-right: 1px solid rgba(var(--color-border), 0.12);
    }

    .user-actions {
        flex: 0 0 auto;
        flex-direction: row;
        border-bottom: none;
        padding: 1rem;
        align-items: center;
    }

    .user-stats-section,
    .user-categories-section,
    .user-badges-section {
        display: none;
    }

    .forum-sidebar {
        order: -1;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .forum-sidebar-card {
        flex: 1;
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .forum-header h1 {
        font-size: 2rem;
    }

    .forum-header p {
        font-size: 1rem;
    }

    .author-avatar {
        width: 36px;
        height: 36px;
    }

    .topic-header .topic-category {
        position: static;
        margin-top: 0.5rem;
    }

    .topic-header {
        flex-wrap: wrap;
    }

    .reply-avatar {
        width: 28px;
        height: 28px;
    }

    .forum-sidebar-card {
        min-width: 100%;
    }
}

/* ============================================
   Compact Forum Styles (for embedded views)
   ============================================ */
.forum-section {
    padding: 5rem 0 2rem;
}

/* Compact Forum Header */
.forum-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.forum-header-compact h1 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--heading-color, rgb(var(--color-text)));
}

.forum-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.forum-search {
    width: 180px;
}

.forum-search-input {
    width: 100%;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color, rgba(var(--color-text), 0.1));
    border-radius: var(--radius-sm);
    background: var(--card-bg, rgba(var(--color-text), 0.05));
    color: var(--text-color, rgb(var(--color-text)));
    font-size: 0.8rem;
}

.forum-search-input:focus {
    outline: none;
    border-color: var(--primary-color, rgb(var(--color-info)));
}

.forum-search-input::placeholder {
    color: var(--text-muted, rgba(var(--color-text), 0.5));
}

/* Buttons */
.btn-primary {
    padding: 0.5rem 1rem;
    background: var(--primary-gradient, linear-gradient(135deg, rgb(var(--color-info)) 0%, rgb(var(--color-success)) 100%));
    border: none;
    border-radius: var(--radius-sm);
    color: rgb(var(--color-text));
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(var(--color-info), 0.3);
}

.btn-primary.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color, rgba(var(--color-text), 0.2));
    border-radius: var(--radius-sm);
    color: var(--text-color, rgb(var(--color-text)));
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color, rgb(var(--color-info)));
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.5rem 0;
}

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

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted, rgba(var(--color-text), 0.5));
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.btn-close:hover {
    color: var(--text-color, rgb(var(--color-text)));
}

/* Forum Tabs */
.forum-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color, rgba(var(--color-text), 0.1));
    margin-bottom: 0.75rem;
}

.forum-tab {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    color: var(--text-muted, rgba(var(--color-text), 0.6));
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.forum-tab:hover {
    color: var(--text-color, rgb(var(--color-text)));
}

.forum-tab.active {
    color: var(--primary-color, rgb(var(--color-info)));
    border-bottom-color: var(--primary-color, rgb(var(--color-info)));
}

.tab-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: rgba(var(--color-warning), 0.2);
    color: rgb(var(--color-warning));
    font-size: 0.7rem;
    border-radius: var(--radius-xl);
    margin-left: 0.25rem;
}

.tab-content {
    min-height: 200px;
}

/* Categories Grid - Compact */
.forum-categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.forum-category-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--card-bg, rgba(var(--color-text), 0.05));
    border: 1px solid var(--border-color, rgba(var(--color-text), 0.1));
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    min-width: 120px;
}

.forum-category-compact:hover {
    background: var(--card-hover-bg, rgba(var(--color-text), 0.08));
    border-color: var(--primary-color, rgb(var(--color-info)));
}

.forum-category-compact.selected {
    border-color: var(--primary-color, rgb(var(--color-info)));
    background: rgba(var(--color-info), 0.1);
}

.cat-icon {
    font-size: 1rem;
}

.cat-name {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-color, rgb(var(--color-text)));
}

.cat-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color, rgb(var(--color-info)));
    background: rgba(var(--color-overlay), 0.2);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-xs);
}

/* Topics List - Compact */
.topics-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.topic-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--card-bg, rgba(var(--color-text), 0.03));
    border: 1px solid var(--border-color, rgba(var(--color-text), 0.08));
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.topic-item:hover {
    background: var(--card-hover-bg, rgba(var(--color-text), 0.06));
    border-color: var(--primary-color, rgb(var(--color-info)));
}

.topic-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-gradient, linear-gradient(135deg, rgb(var(--color-info)) 0%, rgb(var(--color-success)) 100%));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: rgb(var(--color-text));
    flex-shrink: 0;
}

.topic-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.topic-content {
    flex: 1;
    min-width: 0;
}

.topic-title {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--heading-color, rgb(var(--color-text)));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topic-meta {
    font-size: 0.7rem;
    color: var(--text-muted, rgba(var(--color-text), 0.5));
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.topic-stats {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted, rgba(var(--color-text), 0.5));
    flex-shrink: 0;
}

/* Badges */
.topic-badge {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: var(--radius-xs);
    margin-right: 0.35rem;
}

.topic-badge.pinned {
    background: rgba(var(--color-warning), 0.2);
    color: rgb(var(--color-warning));
}

.topic-badge.locked {
    background: rgba(var(--color-text-muted), 0.2);
    color: rgb(var(--color-text-muted));
}

.topic-badge.pending {
    background: rgba(var(--color-warning), 0.2);
    color: rgb(var(--color-warning));
}

.topic-badge.approved {
    background: rgba(var(--color-success), 0.2);
    color: rgb(var(--color-success));
}

.topic-badge.rejected {
    background: rgba(var(--color-error), 0.2);
    color: rgb(var(--color-error));
}

.topic-category {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    font-size: 0.65rem;
    background: rgba(var(--color-info), 0.15);
    color: var(--primary-color, rgb(var(--color-info)));
    border-radius: var(--radius-xs);
}

/* Placeholders */
.topic-placeholder,
.topic-placeholder-compact {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted, rgba(var(--color-text), 0.5));
    font-size: 0.85rem;
}

.topic-placeholder-compact {
    padding: 1.5rem 1rem;
}

.topic-placeholder a {
    color: var(--primary-color, rgb(var(--color-info)));
}

/* My Posts Summary */
.my-posts-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    background: var(--card-bg, rgba(var(--color-text), 0.05));
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.status-pill.pending {
    border-left: 3px solid rgb(var(--color-warning));
}

.status-pill.approved {
    border-left: 3px solid rgb(var(--color-success));
}

.status-pill.rejected {
    border-left: 3px solid rgb(var(--color-error));
}

.status-pill .count {
    font-weight: 600;
    color: var(--text-color, rgb(var(--color-text)));
}

.status-pill .label {
    color: var(--text-muted, rgba(var(--color-text), 0.6));
}

/* My Post Item */
.my-post-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--card-bg, rgba(var(--color-text), 0.03));
    border: 1px solid var(--border-color, rgba(var(--color-text), 0.08));
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
}

.my-post-item .post-type {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted, rgba(var(--color-text), 0.5));
    width: 40px;
}

.my-post-item .post-title {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-color, rgb(var(--color-text)));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.my-post-item .post-date {
    font-size: 0.7rem;
    color: var(--text-muted, rgba(var(--color-text), 0.5));
}

.my-post-item .edit-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    background: rgba(var(--color-success), 0.15);
    border: 1px solid rgba(var(--color-success), 0.3);
    color: var(--primary-color, rgb(var(--color-success)));
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.my-post-item .edit-btn:hover {
    background: rgba(var(--color-success), 0.25);
    border-color: rgba(var(--color-success), 0.5);
}

/* Forum Message Toast */
#forum-message {
    position: fixed;
    top: 70px;
    right: 20px;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    z-index: 1000;
    max-width: 350px;
    font-size: 0.85rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   Topic View
   ============================================ */

.topic-view {
    margin-top: 0.5rem;
}

.topic-detail {
    background: var(--card-bg, rgba(var(--color-text), 0.05));
    border: 1px solid var(--border-color, rgba(var(--color-text), 0.1));
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 0.5rem;
}

.topic-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.topic-detail-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient, linear-gradient(135deg, rgb(var(--color-info)) 0%, rgb(var(--color-success)) 100%));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    color: rgb(var(--color-text));
    flex-shrink: 0;
}

.topic-detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.topic-detail-info {
    flex: 1;
    min-width: 0;
}

.topic-detail-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--heading-color, rgb(var(--color-text)));
}

.topic-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted, rgba(var(--color-text), 0.5));
}

.topic-detail-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-color, rgb(var(--color-text)));
    white-space: pre-wrap;
    word-wrap: break-word;
}

.topic-detail-stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, rgba(var(--color-text), 0.08));
    font-size: 0.75rem;
    color: var(--text-muted, rgba(var(--color-text), 0.5));
}

/* Responsive */
@media (max-width: 768px) {
    .forum-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .forum-actions {
        width: 100%;
    }

    .forum-search {
        flex: 1;
        width: auto;
    }

    .forum-categories-grid {
        flex-direction: column;
    }

    .forum-category-compact {
        min-width: 100%;
    }

    .topic-item {
        flex-wrap: wrap;
    }

    .topic-stats {
        width: 100%;
        margin-top: 0.25rem;
    }

    .my-posts-summary {
        flex-wrap: wrap;
    }
}

/* ============================================
   Topic Modal
   ============================================ */
.topic-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topic-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--color-overlay), 0.7);
}

.topic-modal-content {
    position: relative;
    background: rgb(var(--color-surface));
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(var(--color-overlay), 0.3);
}

.topic-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: rgb(var(--color-text-secondary));
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.topic-modal-close:hover {
    background: rgb(var(--color-surface-elevated));
    color: rgb(var(--color-text));
}

.topic-modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.topic-modal-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.topic-modal-meta {
    display: flex;
    flex-direction: column;
}

.topic-modal-author {
    font-weight: 600;
    color: rgb(var(--color-text));
    font-size: 0.95rem;
}

.topic-modal-time {
    color: rgb(var(--color-text-secondary));
    font-size: 0.8rem;
}

.topic-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: rgb(var(--color-text));
    margin: 0 0 1rem;
}

.topic-modal-body {
    color: rgb(var(--color-text));
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    white-space: pre-wrap;
}

.topic-modal-headline {
    display: block;
    color: rgb(var(--color-text-secondary));
    font-size: 0.8rem;
}

/* Topic Modal Actions (Like/Comment/Share) */
.topic-modal-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-top: 1px solid rgba(var(--color-border), 0.1);
    border-bottom: 1px solid rgba(var(--color-border), 0.1);
    margin-bottom: 1rem;
}

.modal-action-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
    border: none;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: rgb(var(--color-text-secondary));
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.modal-action-btn:hover {
    background: rgba(var(--color-action), 0.1);
    color: rgb(var(--color-action));
}

.modal-action-btn .action-icon {
    font-size: 1rem;
}

/* Topic Modal Comments Section */
.topic-modal-comments {
    border-top: 1px solid rgba(var(--color-border), 0.15);
    padding-top: 1rem;
    margin-bottom: 1rem;
}

.topic-modal-comments h3 {
    font-size: 0.95rem;
    color: rgb(var(--color-text));
    margin: 0 0 1rem;
}

.topic-comment {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgb(var(--color-surface-elevated));
}

.topic-comment:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.comment-author {
    font-weight: 600;
    color: rgb(var(--color-text));
    font-size: 0.85rem;
}

.comment-time {
    color: rgb(var(--color-text-secondary));
    font-size: 0.75rem;
}

.comment-text {
    margin: 0;
    color: rgb(var(--color-text));
    font-size: 0.9rem;
    line-height: 1.5;
}

.topic-modal-reply-form {
    border-top: 1px solid rgba(var(--color-border), 0.15);
    padding-top: 1rem;
}

.topic-modal-reply-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(var(--color-border), 0.15);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 0.75rem;
}

.topic-modal-reply-form textarea:focus {
    outline: none;
    border-color: rgb(var(--color-action));
}

.topic-modal-reply-form .btn-reply {
    padding: 0.6rem 1.5rem;
    background: rgb(var(--color-action));
    color: rgb(var(--color-text));
    border: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.topic-modal-reply-form .btn-reply:hover {
    background: rgb(var(--color-primary-dark));
}

/* Sentiment indicator in modal reply form */
.topic-modal-reply-form .sentiment-indicator {
    width: 60%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

.topic-modal-reply-form .sentiment-bar {
    flex: 1;
    height: 8px;
    background: rgba(var(--color-text), 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.topic-modal-reply-form .sentiment-fill {
    height: 100%;
    width: 0;
    border-radius: var(--radius-full);
    transition: width 0.3s ease, background 0.3s ease;
}

.topic-modal-reply-form .sentiment-fill.positive {
    background: rgb(var(--color-success));
}

.topic-modal-reply-form .sentiment-fill.neutral {
    background: rgb(var(--color-warning));
}

.topic-modal-reply-form .sentiment-fill.negative {
    background: rgb(var(--color-error));
}

.topic-modal-reply-form .sentiment-label {
    font-size: 0.75rem;
    color: rgb(var(--color-text-muted));
    min-width: 50px;
}

/* New topic modal form */
.topic-modal .new-topic-form {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
}

.topic-modal .new-topic-form .form-group {
    margin-bottom: 1rem;
}

.topic-modal .new-topic-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgb(var(--color-text-secondary));
}

.topic-modal .new-topic-form .form-control {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: rgba(var(--color-overlay), 0.3);
    border: 1px solid rgba(var(--color-border), 0.3);
    border-radius: var(--radius-sm);
    color: rgb(var(--color-text));
    font-size: 0.9rem;
    font-family: inherit;
}

.topic-modal .new-topic-form .form-control:focus {
    outline: none;
    border-color: rgb(var(--color-info));
}

.topic-modal .new-topic-form select.form-control {
    background-color: rgb(var(--color-surface-hover));
    color: rgb(var(--color-text));
}

.topic-modal .new-topic-form select.form-control option {
    background-color: rgb(var(--color-surface-hover));
    color: rgb(var(--color-text));
}

.topic-modal .new-topic-form textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.topic-modal .new-topic-form .form-help {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.topic-modal .new-topic-form .sentiment-indicator {
    width: 80%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topic-modal .new-topic-form .sentiment-bar {
    flex: 1;
    height: 8px;
    background: rgba(var(--color-text), 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.topic-modal .new-topic-form .sentiment-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.3s ease, background 0.3s ease;
    width: 0;
}

.topic-modal .new-topic-form .sentiment-fill.positive {
    background: rgb(var(--color-success));
}

.topic-modal .new-topic-form .sentiment-fill.neutral {
    background: rgb(var(--color-warning));
}

.topic-modal .new-topic-form .sentiment-fill.negative {
    background: rgb(var(--color-error));
}

.topic-modal .new-topic-form .sentiment-label {
    font-size: 0.75rem;
    color: rgb(var(--color-text-muted));
    min-width: 50px;
}

.topic-modal .new-topic-form .char-count {
    font-size: 0.75rem;
    color: rgb(var(--color-text-muted));
}

.topic-modal .new-topic-form .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(var(--color-border), 0.15);
}

/* Reply form footer layout */
.reply-form-footer,
.comment-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.reply-form-footer-left,
.comment-form-footer-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.reply-form-footer .sentiment-indicator,
.comment-form-footer .sentiment-indicator {
    width: 60%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.reply-form-footer .sentiment-bar,
.comment-form-footer .sentiment-bar {
    flex: 1;
    height: 8px;
    background: rgba(var(--color-border), 0.3);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.reply-form-footer .sentiment-fill,
.comment-form-footer .sentiment-fill {
    height: 100%;
    width: 0;
    transition: width 0.3s, background 0.3s;
    border-radius: var(--radius-full);
}

.reply-form-footer .sentiment-fill.positive,
.comment-form-footer .sentiment-fill.positive {
    background: rgb(var(--color-success));
}

.reply-form-footer .sentiment-fill.neutral,
.comment-form-footer .sentiment-fill.neutral {
    background: rgb(var(--color-warning));
}

.reply-form-footer .sentiment-fill.negative,
.comment-form-footer .sentiment-fill.negative {
    background: rgb(var(--color-error));
}

.reply-form-footer .sentiment-label,
.comment-form-footer .sentiment-label {
    font-size: 0.75rem;
    color: rgb(var(--color-text-secondary));
}

/* ============================================
   Real-time Sentiment Indicator (card inline forms only)
   Appears as a line at the bottom of the textarea
   Does NOT apply inside .topic-modal (has its own styles above)
   ============================================ */
.topic-card .sentiment-indicator,
.blog-card .sentiment-indicator {
    margin-top: calc(-1 * var(--spacing-1));
    position: relative;
}

.topic-card .sentiment-bar,
.blog-card .sentiment-bar {
    height: var(--spacing-1);
    background: linear-gradient(90deg,
        rgb(var(--color-error)) 0%,
        rgb(var(--color-warning)) 50%,
        rgb(var(--color-success)) 100%
    );
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
    position: relative;
}

/* Dark overlay that reveals the gradient as sentiment improves */
.topic-card .sentiment-bar::before,
.blog-card .sentiment-bar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    background: rgba(var(--color-surface), var(--overlay-opacity-heavy));
    transition: width var(--duration-normal) var(--ease-out);
    width: var(--reveal, 100%);
}

.topic-card .sentiment-status,
.blog-card .sentiment-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-xs);
    margin-top: var(--spacing-1);
    opacity: var(--opacity-80);
}

.topic-card .sentiment-score,
.blog-card .sentiment-score {
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-family-mono);
    color: rgb(var(--color-text-secondary));
}

.topic-card .sentiment-label,
.blog-card .sentiment-label {
    color: rgb(var(--color-text-secondary));
    transition: color var(--duration-normal) var(--ease-out);
}

/* Sentiment Feedback Modal */
.sentiment-scores-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-2);
    margin: var(--spacing-4) 0;
    padding: var(--spacing-4);
    background: rgba(var(--color-overlay), var(--opacity-20));
    border-radius: var(--radius-lg);
}

.sentiment-scores-grid .score-item {
    text-align: center;
}

.sentiment-scores-grid .score-value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
}

.sentiment-scores-grid .score-value.score-error {
    color: rgb(var(--color-error));
}

.sentiment-scores-grid .score-value.score-success {
    color: rgb(var(--color-success));
}

.sentiment-scores-grid .score-value.score-muted {
    color: rgb(var(--color-text-muted));
}

.sentiment-scores-grid .score-label {
    font-size: var(--font-size-xs);
    color: rgb(var(--color-text-secondary));
}

.sentiment-message {
    text-align: center;
    color: rgb(var(--color-warning));
    margin: var(--spacing-4) 0;
}

/* ============================================
   Reply Modal - Extends existing modal/comment styles
   ============================================ */
.reply-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reply-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--color-overlay), var(--overlay-opacity-medium));
}

.reply-modal-content {
    position: relative;
    background: rgb(var(--color-surface));
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.reply-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: rgb(var(--color-text-secondary));
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.reply-modal-close:hover {
    color: rgb(var(--color-text));
}

.reply-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: rgb(var(--color-text));
    margin: 0 0 1rem;
    padding-right: 2rem;
}

.reply-modal-section {
    margin-bottom: 1.5rem;
}

.reply-modal-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgb(var(--color-text-secondary));
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Reuse comment-item styles inside modal */
.reply-modal-latest .comment-item,
.reply-modal-thread .comment-item {
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    background: rgba(var(--color-surface-elevated), 0.5);
    border-radius: var(--radius-md);
}

.reply-modal-thread .comment-item {
    border-left: 3px solid rgba(var(--color-action), 0.5);
}

.reply-modal-thread .comment-item.highlight {
    border-left-color: rgb(var(--color-action));
    background: rgba(var(--color-action), 0.1);
}

.reply-modal-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.reply-modal-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(var(--color-border), 0.3);
    border-radius: var(--radius-md);
    background: rgb(var(--color-surface-elevated));
    color: rgb(var(--color-text));
    font-size: 0.9rem;
    resize: vertical;
    min-height: 100px;
}

.reply-modal-form textarea:focus {
    outline: none;
    border-color: rgb(var(--color-action));
}

.reply-modal-form .btn-primary {
    align-self: flex-end;
}
