/* ================================
   Luier.org – basisstijl (variabel-gedreven)
   ================================ */

:root {
    /* Basis (ongewijzigde waarden) */
    --bg: #f3f6fb;
    --panel: #ffffff;
    --border: #d7e2f0;
    --text: #1b2a3a;
    --muted: #5c708a;
    --brand: #2c6ebb;
    --accent: #e9f2ff;

    /* Nieuw: consistente uitlijning tussen content en sidebar */
    --sidebar-w: 300px;   /* breedte sidebar */
    --page-gap: 16px;     /* gap tussen content en sidebar (.page gap) */
    --panel-pad: 12px;    /* horizontale padding binnen .panel */
    --panel-border: 1px;  /* paneelrand (1px) */

    /* Nieuw: extra variabelen om hardcoded kleuren te vermijden */
    --panel-contrast: #ffffff;      /* wat voorheen #fff was binnen componenten */
    --table-th-bg: #f8fbff;         /* header-achtergrond in tabellen */
    --badge-bg: #eef4ff;            /* badge/fallback avatar achtergrond */
    --on-brand: #ffffff;            /* tekstkleur op primaire/brand knoppen */

    /* Success-state kleuren */
    --success: #28a745;
    --success-hover: #218838;
    --success-border-hover: #1e7e34;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font: 14px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

/* Globale img reset */
img { max-width: 100%; height: auto; display: block; }

/* Layout wrappers */
.wrap { width: 98%; max-width: 1100px; margin: 0 auto; }

/* Topbar / header */
.topbar { background: var(--panel); border-bottom: 1px solid var(--border); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.brand a { color: var(--brand); font-weight: 700; text-decoration: none; font-size: 18px; }
.nav a { margin-left: 12px; color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--brand); }

/* Algemene UI */
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    margin: 16px 0;
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { border-bottom: 1px solid var(--border); padding: 10px; text-align: left; }
.table th { background: var(--accent); color: var(--brand); }

.btn {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    background: var(--panel-contrast);
    color: var(--text);
}
.btn:hover { border-color: var(--brand); }
.btn-primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn-success { background: var(--success); color: var(--on-brand); border-color: var(--success); }
.btn-success:hover { background: var(--success-hover); border-color: var(--success-border-hover); }

.input, select, textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel-contrast);
    color: var(--text);
}

.form-row { margin-bottom: 10px; }
.meta { color: var(--muted); font-size: 12px; }
/* Hier stond .topic-title */

.post { border-bottom: 1px solid var(--border); padding: 12px 0; }
.post .author { font-weight: 600; color: var(--brand); }
.actions a { margin-right: 8px; }
.footer { margin: 20px 0; text-align: center; color: var(--muted); }

.badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-left: 6px;
    color: var(--muted);
    background: var(--panel-contrast);
}

/* =========================
   Index: rechter sidebar + categorie/board tabel
   ========================= */
.page {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-w);
    gap: var(--page-gap);
    align-items: start;
    margin-top: 20px;
}

.sidebar { position: sticky; top: 12px; }
.sidebar .panel { margin-top: 0; }

/* eerste panel zonder extra top-margin */
.page > section .panel:first-child { margin-top: 0; }

.section-title {
    font-weight: 700;
    color: var(--brand);
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
    margin-bottom: 8px;
}

/* Categorie blokken */
.category-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin: 0 0 16px 0;
    overflow: hidden;
}
.category-header {
    background: var(--accent);
    color: var(--brand);
    padding: 10px 12px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
}

/* Index tabel */
.cat-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.cat-table th, .cat-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cat-table th { text-align: left; font-weight: 700; color: var(--brand); background: var(--table-th-bg); white-space: nowrap; }
.cat-table col.col-board { width: 50%; }
.cat-table col.col-topics { width: 12%; }
.cat-table col.col-posts { width: 12%; }
.cat-table col.col-last { width: 26%; }
.cat-table th.stats { min-width: 110px; }
.cat-table td { overflow: hidden; text-overflow: ellipsis; }
.cat-table td .board-title a { font-weight: 600; color: var(--text); text-decoration: none; }
.cat-table td .board-title a:hover { color: var(--brand); }
.cat-table td .board-desc { color: var(--muted); font-size: 12px; margin-top: 4px; }
.cat-table .stats { text-align: center; white-space: nowrap; }
.cat-table .lastpost { font-size: 12px; color: var(--muted); }
.lastpost .lp-title { color: var(--text); font-weight: 600; text-decoration: none; }
.lastpost .lp-title:hover { color: var(--brand); }
.lastpost .lp-user { color: var(--brand); font-weight: 600; }
.lastpost .lp-row { display: flex; align-items: center; gap: 8px; }
.lastpost img.avatar { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); object-fit: cover; }

/* Online-lijst rechts */
.online-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.online-list li { font-size: 12px; }

/* =========================
   Board topics lijst (compact)
   ========================= */
.topic-list { padding: 0; overflow: hidden; }

.topic-list--compact .topic-row {
    display: grid;
    grid-template-columns: 1fr calc(var(--sidebar-w) + var(--page-gap) + var(--panel-pad) + var(--panel-border));
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.topic-row .cell { min-width: 0; }

.title-cell { display: flex; align-items: center; gap: 10px; }
.topic-main { min-width: 0; }
.topic-link { font-weight: 700; color: var(--brand); text-decoration: none; }
.topic-link:hover { text-decoration: underline; }
.topic-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.topic-meta .u { color: var(--text); font-weight: 600; }

.right-cell {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    align-items: center;
}
.right-stats { text-align: right; }
.right-stats .rs-label { color: var(--muted); font-size: 14px; }
.right-stats .rs-value { font-weight: 700; font-size: 18px; color: var(--text); }
.right-last { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.right-last-text { text-align: right; }
.right-last-date { color: var(--brand); font-weight: 700; text-decoration: none; }
.right-last-date:hover { text-decoration: underline; }
.right-last-user { font-size: 12px; color: var(--muted); }
.right-last-user .u { color: var(--brand); font-weight: 700; }

/* Avatars + fallback badges */
.avatar { display: block; border-radius: 50%; border: 1px solid var(--border); object-fit: cover; }
.avatar-md { width: 36px; height: 36px; flex: 0 0 36px; }
.avatar-sm { width: 24px; height: 24px; flex: 0 0 24px; }
.avatar-badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--border); background: var(--badge-bg); color: var(--brand); font-weight: 700; }
.avatar-md.avatar-badge { width: 36px; height: 36px; font-size: 14px; }
.avatar-sm.avatar-badge { width: 24px; height: 24px; font-size: 12px; }

/* Safety net: voorkom 'reuzenplaatjes' in topic-lijst */
.topic-list .topic-row img { max-width: 48px; max-height: 48px; }

/* Responsive */
@media (max-width: 900px) {
    .topic-list--compact .topic-row { grid-template-columns: 1fr; }
    .right-cell { grid-template-columns: 1fr 1fr; }
    .right-stats, .right-last { justify-content: flex-start; text-align: left; }
    .right-last-text { text-align: left; }
}

/* Responsive (index) */
@media (max-width: 980px) {
    .page { grid-template-columns: 1fr; }
    .cat-table col.col-topics,
    .cat-table col.col-posts,
    .cat-table th:nth-child(2),
    .cat-table td:nth-child(2),
    .cat-table th:nth-child(3),
    .cat-table td:nth-child(3) { display: none; }
}

/* Sidebar panel footer (tellerbalk) */
.panel-footer {
    border-top: 1px solid var(--border);
    margin-top: 12px;
    padding-top: 10px;
    color: var(--muted);
    font-weight: 600;
}

/* =========================
   Chat: ledenlijst styling
   ========================= */
.online-list li a.chat-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    background: var(--panel-contrast);
    transition: background 0.2s, border-color 0.2s;
}
.online-list li a.chat-user:hover { background: var(--accent); border-color: var(--brand); }
.chat-username { font-size: 13px; font-weight: 600; }

/* =========================
   Chat grid layout
   ========================= */
.chat-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 16px;
    margin-top: 20px;
    align-items: start;
}
.chat-main { display: flex; flex-direction: column; gap: 12px; }
.chat-sidebar { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 12px; }

/* =========================
   Fix: chat avatars + afbeeldingen
   ========================= */
.chat-stream img.avatar, .online-list img.avatar {
    max-width: 32px; max-height: 32px; border-radius: 50%; object-fit: cover;
}
.chat-stream .content img {
    max-width: 200px; max-height: 200px; border-radius: 4px; object-fit: contain;
}

/* =========================
   Fix: online-lijst layout
   ========================= */
.online-list { list-style: none; padding: 0; margin: 0; }
.online-list li a.chat-user img.avatar {
    width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.online-list li a.chat-user .chat-username { font-size: 13px; font-weight: 600; white-space: nowrap; }

/* =========================
   Chat layout spacing fix
   ========================= */
.chat-layout .panel { margin: 6px 0; }
.chat-sidebar .panel { margin: 6px 0; }

/* =========================================================
   Tabs
   ========================================================= */
.tabs {
    display: inline-flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    margin: 12px 0 16px;
}
.tab {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid var(--border);
    border-bottom: none; /* visuele verbinding met .tabs border-bottom */
    background: var(--panel-contrast);
    color: var(--text);
    padding: 8px 12px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tab:hover { border-color: var(--brand); color: var(--brand); }
.tab.active {
    background: var(--accent);
    color: var(--brand);
    border-color: var(--brand);
    font-weight: 700;
}
a.tab:link, a.tab:visited, a.tab:hover, a.tab:active { text-decoration: none; color: inherit; }
/* hier stond .tab-pane */

/* =========================================================
   Admin tables/cards
   ========================================================= */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; }
.admin-table th { background: var(--accent); color: var(--brand); }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; margin: 16px 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 12px; border-bottom: 1px solid var(--border); }
.card h2 { margin: 0; font-size: 18px; color: var(--text); }

/* Dropdown (lichtgewicht) */
.dropdown { position: relative; display: inline-block; }
.dropdown .menu {
    position: absolute; top: 100%; left: 0; min-width: 160px;
    background: var(--panel-contrast); border: 1px solid var(--border); border-radius: 6px; padding: 6px;
    display: none; z-index: 10;
}
.dropdown:hover .menu { display: block; }
.dropdown .menu button, .dropdown .menu a {
    display: block; width: 100%; text-align: left; padding: 6px 8px; border: none; background: none; cursor: pointer;
}
.dropdown .menu button:hover, .dropdown .menu a:hover { background: var(--accent); }

/* Modals (basic) */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 100; }
.modal-dialog { background: var(--panel-contrast); border-radius: 10px; border: 1px solid var(--border); width: 100%; max-width: 560px; margin: 10vh auto; padding: 0; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 8px; }

/* Helpers om modals te tonen/verbergen via JS */
.modal.is-open { display: block; }

/* =========================================================
   CHAT — ULTRA-COMPACT WEERGAVE (avatar USERNAME – tijd: bericht)
   ========================================================= */

/* Elk bericht: flex rij met minimale verticale padding */
.chat-stream .post {
    display: flex !important;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0 !important;                 /* override inline style in index.php */
    border-bottom: 1px solid var(--border) !important;
    margin: 0 !important;
}

/* laatste bericht: geen onderlijn */
.chat-stream .post:last-child {
    border-bottom: 0 !important;
}

/* Avatar klein en strak */
.chat-stream .post .avatar,
.chat-stream .post .avatar-sm,
.chat-stream .post .avatar-badge {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 !important;
    flex: 0 0 28px;
}

/* Body-kolom pakt alle ruimte */
.chat-stream .post > div[style*="flex:1"],
.chat-stream .post > div {
    flex: 1 1 auto;
    min-width: 0;
}

/* Meta (naam + tijd) inline, direct vóór de content */
.chat-stream .post .meta {
    display: inline;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 13px;
    color: var(--text);
    font-weight: 600;               /* USERNAME vet */
    line-height: 1.25;
}

/* Voeg “: ” tussen meta en content */
.chat-stream .post .meta::after {
    content: ": ";
    font-weight: 400;
    color: inherit;
}

/* De datum/tijd staat al in de meta (met '·'), we geven 'm subtiele kleur */
.chat-stream .post .meta,
.chat-stream .post .meta .time {
    color: var(--text);
}
.chat-stream .post .meta { --sep: " · "; }
.chat-stream .post .author { color: var(--text); font-weight: 700; }

/* Content direct inline achter meta */
.chat-stream .post .content {
    display: inline;
    line-height: 1.25;
    color: var(--text);
    vertical-align: baseline;
    white-space: normal;
}

/* Paragrafen uit WYSIWYG inline maken zodat er geen blokmarges ontstaan */
.chat-stream .post .content p {
    display: inline;
    margin: 0 !important;
}
.chat-stream .post .content p + p::before {
    content: " ";
}

/* Lijsten/HR in content compacter (komen zelden voor, maar toch) */
.chat-stream .post .content ul,
.chat-stream .post .content ol {
    display: inline-block;
    margin: 0 0 0 16px;
    padding: 0;
}
.chat-stream .post .content hr {
    margin: 4px 0;
}

/* Verwijder alle mogelijke vertical margins binnen de message-rij */
.chat-stream .post > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Optioneel: nóg compacter maken – zet deze aan indien gewenst */
/*
.chat-stream .post { padding: 2px 0 !important; }
.chat-stream .post .content { line-height: 1.2; }
*/
/* Whisper-labeltje inline, zo min mogelijk ruimte */
.tag-whisper {
  display: inline-block;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin-right: 4px;
  white-space: nowrap;
}

/* Kaartachtige weergave topics */

/* =========================================================
   TOPICS — Card look + grotere avatars + strakkere actionbar
   (plak dit blok ONDERAAN je style.css)
   ========================================================= */

/* Kaart-stijl per post (alleen in topic panels) */
.panel > .post {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  padding: 14px 16px;
  margin: 12px 0;
  box-shadow: 0 1px 0 rgba(10,20,40,.04);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  border-bottom: none; /* overschrijft basis .post */
}
.panel > .post:hover {
  border-color: #cfe0ff;
  box-shadow: 0 2px 10px rgba(10,20,40,.06);
  background: #fbfdff;
}

/* Grotere avatars + badge fallback */
.post .avatar-md {
  width: 64px !important;
  height: 64px !important;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px #fff, 0 0 0 1px rgba(10,20,40,.06);
}
.post .avatar-badge {
  width: 64px !important;
  height: 64px !important;
  font-size: 20px;
  font-weight: 700;
  color: #445;
  background: linear-gradient(180deg,#eef2ff,#e6ebf5);
  border: 1px solid rgba(10,20,40,.08);
}

/* Headerregel (gebruiker + tijd) */
.post .meta:first-of-type {
  margin: 0 0 6px 0 !important;
  font-size: 14px;
  color: #57606a;
}
.post .author { font-weight: 700; color: #1f2937; }

/* Inhoud beter leesbaar */
.post .content {
  font-size: 16px;
  line-height: 1.65;
  color: #111827;
  word-break: break-word;
}
.post .content p { margin: 0 0 10px; }
.post .content ul, .post .content ol { margin: 6px 0 10px 22px; }
.post .content img { border-radius: 6px; }

/* Quote-stijl netter */
.post .content blockquote {
  margin: 8px 0;
  padding: 8px 12px;
  border-left: 4px solid #dbeafe;
  background: #f8fafc;
  border-radius: 6px;
  color: #334155;
}

/* Actierij onder de content */
.post .actions.meta {
  margin-top: 10px !important;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #6b7280;
}
.post .actions .btn,
.post .actions a.btn {
  padding: 4px 10px;
  line-height: 1.2;
  border-radius: 8px;
  background: var(--panel-contrast);
}

/* Reactions (als geactiveerd) in dezelfde stijl */
.reactbar { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.reactbtn {
  border: 1px solid var(--border);
  background: var(--panel-contrast);
  border-radius: 999px;
  padding: 3px 9px;
  line-height: 1;
  cursor: pointer;
}
.reactbtn:hover { background: #f5f8ff; }
.reactbtn .cnt { font-size: 12px; margin-left: 4px; opacity: .85; }
.reactbtn.active { border-color: #9bb7ff; background: #eef4ff; }

/* Badges (sticky/closed/hidden) consistent */
.badge-sticky, .badge-closed, .badge-hidden {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: #f3f4f6;
}

/* Kleine meta-teksten overal harmoniseren */
.meta { color: #64748b; }

/* Responsief finetunen */
@media (max-width: 640px) {
  .panel > .post { padding: 12px 12px; gap: 12px !important; }
  .post .avatar-md, .post .avatar-badge { width: 52px !important; height: 52px !important; }
  .post .content { font-size: 15px; }
}
/* Hier stond button.is-disabled */
