/* Slimpie chat-app · schoolschrift-stijl */

:root {
    --papier: #FBF7EC;
    --inkt: #2B2B33;
    --groen: #2E7D5B;
    --groen-donker: #256A4C;
    --rood: #E4593C;
    --rood-donker: #B8432C;
    --geel: #FFD34D;
    --lijnblauw: #B8D2E6;
    --wit: #FFFEFA;
}

* {
    box-sizing: border-box;
    margin: 0;
}

body {
    font-family: 'Nunito', sans-serif;
    color: var(--inkt);
    background: var(--papier);
}

.app {
    display: flex;
    height: 100vh;
    height: 100dvh;
}

/* ============ Zijbalk ============ */

.sidebar {
    width: 290px;
    background: var(--groen);
    color: var(--papier);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 14px;
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--papier);
    text-decoration: none;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 20px;
    padding: 2px 6px;
}

.btn-nieuw {
    background: var(--geel);
    color: var(--inkt);
    border: 2px solid var(--inkt);
    border-radius: 12px;
    padding: 12px 16px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 3px 0 rgb(43 43 51 / 35%);
}

.sidebar-label {
    font-family: 'Caveat', cursive;
    font-size: 22px;
    opacity: 0.85;
    padding-left: 6px;
}

.chatlijst {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chatlijst-leeg {
    padding: 10px;
    font-weight: 600;
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.5;
}

.chatitem-rij {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chatitem {
    flex: 1;
    text-align: left;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    color: var(--papier);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.chatitem:hover {
    border-color: rgb(251 247 236 / 40%);
}

.chatitem.actief {
    background: rgb(251 247 236 / 14%);
    border-color: rgb(251 247 236 / 50%);
}

.chatitem-titel {
    font-weight: 700;
    font-size: 14.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chatitem-meta {
    font-size: 12px;
    opacity: 0.75;
}

.chatitem-verwijder {
    background: none;
    border: none;
    color: var(--papier);
    opacity: 0.6;
    cursor: pointer;
    font-size: 15px;
    padding: 6px;
}

.sidebar-voet {
    font-size: 12.5px;
    font-weight: 600;
    opacity: 0.75;
    line-height: 1.5;
    padding: 0 6px;
}

.sidebar-terug {
    color: var(--papier);
    opacity: 0.85;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    padding-left: 6px;
}

/* ============ Hoofdgedeelte ============ */

.hoofd {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbalk {
    background: var(--wit);
    border-bottom: 3px solid var(--inkt);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.topbalk-links {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.btn-menu {
    display: none;
    background: none;
    border: 2px solid var(--inkt);
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 16px;
}

.chat-titel {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 17px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.groep-keuze {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    opacity: 0.9;
}

.groepknop {
    border: 2px solid var(--inkt);
    background: var(--wit);
    border-radius: 10px;
    padding: 3px 10px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.groepknop.actief {
    background: var(--groen);
    color: var(--papier);
    border-color: var(--groen);
}

/* ============ Berichten op ruitjespapier ============ */

.ruit {
    background-image:
        linear-gradient(var(--lijnblauw) 1px, transparent 1px),
        linear-gradient(90deg, var(--lijnblauw) 1px, transparent 1px);
    background-size: 26px 26px;
    background-color: var(--wit);
}

.kantlijn {
    position: relative;
}

.kantlijn::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 44px;
    width: 2px;
    background: var(--rood);
    opacity: 0.55;
}

.berichten {
    flex: 1;
    overflow-y: auto;
    padding: 24px 24px 16px 64px;
}

.berichten-binnen {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bericht {
    display: flex;
}

.bericht.user {
    justify-content: flex-end;
}

.bericht.assistant {
    justify-content: flex-start;
    align-items: flex-end;
    gap: 8px;
}

.bericht-avatar {
    flex-shrink: 0;
}

.ballon {
    max-width: 78%;
    padding: 10px 14px;
    font-size: 15.5px;
    line-height: 1.55;
    font-weight: 600;
    background: var(--papier);
    border: 2px solid var(--inkt);
    border-radius: 14px 14px 14px 4px;
    box-shadow: 3px 3px 0 rgb(43 43 51 / 12%);
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

.bericht.user .ballon {
    background: var(--geel);
    font-weight: 700;
    border-radius: 14px 14px 4px 14px;
}

.ballon.denken {
    font-family: 'Caveat', cursive;
    font-size: 19px;
}

.bubbel {
    animation: pop 0.25s ease-out;
}

@keyframes pop {
    from {
        transform: translateY(6px);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bubbel {
        animation: none;
    }
}

.leeg-staat {
    text-align: center;
    margin-top: 60px;
}

.leeg-staat h2 {
    font-family: 'Fredoka', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin-top: 16px;
}

.leeg-staat p {
    font-weight: 600;
    font-size: 16px;
    margin-top: 8px;
}

/* ============ Invoerbalk ============ */

.invoerbalk {
    background: rgb(251 247 236 / 95%);
    border-top: 2px dashed var(--lijnblauw);
    padding: 12px 20px 16px;
}

.invoer-binnen {
    max-width: 760px;
    margin: 0 auto;
}

.voorbeelden {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.voorbeelden:empty {
    margin-bottom: 0;
}

.chip {
    border: 2px dashed var(--groen);
    background: transparent;
    color: var(--groen);
    border-radius: 999px;
    padding: 7px 14px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.chip:hover {
    background: var(--groen);
    color: var(--papier);
}

.invoer-rij {
    display: flex;
    gap: 10px;
}

.invoer-rij input {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    border: 2px solid var(--inkt);
    border-radius: 12px;
    background: var(--wit);
}

.btn-stuur {
    background: var(--rood);
    color: var(--papier);
    border: none;
    border-radius: 12px;
    padding: 0 22px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 3px 0 var(--rood-donker);
}

.invoer-voet {
    font-size: 12.5px;
    margin-top: 8px;
    opacity: 0.65;
    font-weight: 600;
    text-align: center;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px solid var(--groen);
    outline-offset: 2px;
}

/* ============ Mobiel ============ */

@media (max-width: 900px) {
    .btn-menu {
        display: inline-block;
    }

    .sidebar {
        display: none;
    }

    .sidebar.open {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 50;
        width: 100%;
    }
}

/* ============ PWA installatiebanner ============ */

.installeer-banner:not([hidden]) {
    display: flex;
}

.installeer-banner {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 100;
    align-items: center;
    gap: 12px;
    background: var(--wit);
    border: 3px solid var(--inkt);
    border-radius: 16px;
    box-shadow: 6px 6px 0 rgb(43 43 51 / 15%);
    padding: 12px 16px;
    font-weight: 700;
    font-size: 15px;
    max-width: calc(100vw - 32px);
}

.installeer-banner .btn-stuur {
    padding: 8px 16px;
    font-size: 14px;
}

.installeer-banner #btn-installeer-weg {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.6;
    padding: 4px;
}

/* ============ Kind-switcher (simpele lijst, geen profielkiezer) ============ */

.kind-switcher label {
    display: block;
    font-family: 'Caveat', cursive;
    font-size: 20px;
    opacity: 0.85;
    padding-left: 6px;
    margin-bottom: 4px;
}

.kind-switcher select {
    width: 100%;
    padding: 10px 12px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 15px;
    border: 2px solid var(--inkt);
    border-radius: 12px;
    background: var(--wit);
    color: var(--inkt);
}

button.sidebar-terug {
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
}
