/**
 * Community Forum CSS
 * Modern Skool-Style Design
 */

/* ===============================================
   FORUM LAYOUT
   =============================================== */

.community-forum {
    background: var(--rs-white);
    min-height: 100vh;
    padding: 40px 0 80px;
}

.forum-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.forum-container-narrow {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ===============================================
   FORUM HEADER
   =============================================== */

.forum-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.forum-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.forum-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

.new-post-btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===============================================
   FORUM LAYOUT (3-Column)
   =============================================== */

.forum-layout {
    display: grid;
    grid-template-columns: 240px 1fr 280px;
    gap: 32px;
}

/* ===============================================
   SIDEBAR (Channels)
   =============================================== */

.forum-sidebar {
    position: sticky;
    top: 110px;
    align-self: start;
}

.sidebar-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    margin: 0 0 16px 0;
}

.channel-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.channel-item {
    margin-bottom: 4px;
}

.channel-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    transition: var(--rs-transition-fast);
}

.channel-item a:hover {
    background: #f3f4f6;
}

.channel-item.active a {
    background: rgba(107, 76, 154, 0.08);
    color: var(--rs-purple);
    font-weight: 600;
}

.channel-icon {
    margin-right: 8px;
}

.channel-count {
    font-size: 12px;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 12px;
}

/* ===============================================
   INLINE POST COMPOSER
   =============================================== */

.inline-composer-trigger {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inline-composer-trigger:hover {
    border-color: var(--rs-purple);
    box-shadow: 0 4px 12px rgba(107, 76, 154, 0.1);
}

.composer-trigger-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.composer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.composer-placeholder {
    flex: 1;
    color: #9ca3af;
    font-size: 15px;
    user-select: none;
}

.composer-open-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--rs-purple) 0%, #8b5cf6 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.composer-open-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(107, 76, 154, 0.3);
}

/* Composer Modal */
.composer-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.composer-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.composer-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.composer-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.composer-close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
}

.composer-close-btn:hover {
    background: #f3f4f6;
    color: #1a1a1a;
}

.composer-modal-body {
    padding: 24px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* Inline Composer Form */
.inline-composer-form .form-group {
    margin-bottom: 20px;
}

.inline-composer-form .form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.inline-composer-form .form-label svg {
    color: var(--rs-purple);
}

.inline-composer-form .form-input,
.inline-composer-form .form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    color: #1a1a1a;
    transition: all 0.2s ease;
    font-family: inherit;
}

.inline-composer-form .form-input:focus,
.inline-composer-form .form-select:focus {
    outline: none;
    border-color: var(--rs-purple);
    box-shadow: 0 0 0 3px rgba(107, 76, 154, 0.1);
}

.inline-composer-form .form-input::placeholder {
    color: #9ca3af;
}

/* Toolbar Styling */
.inline-composer-form .toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    background: linear-gradient(to bottom, #fafbfc, #f6f8fa);
    border: 1px solid #e5e7eb;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    margin-bottom: -1px;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.inline-composer-form .toolbar-divider {
    width: 1px;
    height: 20px;
    background: #d1d5db;
    margin: 0 4px;
    flex-shrink: 0;
}

.inline-composer-form .toolbar-btn {
    padding: 7px 10px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 34px;
    height: 34px;
}

.inline-composer-form .toolbar-btn:hover {
    background: #f9fafb;
    border-color: var(--rs-purple);
    color: var(--rs-purple);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(107, 76, 154, 0.1);
}

.inline-composer-form .toolbar-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.inline-composer-form .toolbar-btn.active {
    background: var(--rs-purple);
    border-color: var(--rs-purple);
    color: white;
}

.inline-composer-form .toolbar-btn svg {
    flex-shrink: 0;
}

/* Rich Text Editor */
.inline-composer-form .rich-text-editor {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 0 0 8px 8px;
    font-size: 15px;
    line-height: 1.6;
    color: #1a1a1a;
    background: white;
    outline: none;
    white-space: normal;
    overflow-x: hidden;
    max-width: 100%;
    word-wrap: break-word;
}

.inline-composer-form .rich-text-editor:focus {
    border-color: var(--rs-purple);
    box-shadow: 0 0 0 3px rgba(107, 76, 154, 0.1);
}

.inline-composer-form .rich-text-editor:empty:before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
}

.inline-composer-form .rich-text-editor.drag-over {
    border-color: var(--rs-purple);
    background: rgba(107, 76, 154, 0.02);
}

.inline-composer-form .rich-text-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}

.inline-composer-form .rich-text-editor p {
    margin: 0 0 12px 0;
}

.inline-composer-form .rich-text-editor ul,
.inline-composer-form .rich-text-editor ol {
    margin: 0 0 12px 0;
    padding-left: 24px;
}

.inline-composer-form .rich-text-editor a {
    color: var(--rs-purple);
    text-decoration: underline;
}

/* Link Modal */
.link-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.link-modal {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.link-modal h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.link-modal .link-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 12px;
    font-family: inherit;
}

.link-modal .link-input:focus {
    outline: none;
    border-color: var(--rs-purple);
    box-shadow: 0 0 0 3px rgba(107, 76, 154, 0.1);
}

.link-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Upload Progress in Modal */
.inline-composer-form .upload-progress {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    min-width: 280px;
    z-index: 10002;
}

.inline-composer-form .upload-progress-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.inline-composer-form .upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--rs-purple) 0%, #8b5cf6 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.inline-composer-form .upload-progress-text {
    font-size: 14px;
    color: #6b7280;
}

/* Community Rules Modal (specific styles for inline composer) */
.rules-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.rules-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 850px;
    max-height: 95vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.rules-modal h2 {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    padding: 24px 28px 0;
}

.rules-intro {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 20px 0;
    padding: 0 28px;
}

.rules-list {
    margin-bottom: 0;
    padding: 0 28px 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    overflow-y: auto;
    max-height: calc(95vh - 200px);
}

.rule-item {
    display: flex;
    gap: 12px;
    margin-bottom: 0;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.rule-number {
    width: 28px;
    height: 28px;
    background: var(--rs-purple);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
    font-size: 14px;
}

.rule-content h3 {
    margin: 0 0 3px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.rule-content p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

.rules-footer {
    font-size: 13px;
    color: #6b7280;
    padding: 0 28px 16px;
    margin: 0;
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
}

.rules-footer a {
    color: var(--rs-purple);
    text-decoration: underline;
    font-weight: 600;
}

.rules-footer a:hover {
    color: var(--rs-purple-dark);
}

.rules-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 28px 24px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

/* Responsive: Stack auf Mobile */
@media (max-width: 768px) {
    .rules-list {
        grid-template-columns: 1fr;
    }
    
    .rules-modal {
        max-width: 95%;
    }
    
    .rules-modal h2 {
        font-size: 20px;
        padding: 20px 20px 0;
    }
    
    .rules-intro,
    .rules-list {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .rules-actions {
        padding: 16px 20px 20px;
    }
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.btn-secondary,
.btn-primary {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* Button-Styles werden von buttons-global.css übernommen */

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Toast Messages */
.toast-message {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10001;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast-message.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-success svg {
    color: #10b981;
    flex-shrink: 0;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-error svg {
    color: #ef4444;
    flex-shrink: 0;
}

.toast-message span {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
}

/* Spinning animation for loading */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinning {
    animation: spin 1s linear infinite;
}

/* ===============================================
   FORUM CONTROLS
   =============================================== */

.forum-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 12px;
}

.forum-tabs {
    display: flex;
    gap: 8px;
    margin-right: 16px;
}

.forum-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    cursor: pointer;
    transition: var(--rs-transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tab-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.tab-dot-red {
    background: #ef4444;
}

.tab-dot-yellow {
    background: #f59e0b;
}

.tab-dot-blue {
    background: #3b82f6;
}

.tab-dot-purple {
    background: var(--rs-purple);
}

.forum-tab:hover {
    background: var(--rs-white);
    color: #374151;
}

.forum-tab.active {
    background: var(--rs-white);
    color: var(--rs-purple);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.forum-search {
    position: relative;
}

.forum-search-input {
    padding: 8px 36px 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    width: 240px;
}

.forum-search-input:focus {
    outline: none;
    border-color: var(--rs-purple);
}

.search-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.search-clear-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Search Results Dropdown */
.forum-search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 400px;
    max-height: 500px;
    overflow-y: auto;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.search-results-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 12px 12px 0 0;
}

.search-results-list {
    padding: 8px;
}

.search-result-item {
    display: block;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.search-result-item:hover {
    background: #f9fafb;
}

.search-result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.search-result-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.search-result-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-result-author {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.search-result-date {
    font-size: 11px;
    color: #9ca3af;
}

.search-result-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.search-result-excerpt {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0 0 8px 0;
}

.search-result-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #9ca3af;
}

.search-result-channel {
    color: var(--rs-purple);
    font-weight: 500;
}

.search-loading,
.search-no-results,
.search-error {
    padding: 24px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

.search-error {
    color: #ef4444;
}

/* ===============================================
   FORUM FEED (Posts)
   =============================================== */

.forum-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.forum-post-card {
    background: var(--rs-white);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: var(--rs-transition-fast);
    cursor: pointer;
    position: relative;
}

.forum-post-card:hover {
    border-color: var(--rs-purple);
    box-shadow: 0 4px 12px rgba(107, 76, 154, 0.08);
    transform: translateY(-2px);
}

.post-card-main {
    display: flex;
    gap: 16px;
}

/* ===============================================
   VOTE SECTION
   =============================================== */

.post-vote {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.vote-btn {
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--rs-transition-fast);
    color: #6b7280;
}

.vote-btn:hover {
    background: #e5e7eb;
}

.vote-btn.voted.vote-up {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.vote-btn.voted.vote-down {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.vote-score {
    font-size: 16px;
    font-weight: 700;
    color: #374151;
}

.vote-score.score-updated {
    animation: scoreUpdate 0.3s ease;
}

@keyframes scoreUpdate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ===============================================
   POST CONTENT
   =============================================== */

.post-card-content {
    flex: 1;
    min-width: 0;
}

.post-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.post-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    border-radius: 50%;
}

.author-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.post-meta {
    font-size: 13px;
    color: #9ca3af;
}

.post-channel {
    color: var(--rs-purple);
    font-weight: 500;
}

.answered-badge {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Save/Bookmark Button */
.save-post-btn {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.2s ease;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.save-post-btn:hover {
    background: #f3f4f6;
    color: var(--rs-purple);
}

.save-post-btn.saved {
    color: var(--rs-purple);
}

.save-post-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.post-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.post-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.post-title a:hover {
    color: var(--rs-purple);
}

.post-excerpt {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 16px;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.post-stats {
    display: flex;
    gap: 16px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
}

.stat-item svg {
    color: #9ca3af;
}

.read-more {
    font-size: 14px;
    font-weight: 500;
    color: var(--rs-purple);
    text-decoration: none;
}

.read-more:hover {
    text-decoration: underline;
}

/* ===============================================
   RIGHT SIDEBAR (Widgets)
   =============================================== */

.forum-right-sidebar {
    position: sticky;
    top: 110px;
    align-self: start;
}

.sidebar-widget {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.widget-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.trending-list,
.contributors-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.trending-item {
    margin-bottom: 16px;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.trending-item:hover {
    background: white;
    border-color: var(--rs-purple);
    box-shadow: 0 4px 12px rgba(107, 76, 154, 0.1);
    transform: translateX(-2px);
}

/* Slide-Out Preview */
.trending-item::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 8px 0;
    border-color: transparent white transparent transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.trending-item:hover::after {
    opacity: 1;
}

.trending-preview-card {
    position: absolute;
    right: calc(100% + 16px);
    top: 0;
    width: 380px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 20px;
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
}

.trending-item:hover .trending-preview-card {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.preview-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.preview-author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.preview-author-info {
    flex: 1;
}

.preview-author-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    display: block;
    margin-bottom: 4px;
}

.preview-post-meta {
    font-size: 12px;
    color: #9ca3af;
}

.preview-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    margin: 0 0 12px 0;
}

.preview-card-excerpt {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 16px;
    max-height: 200px;
    overflow-y: auto;
}

.preview-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.preview-card-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #9ca3af;
}

.preview-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--rs-purple);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.preview-card-link:hover {
    background: #5a3f9f;
    transform: translateX(2px);
}

.preview-card-link svg {
    width: 14px;
    height: 14px;
}

/* Top 1 Trending - Special Highlight */
.trending-top {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.05));
    border: 2px solid var(--rs-purple);
    padding: 16px;
    margin-bottom: 20px;
}

.trending-top .trending-title {
    font-size: 15px;
    font-weight: 600;
}

/* Trending Header */
.trending-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.channel-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
}

.active-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.active-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Trending Title */
.trending-title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 8px;
}

.trending-title:hover {
    color: var(--rs-purple);
}

/* Stats Row */
.trending-stats-row {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #6b7280;
}

.trending-stats-row .stat {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.no-trending {
    color: #9ca3af;
    font-size: 13px;
    font-style: italic;
    padding: 8px 0;
}

.contributor-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 13px;
}

.contributor-item img {
    border-radius: 50%;
}

.rank-badge {
    font-size: 16px;
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    color: #9ca3af;
}

.contributor-item.rank-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), transparent);
    padding: 10px 8px;
    margin: 0 -8px;
    border-radius: 8px;
}

.contributor-item.rank-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.1), transparent);
    padding: 10px 8px;
    margin: 0 -8px;
    border-radius: 8px;
}

.contributor-item.rank-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.1), transparent);
    padding: 10px 8px;
    margin: 0 -8px;
    border-radius: 8px;
}

.contributor-name {
    flex: 1;
    font-weight: 500;
}

.contributor-points {
    color: var(--rs-purple);
    font-weight: 600;
    font-size: 12px;
}

.no-activity {
    color: #9ca3af;
    font-size: 13px;
    font-style: italic;
    padding: 8px 0;
}

/* ===============================================
   SINGLE POST (Thread View)
   =============================================== */

.forum-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    margin-top: 32px;
    font-size: 14px;
}

.forum-breadcrumb a {
    color: #6b7280;
    text-decoration: none;
}

.forum-breadcrumb a:hover {
    color: var(--rs-purple);
}

.forum-breadcrumb .separator {
    color: #d1d5db;
}

.forum-breadcrumb .current {
    color: #374151;
}

.forum-post-detail {
    background: var(--rs-white);
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    display: flex;
    gap: 24px;
}

.post-detail-sidebar {
    flex-shrink: 0;
}

.post-vote-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.post-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.author-avatar-large {
    border-radius: 50%;
}

.author-name-large {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.post-meta-detail {
    font-size: 14px;
    color: #9ca3af;
}

.channel-badge {
    background: rgba(107, 76, 154, 0.1);
    color: var(--rs-purple);
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 500;
}

.post-detail-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 24px 0;
    line-height: 1.3;
}

.post-detail-body {
    font-size: 16px;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 24px;
}

.post-detail-body p {
    margin-bottom: 16px;
}

.post-detail-body img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.post-detail-body .video-embed-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 20px 0;
    border-radius: 8px;
    background: #000;
}

.post-detail-body .video-embed-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.post-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.post-tag {
    background: #f3f4f6;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    color: #6b7280;
}

/* ===============================================
   FILE ATTACHMENTS
   =============================================== */

.file-attachment-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin: 16px 0;
    cursor: pointer;
    transition: var(--rs-transition-fast);
}

.file-attachment-card:hover {
    background: #f3f4f6;
    border-color: var(--rs-purple);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

.file-attachment-card .file-icon {
    font-size: 32px;
    line-height: 1;
}

.file-attachment-card .file-info {
    flex: 1;
    min-width: 0;
}

.file-attachment-card .file-name {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-attachment-card .file-meta {
    font-size: 13px;
    color: #6b7280;
}

.file-attachment-card .file-download {
    color: var(--rs-purple);
    transition: var(--rs-transition-fast);
}

.file-attachment-card:hover .file-download {
    transform: translateY(2px);
}

/* ===============================================
   ANSWERS SECTION
   =============================================== */

.forum-answers-section {
    margin-top: 32px;
}

.answers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.answers-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.answers-sort {
    display: flex;
    gap: 8px;
}

.sort-btn {
    padding: 6px 12px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: var(--rs-transition-fast);
}

.sort-btn:hover {
    background: #e5e7eb;
}

.sort-btn.active {
    background: var(--rs-purple);
    color: var(--rs-white);
}

.best-answer-wrapper {
    margin-bottom: 24px;
}

.best-answer-badge {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 8px 16px;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
}

.forum-answer {
    background: var(--rs-white);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    gap: 16px;
    transition: var(--rs-transition-fast);
}

/* Threaded Replies */
.forum-answer-reply {
    background: #f9fafb;
    border-left: 3px solid var(--rs-purple);
    position: relative;
}

.forum-answer-reply .answer-avatar {
    width: 40px;
    height: 40px;
}

.forum-answer.best-answer {
    border-color: #10b981;
    border-radius: 0 12px 12px 12px;
}

.answer-vote {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.answer-content {
    flex: 1;
}

.answer-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
}

.answer-avatar {
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    transition: var(--rs-transition-fast);
}

.answer-avatar:hover {
    border-color: var(--rs-purple);
    transform: scale(1.05);
}

.answer-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.answer-author {
    font-size: 15px;
    font-weight: 600;
    color: var(--rs-purple);
    transition: var(--rs-transition-fast);
}

.answer-author:hover {
    color: #7c3aed;
}

.reply-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 2px;
}

.answer-date {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 400;
}

.mark-best-answer {
    padding: 6px 14px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid #10b981;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #10b981;
    cursor: pointer;
    transition: var(--rs-transition-fast);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mark-best-answer:hover {
    background: #10b981;
    color: var(--rs-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.answer-body {
    font-size: 15px;
    line-height: 1.8;
    color: #374151;
    margin-bottom: 12px;
}

.answer-body p {
    margin: 0 0 12px 0;
}

.answer-body p:last-child {
    margin-bottom: 0;
}

.answer-body img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

.answer-body .video-embed-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 16px 0;
    border-radius: 8px;
    background: #000;
}

.answer-body .video-embed-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.answer-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

.answer-reply-btn,
.answer-edit-btn,
.answer-delete-btn,
.answer-report-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: var(--rs-transition-fast);
}

.answer-reply-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--rs-purple);
}

.answer-edit-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.answer-delete-btn:hover,
.answer-report-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.answer-report-btn.reported {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    cursor: not-allowed;
}

.answer-reply-btn svg,
.answer-edit-btn svg,
.answer-delete-btn svg,
.answer-report-btn svg {
    flex-shrink: 0;
}

/* ===============================================
   INLINE FORMS (Reply & Edit)
   =============================================== */

.inline-reply-form,
.inline-edit-form {
    background: #f9fafb;
    padding: 16px;
    border-radius: 12px;
    margin: 16px 0;
    border: 1px solid #e5e7eb;
}

.reply-editor-wrapper {
    position: relative;
}

.reply-toolbar {
    display: flex;
    gap: 4px;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 8px;
}

.reply-toolbar .toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reply-toolbar .toolbar-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--rs-purple);
}

.reply-image-preview {
    margin: 12px 0;
    padding: 8px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.reply-image-preview img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.reply-upload-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin: 8px 0;
}

.reply-upload-progress .upload-progress-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.reply-upload-progress .upload-progress-fill {
    height: 100%;
    background: var(--rs-purple);
    transition: width 0.3s ease;
}

.reply-upload-progress .upload-progress-text {
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}

.reply-textarea,
.edit-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: var(--rs-transition-fast);
}

.reply-textarea:focus,
.edit-textarea:focus {
    outline: none;
    border-color: var(--rs-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.reply-form-actions,
.edit-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: var(--rs-transition-fast);
}

.btn-primary {
    background: var(--rs-purple);
    color: var(--rs-white);
}

.btn-primary:hover {
    background: #7c3aed;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #e5e7eb;
    color: #6b7280;
}

.btn-secondary:hover {
    background: #d1d5db;
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===============================================
   ANSWER FORM
   =============================================== */

.answer-form-wrapper {
    margin-top: 32px;
    padding: 24px;
    background: #f9fafb;
    border-radius: 12px;
}

.answer-form-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
}

#commentform textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
}

#commentform textarea:focus {
    outline: none;
    border-color: var(--rs-purple);
}

.login-to-reply {
    text-align: center;
    padding: 32px;
    background: #f9fafb;
    border-radius: 12px;
}

.login-to-reply a {
    color: var(--rs-purple);
    font-weight: 600;
}

/* ===============================================
   EMPTY STATE
   =============================================== */

.forum-empty {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.forum-empty h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.forum-empty p {
    color: #6b7280;
    margin-bottom: 24px;
}

/* ===============================================
   RESPONSIVE
   =============================================== */

@media (max-width: 1200px) {
    .forum-layout {
        grid-template-columns: 200px 1fr;
    }
    
    .forum-right-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .forum-layout {
        grid-template-columns: 1fr;
    }
    
    .forum-sidebar {
        position: relative;
        top: 0;
    }
    
    .forum-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .forum-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .forum-search-input {
        width: 100%;
    }
    
    .post-card-main {
        flex-direction: column;
    }
    
    .post-vote {
        flex-direction: row;
    }
    
    .forum-post-detail {
        flex-direction: column;
    }
}

/* ===============================================
   GAMIFICATION STYLES
   =============================================== */

.user-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.forum-leaderboard {
    background: var(--rs-white);
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
}

.leaderboard-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    background: #f9fafb;
    transition: var(--rs-transition-fast);
}

.leaderboard-item:hover {
    background: #f3f4f6;
}

.leaderboard-item.rank-1 {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.leaderboard-item.rank-2 {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
}

.leaderboard-item.rank-3 {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
}

.leaderboard-rank {
    font-size: 24px;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
}

.leaderboard-user {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.leaderboard-user img {
    border-radius: 50%;
}

.leaderboard-name {
    font-weight: 600;
    color: #1a1a1a;
}

.leaderboard-level {
    font-size: 13px;
}

.leaderboard-points {
    text-align: right;
}

.leaderboard-points strong {
    display: block;
    font-size: 18px;
    color: #1a1a1a;
}

.leaderboard-points span {
    font-size: 12px;
    color: #9ca3af;
}

.leaderboard-badges {
    display: flex;
    gap: 4px;
}

.mini-badge {
    font-size: 16px;
}

/* User Stats Widget */
.forum-user-stats {
    background: var(--rs-white);
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
}

.user-stats-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.user-stats-avatar img {
    border-radius: 50%;
}

.user-stats-info {
    flex: 1;
}

.user-stats-info h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
}

.user-level {
    font-weight: 600;
}

.user-stats-points {
    text-align: right;
}

.points-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--rs-purple);
}

.points-label {
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    text-align: center;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: #9ca3af;
}

.user-badges-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.user-badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.badge-card {
    text-align: center;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: var(--rs-transition-fast);
}

.badge-card:hover {
    border-color: var(--rs-purple);
    box-shadow: 0 4px 12px rgba(107, 76, 154, 0.08);
}

.badge-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.badge-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.badge-desc {
    font-size: 12px;
    color: #9ca3af;
}

/* ===============================================
   POST ACTIONS (Report/Share/Edit/Delete)
   =============================================== */

.post-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.report-post-btn,
.share-post-btn,
.edit-post-btn,
.delete-post-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.report-post-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.report-post-btn.reported {
    background: #f0fdf4;
    border-color: #86efac;
    color: #16a34a;
    cursor: not-allowed;
}

.share-post-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.edit-post-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #2563eb;
}

.delete-post-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.report-post-btn svg,
.share-post-btn svg,
.edit-post-btn svg,
.delete-post-btn svg {
    width: 16px;
    height: 16px;
}

/* ===============================================
   @MENTION AUTOCOMPLETE
   =============================================== */

.mention-dropdown {
    position: absolute;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 240px;
    overflow-y: auto;
    z-index: 10000;
    min-width: 280px;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition: var(--rs-transition-fast);
}

.mention-item:hover,
.mention-item.selected {
    background: rgba(139, 92, 246, 0.1);
}

.mention-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mention-info {
    flex: 1;
    min-width: 0;
}

.mention-name {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mention-username {
    font-size: 13px;
    color: #6b7280;
}

.user-mention {
    display: inline;
    background: rgba(139, 92, 246, 0.15);
    color: var(--rs-purple);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--rs-transition-fast);
}

.user-mention:hover {
    background: rgba(139, 92, 246, 0.25);
}

.post-detail-body .user-mention,
.answer-body .user-mention {
    color: var(--rs-purple);
    text-decoration: none;
}

.post-detail-body .user-mention:hover,
.answer-body .user-mention:hover {
    text-decoration: underline;
}

/* ===============================================
   TOAST NOTIFICATIONS
   =============================================== */

.forum-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    min-width: 320px;
    max-width: 480px;
    z-index: 100000;
    transform: translateX(calc(100% + 24px));
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 4px solid;
}

.forum-toast.show {
    transform: translateX(0);
}

.forum-toast-success {
    border-left-color: #10b981;
}

.forum-toast-error {
    border-left-color: #ef4444;
}

.forum-toast-warning {
    border-left-color: #f59e0b;
}

.forum-toast-info {
    border-left-color: #3b82f6;
}

.toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.forum-toast-success .toast-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.forum-toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.forum-toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.forum-toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.toast-message {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.5;
}

.toast-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--rs-transition-fast);
}

.toast-close:hover {
    background: #f3f4f6;
    color: #6b7280;
}

/* ===============================================
   CONFIRMATION MODAL
   =============================================== */

.forum-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.forum-confirm-overlay.show {
    opacity: 1;
}

.forum-confirm-modal {
    background: white;
    border-radius: 16px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.forum-confirm-overlay.show .forum-confirm-modal {
    transform: scale(1);
}

.confirm-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.confirm-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

.confirm-body {
    padding: 20px 24px;
}

.confirm-body p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #6b7280;
}

.confirm-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px 24px;
}

.confirm-footer .btn-secondary,
.confirm-footer .btn-danger,
.confirm-footer .btn-primary {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--rs-transition-fast);
    border: none;
}

.confirm-footer .btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

.confirm-footer .btn-secondary:hover {
    background: #e5e7eb;
    color: #374151;
}

.confirm-footer .btn-danger {
    background: #ef4444;
    color: white;
}

.confirm-footer .btn-danger:hover {
    background: #dc2626;
}

.confirm-footer .btn-primary {
    background: var(--rs-purple);
    color: white;
}

.confirm-footer .btn-primary:hover {
    background: #7c3aed;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .forum-toast {
        top: 16px;
        right: 16px;
        left: 16px;
        min-width: auto;
        max-width: none;
    }
    
    .forum-toast {
        transform: translateY(-100px);
    }
    
    .forum-toast.show {
        transform: translateY(0);
    }
    
    .forum-confirm-modal {
        width: 95%;
    }
}



