/* Forum v2 — içerik biçimleri, oy sütunu, editör. Renkler tema değişkenlerinden (hp-tema.css), açık/koyu uyumlu. */

/* ---- Gönderi içeriği (forum_render çıktısı) ---- */
.fm-body { color: rgb(var(--hp-text)); font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; min-width: 0; }
.fm-body > * + * { margin-top: .75rem; }
.fm-body p { margin: 0; }
.fm-body strong { color: rgb(var(--hp-ink)); font-weight: 700; }
.fm-body h4 { font-size: 1.05rem; font-weight: 800; color: rgb(var(--hp-ink)); margin-top: 1.1rem; }
.fm-body ul, .fm-body ol { padding-left: 1.4rem; }
.fm-body ul { list-style: disc; }
.fm-body ol { list-style: decimal; }
.fm-body li + li { margin-top: .25rem; }
.fm-body blockquote { border-left: 3px solid rgb(var(--c-emerald-500) / .6); background: rgb(var(--c-n-950)); padding: .6rem .9rem; border-radius: 0 .75rem .75rem 0; color: rgb(var(--hp-muted)); }
:root[data-theme="dark"] .fm-body blockquote { background: rgb(var(--c-n-700) / .45); }
.fm-link { color: rgb(var(--c-emerald-500)); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgb(var(--c-emerald-500) / .4); }
.fm-link:hover { text-decoration-color: currentColor; }
.fm-mention { color: rgb(var(--c-emerald-500)); font-weight: 700; background: rgb(var(--c-emerald-500) / .1); padding: 0 .3rem; border-radius: .375rem; }
.fm-icode { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; font-size: .86em; padding: .1rem .35rem; border-radius: .375rem; background: rgb(var(--c-n-950)); border: 1px solid rgb(var(--hp-line)); color: rgb(var(--hp-ink)); }
:root[data-theme="dark"] .fm-icode { background: rgb(var(--c-n-700) / .45); }
.fm-code { border: 1px solid rgb(var(--hp-line)); border-radius: .9rem; overflow: hidden; background: rgb(var(--c-n-950)); }
:root[data-theme="dark"] .fm-code { background: rgb(var(--c-n-700) / .45); }
.fm-code-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem .5rem .35rem .85rem; border-bottom: 1px solid rgb(var(--hp-line)); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgb(var(--hp-muted)); }
.fm-copy { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .6rem; border-radius: .5rem; font-size: 11px; font-weight: 700; text-transform: none; letter-spacing: 0; color: rgb(var(--hp-text)); border: 1px solid rgb(var(--hp-line)); background: rgb(var(--hp-surface)); transition: .15s; }
.fm-copy:hover { color: rgb(var(--c-emerald-500)); border-color: rgb(var(--c-emerald-500) / .5); }
.fm-copy.is-done { color: rgb(var(--c-emerald-500)); }
.fm-code pre { margin: 0; padding: .85rem 1rem; overflow-x: auto; max-height: 520px; font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.6; color: rgb(var(--hp-ink)); white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- Oy sütunu ---- */
.fm-vote { display: flex; flex-direction: column; align-items: center; gap: .15rem; width: 2.75rem; flex: none; }
.fm-vote-btn { width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: 9999px; border: 1px solid rgb(var(--hp-line)); color: rgb(var(--hp-muted)); background: transparent; transition: .15s; }
.fm-vote-btn:hover:not([disabled]):not([aria-disabled="true"]) { color: rgb(var(--c-emerald-500)); border-color: rgb(var(--c-emerald-500) / .5); background: rgb(var(--c-emerald-500) / .08); }
.fm-vote-btn.is-on[data-vote="1"] { color: #fff; background: rgb(var(--c-emerald-500)); border-color: rgb(var(--c-emerald-500)); }
.fm-vote-btn.is-on[data-vote="-1"] { color: #fff; background: rgb(244 63 94); border-color: rgb(244 63 94); }
.fm-vote-btn[disabled], .fm-vote-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.fm-vote-btn[aria-disabled="true"]:hover { color: rgb(var(--hp-muted)); border-color: rgb(var(--hp-line)); background: transparent; }
.fm-score { font-weight: 800; font-size: 1.05rem; color: rgb(var(--hp-ink)); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: center; }
.fm-accept-mark { margin-top: .35rem; width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: 9999px; color: rgb(var(--c-emerald-500)); background: rgb(var(--c-emerald-500) / .12); }
button.fm-accept-mark { color: rgb(var(--hp-muted)); background: transparent; border: 1px dashed rgb(var(--hp-line)); }
button.fm-accept-mark:hover { color: rgb(var(--c-emerald-500)); border-color: rgb(var(--c-emerald-500) / .6); }
button.fm-accept-mark.is-on { color: #fff; background: rgb(var(--c-emerald-500)); border-style: solid; border-color: rgb(var(--c-emerald-500)); }

/* ---- Gönderi eylem düğmeleri ---- */
.fm-act { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .55rem; border-radius: .5rem; font-size: 12px; font-weight: 600; color: rgb(var(--hp-muted)); transition: .15s; white-space: nowrap; }
.fm-act:hover { color: rgb(var(--hp-ink)); background: rgb(var(--hp-surface-2) / .6); }
.fm-act.is-danger:hover { color: rgb(244 63 94); background: rgb(244 63 94 / .08); }
.fm-act.is-on { color: rgb(var(--c-emerald-500)); }

.fm-sub-btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 2.5rem; border-radius: .75rem; border: 1px solid rgb(var(--hp-line)); font-weight: 700; font-size: 14px; color: rgb(var(--hp-text)); transition: .15s; }
.fm-sub-btn:hover { color: rgb(var(--c-emerald-500)); border-color: rgb(var(--c-emerald-500) / .5); }
.fm-sub-btn.is-on { color: rgb(var(--c-emerald-500)); border-color: rgb(var(--c-emerald-500) / .5); background: rgb(var(--c-emerald-500) / .1); }
.fm-sub-btn[disabled], .fm-act[disabled] { opacity: .6; cursor: wait; }

/* ---- Konu listesi satırı: sayaçlar ---- */
.fm-stat { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 3.4rem; padding: .35rem .25rem; border-radius: .75rem; font-size: 11px; line-height: 1.1; color: rgb(var(--hp-muted)); }
.fm-stat b { font-size: 15px; font-weight: 800; color: rgb(var(--hp-ink)); font-variant-numeric: tabular-nums; }
.fm-stat.is-answered { border: 1px solid rgb(var(--c-emerald-500) / .45); color: rgb(var(--c-emerald-500)); }
.fm-stat.is-answered b { color: rgb(var(--c-emerald-500)); }
.fm-stat.is-solved { background: rgb(var(--c-emerald-500)); color: #fff; }
.fm-stat.is-solved b { color: #fff; }
.fm-tag { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .5rem; border-radius: .5rem; font-size: 11.5px; font-weight: 600; color: rgb(var(--hp-text)); background: rgb(var(--c-n-950)); border: 1px solid rgb(var(--hp-line)); transition: .15s; }
:root[data-theme="dark"] .fm-tag { background: rgb(var(--c-n-700) / .45); }
.fm-tag:hover { color: rgb(var(--c-emerald-500)); border-color: rgb(var(--c-emerald-500) / .45); }
.fm-unread-dot { width: .5rem; height: .5rem; border-radius: 9999px; background: rgb(var(--c-emerald-500)); box-shadow: 0 0 0 3px rgb(var(--c-emerald-500) / .2); flex: none; }

/* ---- Sekmeler ---- */
.fm-tabs { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; padding: .25rem; border: 1px solid rgb(var(--hp-line)); border-radius: 1rem; background: rgb(var(--hp-surface) / .6); }
.fm-tabs::-webkit-scrollbar { display: none; }
.fm-tab { flex: none; display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .85rem; border-radius: .75rem; font-size: 13px; font-weight: 700; color: rgb(var(--hp-muted)); transition: .15s; white-space: nowrap; }
.fm-tab:hover { color: rgb(var(--hp-ink)); }
.fm-tab.is-active { color: #fff; background: rgb(var(--c-emerald-500)); }

/* ---- Editör ---- */
.fm-editor { border: 1px solid rgb(var(--hp-line)); border-radius: 1rem; overflow: hidden; background: rgb(var(--hp-surface) / .8); transition: border-color .15s, box-shadow .15s; }
.fm-editor:focus-within { border-color: rgb(var(--c-emerald-500) / .6); box-shadow: 0 0 0 3px rgb(var(--c-emerald-500) / .15); }
.fm-toolbar { display: flex; align-items: center; gap: .15rem; flex-wrap: wrap; padding: .35rem; border-bottom: 1px solid rgb(var(--hp-line)); }
.fm-tool { width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: .5rem; color: rgb(var(--hp-muted)); font-size: 13px; transition: .15s; }
.fm-tool:hover { color: rgb(var(--hp-ink)); background: rgb(var(--hp-surface-2) / .6); }
.fm-tool-sep { width: 1px; height: 1.25rem; background: rgb(var(--hp-line)); margin: 0 .25rem; }
.fm-mode { padding: .35rem .7rem; border-radius: .5rem; font-size: 12px; font-weight: 700; color: rgb(var(--hp-muted)); }
.fm-mode.is-active { color: rgb(var(--hp-ink)); background: rgb(var(--hp-surface-2) / .7); }
.fm-textarea { display: block; width: 100%; min-height: 180px; padding: .9rem 1rem; background: transparent; border: 0; outline: none; resize: vertical; color: rgb(var(--hp-ink)); font-size: 15px; line-height: 1.65; }
.fm-textarea::placeholder { color: rgb(var(--hp-muted)); }
.fm-preview { min-height: 180px; padding: 1rem 1.1rem 1.1rem; }
/* .fm-textarea display:block tanımı Tailwind .hidden'ı eziyordu: önizlemede metin alanı açık kalıyordu */
.fm-editor .fm-textarea.hidden, .fm-editor .fm-preview.hidden { display: none; }
.fm-editor.is-invalid { border-color: rgb(244 63 94 / .7); box-shadow: 0 0 0 3px rgb(244 63 94 / .15); }
.fm-field-error { display: flex; align-items: center; gap: .4rem; margin-top: .5rem; font-size: 12.5px; font-weight: 600; color: rgb(244 63 94); }
.fm-input-invalid { border-color: rgb(244 63 94 / .7) !important; box-shadow: 0 0 0 3px rgb(244 63 94 / .15) !important; }
.fm-editor-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .4rem .75rem; border-top: 1px solid rgb(var(--hp-line)); font-size: 11.5px; color: rgb(var(--hp-muted)); }

/* @bahsetme öneri kutusu */
.fm-suggest { position: absolute; z-index: 60; min-width: 220px; max-width: 280px; padding: .25rem; border-radius: .9rem; border: 1px solid rgb(var(--hp-line)); background: rgb(var(--hp-surface)); box-shadow: 0 18px 40px -12px rgb(0 0 0 / .35); }
.fm-suggest button { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .4rem .55rem; border-radius: .6rem; font-size: 13px; font-weight: 600; color: rgb(var(--hp-text)); text-align: left; }
.fm-suggest button.is-active, .fm-suggest button:hover { background: rgb(var(--c-emerald-500) / .12); color: rgb(var(--hp-ink)); }
.fm-suggest img { width: 1.5rem; height: 1.5rem; border-radius: 9999px; object-fit: cover; }

/* Yeni gelen cevap vurgusu / bağlantıyla açılan cevap */
@keyframes fm-flash { from { box-shadow: 0 0 0 3px rgb(var(--c-emerald-500) / .55); } to { box-shadow: 0 0 0 3px rgb(var(--c-emerald-500) / 0); } }
.fm-flash { animation: fm-flash 2.4s ease-out 1; }
.fm-toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 9999; padding: .7rem 1.1rem; border-radius: .9rem; font-size: 14px; font-weight: 600; color: #fff; background: rgb(15 23 42 / .95); box-shadow: 0 18px 40px -12px rgb(0 0 0 / .45); max-width: calc(100vw - 32px); }
.fm-toast.is-error { background: rgb(190 18 60 / .96); }
