/* =====================================================================
   Kweko 5.4 — meer beweging, plat en in Kweko-stijl (geen gloed)
   1. Onderbalk: het groene vlakje glijdt naar het nieuwe tabblad, het icoon hupt even.
   2. Badge met ongelezen berichten: ploft erin, hupt bij een nieuw bericht, krimpt weg.
   3. Schermen die omhoog schuiven (sheets): soepeler, inhoud komt een voor een binnen.
   4. Banscherm: golven onderin, icoon ploft erin, aftellen schuift, balk met golfjes.
   ===================================================================== */

/* ---------- 1. onderbalk ---------- */
#bottom-nav.k54p .k54-pill{position:absolute;left:0;top:0;width:0;height:0;z-index:0;border-radius:22px;background:var(--tint);pointer-events:none;opacity:0;transition:opacity .2s}
body[data-dark="1"] #bottom-nav.k54p .k54-pill{background:var(--tint)}
#bottom-nav.k54p .k54-pill.on{opacity:1}
#bottom-nav.k54p > .nav-btn,#bottom-nav.k54p > .nav-action,#bottom-nav.k54p > .nav-fab{z-index:1}
#bottom-nav.kn.k54p .nav-btn.active,#bottom-nav.kn.k52n.k52n.k54p .nav-btn.active,#bottom-nav.kn.k52n.k52n.k54p .kn-me.active{background:transparent !important}
#bottom-nav.k54p .nav-btn::before{display:none !important}
#bottom-nav.k54p .k54-hop .kn-ic,#bottom-nav.k54p .k54-hop .kn-av,#bottom-nav.k54p .k54-hop > [data-icon]{animation:k54Hop .5s cubic-bezier(.3,1.5,.5,1)}
@keyframes k54Hop{0%{translate:0 0;scale:1}35%{translate:0 -5px;scale:1.08}70%{translate:0 1px;scale:.97}100%{translate:0 0;scale:1}}
#bottom-nav.k54p .kn-ind{display:none}

/* ---------- 2. badge ---------- */
.nav-badge.k54-in{animation:k54BIn .45s cubic-bezier(.3,1.6,.5,1) both}
.nav-badge.k54-bump,.unread-badge.k54-bump{animation:k54Bump .45s cubic-bezier(.3,1.6,.5,1)}
.nav-badge.k54-out{animation:k54BOut .22s ease-in forwards}
@keyframes k54BIn{0%{scale:0}60%{scale:1.2}100%{scale:1}}
@keyframes k54Bump{0%{scale:1;translate:0 0}35%{scale:1.25;translate:0 -3px}70%{scale:.95;translate:0 0}100%{scale:1}}
@keyframes k54BOut{to{scale:0;opacity:0}}

/* ---------- 3. sheets ---------- */
.sheet-body{transition:transform .55s cubic-bezier(.16,1,.3,1)}
.sheet:not(.open) .sheet-body{transition-duration:.3s;transition-timing-function:cubic-bezier(.5,0,.75,0)}
.sheet.k54-in:not(#chat-thread-sheet) .sheet-body > :not(.sheet-handle){animation:k54SIn .5s cubic-bezier(.16,1,.3,1) backwards}
.sheet.k54-in .sheet-body > :nth-child(2){animation-delay:.06s}
.sheet.k54-in .sheet-body > :nth-child(3){animation-delay:.11s}
.sheet.k54-in .sheet-body > :nth-child(4){animation-delay:.16s}
.sheet.k54-in .sheet-body > :nth-child(5){animation-delay:.2s}
.sheet.k54-in .sheet-body > :nth-child(n+6){animation-delay:.24s}
.sheet.k54-in .sheet-handle{animation:k54Handle .6s cubic-bezier(.3,1.4,.5,1) .15s}
@keyframes k54SIn{from{opacity:0;translate:0 16px}}
@keyframes k54Handle{0%,100%{width:38px}40%{width:56px}}
@media (min-width:960px){
  .sheet-body{transform:translateY(22px) scale(.96);opacity:0;transition:transform .5s cubic-bezier(.16,1,.3,1),opacity .25s ease}
  .sheet:not(.open) .sheet-body{transform:translateY(12px) scale(.98);transition:transform .22s ease-in,opacity .18s ease-in}
  .sheet.open .sheet-body{transform:none;opacity:1}
}

/* ---------- 4. banscherm ---------- */
#ban-screen{--bn-c:#C92A2A;--bn-bg:#FBF5EE}
#ban-screen.temp{--bn-c:#E8742C;--bn-bg:#FFF4E6}
body[data-dark="1"] #ban-screen{--bn-c:#FF6B6B;--bn-bg:#22160F}
body[data-dark="1"] #ban-screen.temp{--bn-c:#FF9F4A;--bn-bg:#1E150D}
#ban-screen .ban-wrap{position:relative;z-index:1;width:100%}
.bn-sea{position:fixed;left:0;right:0;bottom:0;height:120px;pointer-events:none;z-index:0}
.bn-sea i{position:absolute;left:0;right:0;bottom:0;background:var(--c);transform:translateY(105%)}
.bn-sea i::before{content:"";position:absolute;left:0;top:-22px;width:200%;height:24px;background:var(--c);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 390 24' preserveAspectRatio='none'%3E%3Cpath d='M0 24V12Q48 0 97 12T195 12T292 12T390 12V24Z'/%3E%3C/svg%3E") 0 0/50% 100% repeat-x;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 390 24' preserveAspectRatio='none'%3E%3Cpath d='M0 24V12Q48 0 97 12T195 12T292 12T390 12V24Z'/%3E%3C/svg%3E") 0 0/50% 100% repeat-x;
  animation:kl3Wave var(--s) linear infinite}
.bn-sea i.s1{top:0;--c:color-mix(in srgb,var(--bn-c) 10%,var(--bn-bg));--s:5s}
.bn-sea i.s2{top:34%;--c:color-mix(in srgb,var(--bn-c) 18%,var(--bn-bg));--s:3.8s}
.bn-sea i.s2::before{animation-direction:reverse}
.bn-sea i.s3{top:66%;--c:color-mix(in srgb,var(--bn-c) 28%,var(--bn-bg));--s:2.8s}
#ban-screen.play .bn-sea i{animation:kl3Rise 1.2s cubic-bezier(.45,.05,.3,1) forwards}
#ban-screen.play .bn-sea i.s2{animation-delay:.15s}
#ban-screen.play .bn-sea i.s3{animation-delay:.3s}
#ban-screen .bn-view{padding-bottom:calc(env(safe-area-inset-bottom,0px) + 40px)}

/* icoon: ploft erin, bij een ban schudt het "nee", bij een pauze schommelt het rustig */
#ban-screen.play .bn-hero .bn-ico{animation:k54Pop .6s cubic-bezier(.3,1.5,.5,1) .1s both,k54No .5s ease-in-out .75s}
#ban-screen.play.temp .bn-hero .bn-ico{animation:k54Pop .6s cubic-bezier(.3,1.5,.5,1) .1s both,k54Swing 2.6s ease-in-out .8s infinite}
#ban-screen.play .bn-tag{animation:k54Pop .5s cubic-bezier(.3,1.5,.5,1) .35s both}
@keyframes k54Pop{0%{scale:.3;opacity:0}60%{scale:1.08;opacity:1}100%{scale:1}}
@keyframes k54No{0%,100%{rotate:0deg}20%{rotate:-9deg}40%{rotate:8deg}60%{rotate:-5deg}80%{rotate:3deg}}
@keyframes k54Swing{0%,100%{rotate:-5deg}50%{rotate:5deg}}

/* aftellen: een cijfer dat verandert schuift omhoog */
.bn-boxes b.k54-tick{animation:k54Tick .45s cubic-bezier(.3,1.3,.5,1)}
@keyframes k54Tick{0%{translate:0 60%;opacity:0}100%{translate:0 0;opacity:1}}

/* balk van de schorsing: drie golvende lagen, net als de onderhoudsbalk */
.bn-bar{height:20px;border-radius:10px;position:relative}
.bn-bar i{position:relative;overflow:hidden;border-radius:10px;background:none !important;transition:width 1.2s cubic-bezier(.45,.05,.3,1)}
#ban-screen.play .bn-bar i{animation:mtxGrow 1.4s cubic-bezier(.45,.05,.3,1) .3s both}
.bn-bar i b{position:absolute;left:-40px;bottom:0;width:calc(100% + 80px);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 20' preserveAspectRatio='none'%3E%3Cpath d='M0 5Q10 0 20 5T40 5V20H0Z'/%3E%3C/svg%3E") 0 0/40px 100% repeat-x;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 20' preserveAspectRatio='none'%3E%3Cpath d='M0 5Q10 0 20 5T40 5V20H0Z'/%3E%3C/svg%3E") 0 0/40px 100% repeat-x;
  animation:mtxBWave var(--s) linear infinite}
.bn-bar i b.w1{top:0;background:color-mix(in srgb,var(--bn-c) 30%,var(--bn-bg));--s:2.6s}
.bn-bar i b.w2{top:26%;background:color-mix(in srgb,var(--bn-c) 62%,var(--bn-bg));--s:1.9s;animation-direction:reverse}
.bn-bar i b.w3{top:52%;background:var(--bn-c);--s:1.4s}
body[data-dark="1"] .bn-bar{background:#3F2C1F}

/* wisselen tussen het banscherm en het bezwaarformulier: schuift opzij */
.bn-view.k54-r{animation:k54R .4s cubic-bezier(.16,1,.3,1)}
.bn-view.k54-l{animation:k54L .4s cubic-bezier(.16,1,.3,1)}
@keyframes k54R{from{opacity:0;translate:40px 0}}
@keyframes k54L{from{opacity:0;translate:-40px 0}}
.bn-btn{transition:scale .2s cubic-bezier(.3,1.5,.5,1)}
.bn-btn:active{transform:none;scale:.96}
.bn-choices label{transition:box-shadow .2s,scale .2s cubic-bezier(.3,1.5,.5,1)}
.bn-choices label:active{scale:.98}

/* ---------- 5. Slides ---------- */
.sl.k54-rv{transition:none !important;animation:k54Reveal .55s cubic-bezier(.65,0,.35,1)}
.sl.k54-cl{opacity:1 !important;visibility:visible !important;transition:none !important;animation:k54Hide .42s cubic-bezier(.65,0,.35,1) forwards;pointer-events:none}
@keyframes k54Reveal{from{clip-path:circle(0px at var(--k54x,50%) var(--k54y,90%))}to{clip-path:circle(150vmax at var(--k54x,50%) var(--k54y,90%))}}
@keyframes k54Hide{from{clip-path:circle(150vmax at var(--k54x,50%) var(--k54y,90%))}to{clip-path:circle(0px at var(--k54x,50%) var(--k54y,90%))}}
.sl.k54-rv .sl-top{animation:k54Down .5s cubic-bezier(.16,1,.3,1) .22s backwards}
@keyframes k54Down{from{opacity:0;translate:0 -14px}}

@media (prefers-reduced-motion:reduce){
  #bottom-nav.k54p .k54-pill{transition:none}
  .nav-badge,.unread-badge,.sheet-body > *,.sheet-handle,.bn-sea i,.bn-sea i::before,.bn-ico,.bn-tag,.bn-boxes b,.bn-bar i,.bn-bar i b,.bn-view{animation:none !important}
  .bn-sea i{transform:none}
}
