/* Mobile-first */
table, thead, tbody, th, td, tr {
    display: block;
    box-sizing: border-box;
}

thead tr {
    display: none; /* stacked view voor mobiel */
}

tbody tr {
    display: block;
    width: 100%;
    margin-bottom: 2rem;
    box-shadow: 0 .25rem 0.5rem var(--shaduw);
}

td {
    position: relative;
    padding-left: 50%;
    border: none;
    border-bottom: 1px solid #eee;
}

td::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    top: 0;
    width: 45%;
    padding-left: 0.5rem;
    font-weight: bold;
}

th {
    cursor: pointer; /* laat zien dat het klikbaar is */
    position: relative;
    user-select: none;
}

/* pijltjes toevoegen */
th::after {
    content: ''; /* standaard geen pijltje */
    position: absolute;
    right: 10px;
    font-size: 0.8em;
    border: 5px solid transparent; /* standaard driehoek verbergen */
    top: 50%;
    transform: translateY(-50%);
}

/* stijlen voor oplopend (up) */
th.sort-asc::after {
    content: '▲';
}

/* stijlen voor aflopend (down) */
th.sort-desc::after {
    content: '▼';
}

body{
    height: 100%;

}
html, body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}
p:nth-child(3){
    margin-bottom: 0;
}
@media (min-width: 921px) {
    table {
        display: table;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0 0.5rem;
        table-layout: fixed;
    }

    thead {
        display: table-header-group; /* belangrijk */
    }

    tbody {
        display: table-row-group; /* belangrijk */
    }

    thead tr, tbody tr {
        display: table-row;
    }

    td, th {
        display: table-cell;
        padding: 0.5rem 1rem;
        border: 1px solid #ddd;
        text-align: left;
        word-wrap: break-word;
    }

    td::before {
        content: none; /* mobiele labels weg */
        padding-left: 0; /* reset padding-left */
        position: static; /* reset position */
    }

    thead th:hover, tbody tr:hover{
        background-color: var(--owit);
    }

    /* Kolombreedtes */
    th.id, td.id { width: 7%; }
    th.sender, td.sender { width: 13%; }
    th.email, td.email { width: 20%; }
    th.type, td.type { width: 12%; }
    th.message, td.message { width: 40%; }
    th.date, td.date { width: 10%; }
}
