/* ==========================================================
   Cleef Chat – forum start page (forum/index.php)
   Loaded after index_modern.css and uses its colours (--bg, --card, ...),
   so light/dark mode works the same as on the home page.
   ========================================================== */

.brand-name { font: normal 28px/1 "SCRIPTBL", var(--font); }
.menu a.active { color: var(--text); background: var(--surface-2); }

.forum-main { padding-top: 28px; padding-bottom: 10px; }

.crumbs { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs span { margin: 0 6px; opacity: 0.6; }

.muted { color: var(--muted); font-size: 13.5px; }
.btn.inline { display: inline-block; width: auto; height: 46px; padding: 0 22px; line-height: 46px; text-align: center; }
a.btn { text-align: center; line-height: 52px; color: #fff; }
a.btn:hover { color: #fff; }

/* ---------- hero ---------- */
.forum-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 24px 32px;
  align-items: center;
  margin-bottom: 22px;
  padding: 30px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(124, 92, 255, 0.22), transparent 55%),
    radial-gradient(90% 120% at 0% 100%, rgba(34, 211, 238, 0.12), transparent 60%),
    var(--card);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent-2);
  font-size: 12.5px;
  font-weight: 600;
}
.forum-hero h1 { margin: 0 0 8px; font-size: 36px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.forum-hero p { margin: 0; color: var(--muted); max-width: 560px; }
.fh-stats { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 20px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.fh-stats b { display: block; color: var(--text); font-size: 22px; font-weight: 750; letter-spacing: -0.01em; }

.fh-actions { display: grid; gap: 12px; }
.fh-new { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; }
.fh-new svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.fh-hint { font-size: 13px !important; }
.fh-search { position: relative; margin: 0; }
.fh-search svg { position: absolute; left: 15px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.fh-search input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--field);
  color: var(--text);
  font: 500 15px var(--font);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fh-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.18); }

/* ---------- layout ---------- */
.forum-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.forum-list { display: grid; gap: 22px; min-width: 0; }
.forum-side { display: grid; gap: 22px; }
.forum-grid .panel { margin-bottom: 0; }

.box-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 14px; font-size: 17px; font-weight: 700; }
.box-title svg { width: 18px; height: 18px; fill: none; stroke: var(--accent-2); stroke-width: 2; stroke-linejoin: round; }
.box-title .clear { font-size: 13px; font-weight: 600; }

/* ---------- list head: title + tabs ---------- */
.list-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 6px; }
.list-head .box-title { margin: 0; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--field-2); border: 1px solid var(--border); overflow-x: auto; }
.tabs a { padding: 7px 12px; border-radius: 9px; color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.on { background: var(--accent); color: #fff; }

/* ---------- topic rows ---------- */
.topics-box { padding: 22px 24px 16px; }
.topics { margin: 0; padding: 0; list-style: none; }
.topic {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 132px 168px;
  gap: 16px;
  align-items: center;
  padding: 16px 10px;
  margin: 0 -10px;
  border-bottom: 1px solid var(--border);
  border-radius: 14px;
  transition: background 0.15s;
}
.topic:last-child { border-bottom: 0; }
.topic:hover { background: var(--item); }

.t-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; padding: 2px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); align-self: start; }
.t-main { min-width: 0; }
.t-title { margin: 0 0 4px; font-size: 15.5px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.t-title a { color: var(--text); }
.t-title a:hover { color: var(--accent-2); }
.t-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.badge { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.01em; }
.badge.pin  { background: rgba(124, 92, 255, 0.16); color: #a996ff; }
.badge.lock { background: var(--surface-2); color: var(--muted); }
.badge.wait { background: rgba(245, 158, 11, 0.16); color: #f59e0b; }
.badge.new  { background: rgba(52, 211, 153, 0.13); color: var(--green); }
:root[data-theme="light"] .badge.pin { color: var(--accent); }
.t-snippet { margin: 0 0 6px; color: var(--muted); font-size: 13.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.t-meta { font-size: 12.5px; color: var(--muted); }
.who { color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.who b { font-weight: 600; }
a.who:hover b { color: var(--accent-2); }
.who img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }

.t-stats { display: flex; gap: 14px; justify-content: flex-end; }
.t-stats span { display: grid; justify-items: center; color: var(--muted); font-size: 11px; min-width: 52px; }
.t-stats svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; margin-bottom: 2px; opacity: 0.8; }
.t-stats b { color: var(--text); font-size: 15px; font-weight: 700; }
.t-stats i { font-style: normal; }

.t-last { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 12.5px; }
.t-last img { width: 32px; height: 32px; flex: none; border-radius: 50%; object-fit: cover; }
.t-last div { display: grid; min-width: 0; }
.t-last b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-last a { color: var(--muted); }
.t-last a:hover { color: var(--accent-2); }
.t-last .none { color: var(--muted); font-style: italic; }

.empty { padding: 30px 10px; text-align: center; color: var(--muted); }
.empty p { margin: 0 0 14px; }

/* ---------- pagination ---------- */
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 18px 0 4px; }
.pager a, .pager span {
  min-width: 38px; height: 38px;
  display: grid; place-items: center;
  padding: 0 10px;
  border-radius: 11px;
  font-weight: 600; font-size: 14px;
}
.pager a { border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.pager a:hover { background: var(--surface-2); color: var(--text); }
.pager .cur { background: var(--accent); color: #fff; }
.pager .gap, .pager .off { color: var(--muted); opacity: 0.6; }

/* ---------- side column ---------- */
.side-box { padding: 22px; }
.side-box .btn { margin-top: 12px; }
.side-box p { margin: 0; }
.me { display: flex; align-items: center; gap: 12px; }
.me img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; padding: 2px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.me small { display: block; color: var(--muted); font-size: 12px; }
.me b { font-size: 16px; }
.side-link { display: block; margin-top: 12px; text-align: center; font-size: 14px; font-weight: 600; }

.mini { margin: 0; padding: 0; list-style: none; counter-reset: m; }
.mini li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.mini li:last-child { border-bottom: 0; padding-bottom: 0; }
.mini li:first-child { padding-top: 0; }
.mini img { width: 32px; height: 32px; flex: none; border-radius: 50%; object-fit: cover; }
.mini div { display: grid; min-width: 0; }
.mini a { color: var(--text); font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini a:hover { color: var(--accent-2); }
.mini small { color: var(--muted); font-size: 12px; }
.ranked li { counter-increment: m; }
.ranked li::before { content: counter(m); width: 16px; flex: none; color: var(--muted); font-weight: 700; font-size: 13px; text-align: right; }
.ranked li:nth-child(-n+3)::before { color: var(--accent-2); }

.links { margin: 0; padding-left: 18px; font-size: 14px; }
.links li { margin: 7px 0; }
.links li::marker { color: var(--accent); }
.links a { color: var(--muted); }
.links a:hover { color: var(--text); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .topic { grid-template-columns: 44px minmax(0, 1fr) 132px; }
  .t-last { display: none; }
}
@media (max-width: 980px) {
  .forum-hero { grid-template-columns: 1fr; }
  .forum-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .brand-name { font-size: 24px; }
}
@media (max-width: 600px) {
  .forum-main { padding-top: 18px; }
  .forum-hero { padding: 24px 20px; }
  .forum-hero h1 { font-size: 28px; }
  .topics-box { padding: 18px 16px 12px; }
  .topic { grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 14px 8px; margin: 0 -8px; }
  .t-avatar { width: 36px; height: 36px; }
  .t-stats { grid-column: 2; justify-content: flex-start; gap: 16px; margin-top: -4px; }
  .t-stats span { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12px; }
  .t-stats svg { margin: 0; }
  .t-stats b { font-size: 13px; }
  .t-stats i { display: none; }
  .tabs { width: 100%; }
  .list-head { margin-bottom: 4px; }
}
