/* ============================================================
   MOC Community Forum Styles
   ============================================================ */

/* --- Forum Nav Link (injected into Angular navbar) --- */
.moc-forum-nav-link {
    cursor: pointer;
    color: #ddd !important;
    transition: color 0.2s ease;
}
.moc-forum-nav-link:hover {
    color: #667eea !important;
}

/* --- Full-page overlay --- */
.moc-forum-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: #0f1117;
    overflow-y: auto;
    animation: mocForumFadeIn 0.3s ease;
}

@keyframes mocForumFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* --- Top bar --- */
.moc-forum-topbar {
    position: sticky;
    top: 0;
    z-index: 9010;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-bottom: 1px solid rgba(102,126,234,0.25);
    box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}
.moc-forum-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.moc-forum-topbar-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}
.moc-forum-topbar-icon {
    font-size: 22px;
    color: #667eea;
}
.moc-forum-close-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: #aaa;
    font-size: 22px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.moc-forum-close-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}

/* --- Container --- */
.moc-forum-container {
    max-width: 920px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

/* --- Category pills --- */
.moc-forum-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}
.moc-forum-cat-pill {
    padding: 7px 18px;
    border-radius: 20px;
    border: 1px solid rgba(102,126,234,0.25);
    background: rgba(255,255,255,0.04);
    color: #bbb;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.moc-forum-cat-pill:hover {
    background: rgba(102,126,234,0.12);
    color: #fff;
    border-color: rgba(102,126,234,0.5);
}
.moc-forum-cat-pill.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
}

/* --- Action bar (new post + search) --- */
.moc-forum-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.moc-forum-new-post-btn {
    padding: 10px 22px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.moc-forum-new-post-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(102,126,234,0.4);
}
.moc-forum-search-box {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    position: relative;
}
.moc-forum-search-input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}
.moc-forum-search-input::placeholder {
    color: #666;
}
.moc-forum-search-input:focus {
    border-color: rgba(102,126,234,0.5);
}
.moc-forum-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    font-size: 14px;
}

/* --- Post list --- */
.moc-forum-posts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.moc-forum-post-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.moc-forum-post-card:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(102,126,234,0.3);
    transform: translateY(-1px);
}
.moc-forum-post-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.moc-forum-post-title {
    font-size: 16px;
    font-weight: 600;
    color: #e8e8f0;
    line-height: 1.4;
    flex: 1;
}
.moc-forum-post-category-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(102,126,234,0.15);
    color: #8b9cf7;
    white-space: nowrap;
    flex-shrink: 0;
}
.moc-forum-post-excerpt {
    font-size: 14px;
    color: #888;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.moc-forum-post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: #666;
}
.moc-forum-post-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.moc-forum-post-meta-item i {
    font-size: 13px;
}
.moc-forum-post-author {
    color: #8b9cf7;
    font-weight: 500;
}
.moc-forum-post-pinned {
    border-left: 3px solid #667eea;
}

/* --- Pagination --- */
.moc-forum-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
}
.moc-forum-page-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.moc-forum-page-btn:hover {
    background: rgba(102,126,234,0.15);
    color: #fff;
}
.moc-forum-page-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-color: transparent;
}

/* --- Empty state --- */
.moc-forum-empty {
    text-align: center;
    padding: 60px 20px;
}
.moc-forum-empty-icon {
    font-size: 48px;
    color: #333;
    margin-bottom: 16px;
}
.moc-forum-empty-title {
    font-size: 20px;
    font-weight: 600;
    color: #ccc;
    margin-bottom: 8px;
}
.moc-forum-empty-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

/* --- Thread Detail View --- */
.moc-forum-thread {
    animation: mocForumFadeIn 0.25s ease;
}
.moc-forum-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #8b9cf7;
    font-size: 13px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 16px;
    transition: color 0.2s ease;
}
.moc-forum-back-btn:hover {
    color: #a5b4fc;
}
.moc-forum-thread-title {
    font-size: 24px;
    font-weight: 700;
    color: #e8e8f0;
    margin-bottom: 12px;
    line-height: 1.3;
}
.moc-forum-thread-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #666;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.moc-forum-thread-body {
    font-size: 15px;
    color: #c0c0cc;
    line-height: 1.75;
    margin-bottom: 32px;
    padding: 20px 24px;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    white-space: pre-wrap;
    word-wrap: break-word;
}
.moc-forum-thread-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}
.moc-forum-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: #999;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.moc-forum-action-btn:hover {
    background: rgba(102,126,234,0.12);
    color: #8b9cf7;
    border-color: rgba(102,126,234,0.3);
}
.moc-forum-action-btn.liked {
    color: #e74c3c;
    border-color: rgba(231,76,60,0.3);
}

/* --- Replies --- */
.moc-forum-replies-section {
    margin-top: 8px;
}
.moc-forum-replies-header {
    font-size: 16px;
    font-weight: 600;
    color: #ddd;
    margin-bottom: 18px;
}
.moc-forum-reply-card {
    padding: 16px 18px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    margin-bottom: 12px;
}
.moc-forum-reply-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #666;
}
.moc-forum-reply-author {
    color: #8b9cf7;
    font-weight: 600;
    font-size: 13px;
}
.moc-forum-reply-body {
    font-size: 14px;
    color: #bbb;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.moc-forum-reply-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}
.moc-forum-reply-action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 2px 0;
}
.moc-forum-reply-action-btn:hover {
    color: #8b9cf7;
}
.moc-forum-reply-action-btn.liked {
    color: #e74c3c;
}

/* --- Reply box --- */
.moc-forum-reply-box {
    margin-top: 24px;
    padding: 20px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
}
.moc-forum-reply-box h4 {
    font-size: 15px;
    font-weight: 600;
    color: #ddd;
    margin: 0 0 12px 0;
}
.moc-forum-reply-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #e0e0e0;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}
.moc-forum-reply-textarea:focus {
    border-color: rgba(102,126,234,0.5);
}
.moc-forum-reply-submit {
    margin-top: 12px;
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.moc-forum-reply-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(102,126,234,0.4);
}
.moc-forum-reply-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.moc-forum-login-prompt {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 14px;
}
.moc-forum-login-prompt a {
    color: #667eea;
    cursor: pointer;
    text-decoration: underline;
}

/* --- New Post Modal --- */
.moc-forum-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9050;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: mocForumFadeIn 0.2s ease;
    padding: 20px;
}
.moc-forum-modal {
    background: #1a1a2e;
    border: 1px solid rgba(102,126,234,0.2);
    border-radius: 16px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.moc-forum-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.moc-forum-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}
.moc-forum-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 4px;
}
.moc-forum-modal-close:hover {
    color: #fff;
}
.moc-forum-form-group {
    margin-bottom: 18px;
}
.moc-forum-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #aaa;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.moc-forum-form-input {
    width: 100%;
    padding: 11px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #e0e0e0;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}
.moc-forum-form-input:focus {
    border-color: rgba(102,126,234,0.5);
}
.moc-forum-form-textarea {
    width: 100%;
    min-height: 160px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #e0e0e0;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    line-height: 1.6;
}
.moc-forum-form-textarea:focus {
    border-color: rgba(102,126,234,0.5);
}
.moc-forum-form-select {
    width: 100%;
    padding: 11px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #e0e0e0;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}
.moc-forum-form-select:focus {
    border-color: rgba(102,126,234,0.5);
}
.moc-forum-form-select option {
    background: #1a1a2e;
    color: #e0e0e0;
}
.moc-forum-form-submit {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}
.moc-forum-form-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(102,126,234,0.4);
}
.moc-forum-form-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- Toast --- */
.moc-forum-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1a1a2e;
    border: 1px solid rgba(102,126,234,0.3);
    border-radius: 10px;
    padding: 14px 24px;
    color: #fff;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}
.moc-forum-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* --- Loading spinner --- */
.moc-forum-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}
.moc-forum-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid rgba(102,126,234,0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: mocForumSpin 0.8s linear infinite;
    margin-bottom: 12px;
}
@keyframes mocForumSpin {
    to { transform: rotate(360deg); }
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .moc-forum-topbar {
        padding: 10px 14px;
    }
    .moc-forum-topbar-title {
        font-size: 16px;
    }
    .moc-forum-container {
        padding: 16px 12px 40px;
    }
    .moc-forum-action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .moc-forum-search-box {
        max-width: none;
    }
    .moc-forum-post-header {
        flex-direction: column;
        gap: 6px;
    }
    .moc-forum-thread-title {
        font-size: 20px;
    }
    .moc-forum-modal {
        padding: 20px 16px;
    }
    .moc-forum-categories {
        gap: 6px;
    }
    .moc-forum-cat-pill {
        padding: 6px 12px;
        font-size: 12px;
    }
}
