/* ============================================================
   MORGEN-zijbalk: dezelfde navigatie op elke pagina.
   Zwevende zijbalk (in te klappen), op smal scherm een topbalk
   met schuifmenu, plus het chatpaneel met de ronde knop.

   Pagina's hebben hun eigen kleurtokens (--ink, --ink-zacht ...)
   met soms andere waarden. Daarom staan de tokens van de zijbalk
   op de zijbalk-elementen zelf, niet op :root. Alleen de maten
   (--zb, --zb-rand) zijn globaal: de pagina schuift ermee opzij.
   ============================================================ */

:root {
  --zb: 272px;          /* breedte zijbalk */
  --zb-rand: 16px;      /* afstand zijbalk tot schermrand */
  --zb-overgang: .3s cubic-bezier(.4, 0, .2, 1);
}
.is-ingeklapt { --zb: 84px; }

.hub-topbalk, .hub-scrim, .hub-zijbalk, .kompas-paneel, .hub-fab, .skiplink {
  --paars: #5B2D8E;
  --paars-licht: #9B6FCF;
  --accent: #D8FE56;
  --wit: #FFFFFF;
  --ink: #F0ECF5;
  --ink-zacht: #D8CCEC;
  --ink-stil: #A495BC;
  --rand: rgba(180, 145, 230, .26);
  --rand-sterk: rgba(200, 170, 240, .5);
  --glas: rgba(255, 255, 255, .045);
  --glas-sterk: rgba(255, 255, 255, .08);
  --radius: 20px;
  --radius-lg: 28px;
  --overgang: var(--zb-overgang);
  font-family: 'Barlow', system-ui, sans-serif;
}
.hub-topbalk *, .hub-zijbalk *, .kompas-paneel *, .hub-fab { box-sizing: border-box; }

/* Vars die de chatwidget (docs/academy-chat/chat.css) verwacht. */
.kompas-paneel {
  --purple: #5B2D8E;
  --purple-light: #9B6FCF;
  --pink: #D8FE56;
  --white: #FFFFFF;
  --text-primary: #F0ECF5;
  --text-secondary: #D8CCEC;
  --text-muted: #7A6B8E;
  --bg-dark: #0C0818;
  --glass-border: rgba(255, 255, 255, .18);
}

.hub-topbalk .icoon, .hub-zijbalk .icoon, .kompas-paneel .icoon, .hub-fab .icoon {
  display: block;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skiplink {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--accent);
  color: #1A1A2E;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform .2s;
}
.skiplink:focus { transform: none; }
#inhoud:focus { outline: none; }

/* ── De pagina schuift opzij ─────────────────────────────── */

@media (min-width: 900px) {
  body.met-zijbalk {
    padding-left: calc(var(--zb) + var(--zb-rand));
    transition: padding-left var(--zb-overgang);
  }
}

/* ── Knoppen en merk ─────────────────────────────────────── */

.hub-icoonknop {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink-zacht);
  font: inherit;
  cursor: pointer;
  transition: background var(--overgang), color var(--overgang);
}
.hub-icoonknop:hover { background: var(--glas-sterk); color: var(--wit); }

.hub-merk {
  font-weight: 900;
  font-size: 1.55rem;
  letter-spacing: .03em;
  line-height: 1;
  color: var(--wit);
  text-decoration: none;
  white-space: nowrap;
}
.hub-merk span { color: var(--accent); }

/* ── Zijbalk ─────────────────────────────────────────────── */

.hub-zijbalk {
  position: fixed;
  top: var(--zb-rand);
  bottom: var(--zb-rand);
  left: var(--zb-rand);
  z-index: 50;
  width: var(--zb);
  transition: width var(--overgang), transform var(--overgang);
}

.hub-zijbalk-paneel {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--rand);
  background:
    linear-gradient(180deg, rgba(155, 111, 207, .16), rgba(91, 45, 142, .08)),
    rgba(18, 11, 34, .72);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow: 0 12px 48px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .1);
  overflow: hidden auto;
  scrollbar-width: none;
}

.hub-zijbalk-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 0 4px 0 12px;
  margin-bottom: 26px;
}
.hub-sluitknop { display: none; }

.hub-nav { display: grid; gap: 4px; }

.hub-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--ink-zacht);
  font: inherit;
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.5;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--overgang), color var(--overgang);
}
.hub-nav-link:hover { background: rgba(155, 111, 207, .14); color: var(--wit); }
.hub-nav-link[aria-current="page"] {
  background: rgba(155, 111, 207, .26);
  color: var(--wit);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.hub-nav-link[aria-current="page"]::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}
.hub-nav-label { flex: 1 1 auto; }

.hub-teller {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 13px;
  background: var(--paars);
  border: 1px solid rgba(200, 170, 240, .5);
  color: var(--wit);
  font-size: .8rem;
  font-weight: 700;
}
.hub-label-ai {
  padding: 3px 9px;
  border-radius: 10px;
  border: 1px solid rgba(216, 254, 86, .45);
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.5;
}

.hub-zijbalk-onder {
  display: grid;
  gap: 2px;
  margin-top: auto;
  padding-top: 24px;
}
.hub-zijbalk-kop {
  margin: 0 0 6px 14px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-stil);
}
.hub-snel {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink-zacht);
  font: inherit;
  font-weight: 500;
  font-size: .96rem;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--overgang), color var(--overgang);
}
.hub-snel .icoon { width: 19px; height: 19px; }
.hub-snel:hover { background: rgba(155, 111, 207, .14); color: var(--wit); }
.hub-snel[aria-current="page"] { background: rgba(155, 111, 207, .22); color: var(--wit); }
.hub-zijbalk .hub-snel-uit { margin-left: auto; opacity: .55; width: 15px; height: 15px; }

.hub-mensen {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--rand);
  background: var(--glas);
  text-decoration: none;
  transition: border-color var(--overgang), background var(--overgang);
}
.hub-mensen:hover { border-color: var(--rand-sterk); background: var(--glas-sterk); }
.hub-mensen[aria-current="page"] { border-color: var(--rand-sterk); background: rgba(155, 111, 207, .2); }
.hub-mensen-fotos { display: flex; flex: 0 0 auto; }
.hub-mensen-fotos img {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #1b1030;
}
.hub-mensen-fotos img + img { margin-left: -12px; }
.hub-mensen-tekst { display: grid; line-height: 1.25; min-width: 0; }
.hub-mensen-tekst strong { color: var(--wit); font-weight: 700; font-size: .98rem; }

/* Ingeklapt (alleen op breed scherm): iconen, met een label als tooltip. */
@media (min-width: 900px) {
  .is-ingeklapt .hub-zijbalk-top { flex-direction: column; padding: 0; gap: 14px; }
  .is-ingeklapt .hub-zijbalk-top .hub-merk { font-size: 0; }
  .is-ingeklapt .hub-zijbalk-top .hub-merk::before { content: 'M'; font-size: 1.55rem; }
  .is-ingeklapt .hub-zijbalk-top .hub-merk span { font-size: 1.55rem; }
  .is-ingeklapt .hub-inklapknop { transform: rotate(180deg); }
  .is-ingeklapt .hub-nav-link,
  .is-ingeklapt .hub-snel { justify-content: center; padding: 0; gap: 0; }
  .is-ingeklapt .hub-nav-label,
  .is-ingeklapt .hub-label-ai,
  .is-ingeklapt .hub-snel span,
  .is-ingeklapt .hub-snel-uit,
  .is-ingeklapt .hub-zijbalk-kop,
  .is-ingeklapt .hub-mensen-tekst { display: none; }
  .is-ingeklapt .hub-teller {
    position: absolute;
    top: 6px;
    right: 8px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: .68rem;
  }
  .is-ingeklapt .hub-mensen { justify-content: center; padding: 10px 0; border-color: transparent; background: none; }
  .is-ingeklapt .hub-mensen-fotos img + img { display: none; }

  .is-ingeklapt .hub-zijbalk [data-tip] { position: relative; }
  .is-ingeklapt .hub-zijbalk [data-tip]:hover::after,
  .is-ingeklapt .hub-zijbalk [data-tip]:focus-visible::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 18px);
    top: 50%;
    transform: translateY(-50%);
    padding: 7px 12px;
    border-radius: 10px;
    background: #1d1233;
    border: 1px solid var(--rand);
    color: var(--wit);
    font-size: .88rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
  }
  /* Tooltip mag buiten het paneel vallen. */
  .is-ingeklapt .hub-zijbalk-paneel { overflow: visible; }
}

/* ── Mobiele topbalk ─────────────────────────────────────── */

.hub-topbalk { display: none; }
.hub-scrim { display: none; }

/* ── Het chatpaneel ──────────────────────────────────────── */

.kompas-paneel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 160;
  width: min(460px, calc(100vw - 32px));
  max-height: min(640px, calc(100dvh - 130px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(155, 111, 207, .4);
  background: rgba(16, 10, 30, .9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 30px 80px rgba(12, 8, 24, .75);
  color: var(--ink);
  line-height: 1.5;
  opacity: 0;
  transform: translateY(12px);
  /* display: flex overrulet [hidden]; visibility haalt het dichte paneel uit
     de klik- en voorleesvolgorde. */
  visibility: hidden;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.kompas-paneel:not([hidden]) { opacity: 1; transform: none; visibility: visible; pointer-events: auto; }
.kompas-paneel > [data-kompas] {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(155, 111, 207, .22);
}
.kompas-titel { margin: 0; padding-right: 44px; font-weight: 900; font-size: 1.6rem; line-height: 1.05; color: var(--wit); }
.kompas-sub { margin: 6px 0 14px; font-size: .95rem; color: var(--ink-zacht); }
.kompas-sluit {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(155, 111, 207, .4);
  background: rgba(12, 8, 24, .6);
  color: var(--ink);
  cursor: pointer;
}
.kompas-sluit .icoon { width: 18px; height: 18px; }
.kompas-sluit:hover { border-color: var(--accent); }

.hub-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 150;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid rgba(200, 170, 240, .55);
  background: radial-gradient(circle at 30% 25%, #8a5cc4, var(--paars) 60%);
  color: var(--wit);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(91, 45, 142, .55), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform var(--overgang);
}
.hub-fab:hover { transform: translateY(-2px) scale(1.04); }
.hub-fab .icoon { width: 26px; height: 26px; }

/* ── Smal: zijbalk wordt een schuifmenu ──────────────────── */

@media (max-width: 899px) {
  :root { --zb: min(320px, 86vw); --zb-rand: 12px; }

  body.met-zijbalk { padding-top: 64px; }

  .hub-topbalk {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 12px 0 20px;
    background: rgba(12, 8, 24, .78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(155, 111, 207, .2);
  }
  .hub-zijbalk { transform: translateX(calc(-100% - 24px)); z-index: 60; }
  .is-menu-open .hub-zijbalk { transform: none; }
  .hub-inklapknop { display: none; }
  .hub-sluitknop { display: inline-grid; }
  .hub-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(8, 4, 16, .6);
    backdrop-filter: blur(2px);
  }
  .hub-scrim[hidden] { display: none; }

  .kompas-paneel { right: 12px; left: 12px; width: auto; bottom: 86px; }
  .is-menu-open .hub-fab { opacity: 0; pointer-events: none; }
  .hub-fab { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .hub-zijbalk, .kompas-paneel, .hub-fab, body.met-zijbalk { transition: none; }
}
