/* ForumHub — rich BBCode editor */
.fh-editor {
    border: 1px solid #333;
    border-radius: 14px;
    background: var(--bg-input);
    overflow: hidden;
    transition: var(--transition);
}
.fh-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,184,124,0.12); }

.fh-toolbar {
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
    padding: 8px 10px; background: #222; border-bottom: 1px solid #2e2e2e;
}
.fh-toolbar .tool-btn {
    min-width: 32px; height: 32px; padding: 0 8px;
    background: #2a2a2a; border: 1px solid #353535; border-radius: 8px;
    color: var(--text-secondary); cursor: pointer; font-size: 0.8rem;
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    font-family: inherit; transition: var(--transition);
}
.fh-toolbar .tool-btn:hover { border-color: var(--accent); color: var(--text-primary); background: #303030; }
.fh-toolbar .tool-sep { width: 1px; height: 22px; background: #333; margin: 0 4px; }
.fh-toolbar .color-swatch {
    width: 22px; height: 22px; border-radius: 50%; border: 2px solid #444;
    cursor: pointer; padding: 0;
}
.fh-toolbar .color-swatch:hover { transform: scale(1.15); border-color: #fff; }
.fh-toolbar .color-picker-wrap { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.fh-toolbar .color-dropdown {
    display: none; position: absolute; top: 100%; left: 0; z-index: 20;
    background: var(--bg-card); border: 1px solid #333; border-radius: 12px;
    padding: 10px; gap: 6px; flex-wrap: wrap; width: 180px; box-shadow: var(--shadow); margin-top: 6px;
}
.fh-toolbar .color-picker-wrap.open .color-dropdown { display: flex; }
.fh-toolbar .hide-dropdown {
    flex-direction: column; flex-wrap: nowrap; width: 230px !important; max-height: 320px; overflow-y: auto;
}
.fh-toolbar select.size-select {
    background: #2a2a2a; border: 1px solid #353535; color: var(--text-secondary);
    border-radius: 8px; height: 32px; padding: 0 8px; font-size: 0.8rem; outline: none;
}
.fh-editor textarea {
    width: 100%; border: none !important; border-radius: 0 !important;
    background: transparent !important; min-height: 160px; padding: 14px 16px;
    resize: vertical; box-shadow: none !important;
}
.fh-editor .preview-pane {
    display: none; padding: 14px 16px; min-height: 120px;
    border-top: 1px dashed #333; background: #1a1a1a;
    color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6;
}
.fh-editor.preview-mode .preview-pane { display: block; }
.fh-editor.preview-mode textarea { display: none; }
.fh-editor.drag-over { outline: 2px dashed var(--accent); outline-offset: -4px; }
.upload-strip {
    display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 12px;
    border-top: 1px solid #2e2e2e; background: #1a1a1a;
}
.upload-thumb {
    position: relative; width: 56px; height: 56px; border-radius: 8px; overflow: hidden;
    border: 1px solid #333;
}
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-thumb button {
    position: absolute; right: 2px; bottom: 2px; width: 20px; height: 20px;
    border: none; border-radius: 6px; background: var(--accent); color: #141414;
    font-weight: 700; cursor: pointer; line-height: 1; padding: 0;
}

/* BB render */
.bb-color { font-weight: 500; }
.bb-center { text-align: center; }
.bb-left { text-align: left; }
.bb-right { text-align: right; }
.bb-h1 { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); margin: 8px 0; }
.bb-h2 { font-size: 1.15rem; font-weight: 600; color: var(--text-primary); margin: 6px 0; }
.bb-list { margin: 8px 0 8px 20px; }
.bb-hr { border: none; border-top: 1px solid #333; margin: 14px 0; }
.quote-block {
    background: #2a2a2a; border-left: 3px solid var(--accent);
    padding: 10px 14px; border-radius: 8px; margin: 10px 0; font-size: 0.9rem;
}
.quote-block cite { display: block; font-style: normal; color: var(--accent); font-size: 0.8rem; margin-bottom: 6px; font-weight: 600; }
.code-block {
    background: #1a1a1a; border: 1px solid #333; border-radius: 10px;
    padding: 12px 14px; overflow-x: auto; font-size: 0.85rem; margin: 10px 0;
}
.post-img { max-width: 100%; border-radius: 10px; margin: 8px 0; }

/* Hide blocks */
.hide-block {
    margin: 12px 0; border-radius: 12px; overflow: hidden; border: 1px solid #333;
}
.hide-block.locked {
    background: linear-gradient(135deg, #1a1a1a, #222);
    border-color: #3a3a20; border-style: dashed;
}
.hide-block.unlocked {
    background: #1f2a24; border-color: #2e4a3a;
}
.hide-head {
    padding: 10px 14px; font-size: 0.85rem; font-weight: 600;
    display: flex; align-items: center; gap: 8px; color: var(--text-primary);
}
.hide-block.locked .hide-head { color: #e2a04a; }
.hide-block.unlocked .hide-head { color: var(--accent); }
.hide-req { padding: 0 14px 12px; font-size: 0.82rem; color: var(--text-secondary); }
.hide-body { padding: 0 14px 14px; color: var(--text-secondary); }
.hide-progress {
    margin: 0 14px 6px; height: 6px; background: #2a2a2a; border-radius: 40px; overflow: hidden;
}
.hide-bar { height: 100%; background: var(--accent); border-radius: 40px; transition: width 0.3s; }
.hide-progress-text { padding: 0 14px 12px; font-size: 0.72rem; color: var(--text-muted); }
.hide-badge {
    font-size: 0.65rem; padding: 2px 8px; border-radius: 40px; font-weight: 600;
    background: #2a2a2a; color: var(--text-muted); margin-left: 6px;
}
.hide-badge.author { color: var(--accent); }
.hide-badge.staff { color: #4a90e2; }

.quote-block .quote-inner { margin-top: 4px; }

.spoiler {
    background: #222; border: 1px solid #333; border-radius: 10px; padding: 8px 12px; margin: 8px 0;
}
.spoiler summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 0.85rem; }
.spoiler-body { margin-top: 8px; color: var(--text-secondary); }

/* Online badge fix */
.avatar-wrap {
    position: relative; width: 52px; height: 52px; flex-shrink: 0;
}
.avatar-wrap .avatar-img {
    width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: #333; border: 2px solid #3a3a3a; color: var(--text-muted);
    font-weight: 600; font-size: 1.3rem;
}
.avatar-wrap .avatar-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-wrap .online-dot {
    position: absolute; bottom: 1px; right: 1px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--accent); border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 2px rgba(59,184,124,0.25);
    z-index: 2; pointer-events: none;
}
.avatar-wrap.offline .online-dot { display: none; }
.avatar-wrap.sm { width: 40px; height: 40px; }
.avatar-wrap.sm .online-dot { width: 11px; height: 11px; }
.avatar-wrap.lg { width: 64px; height: 64px; }
.avatar-wrap.lg .online-dot { width: 16px; height: 16px; }
