/* ToastContainer.razor.css */

/* Container die de toasts vasthoudt */
.toast-container {
    z-index: 1090;
    position: fixed; /* Verander van absolute naar fixed */
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem; /* ruimte tussen toasts */
    max-width: 400px;
    pointer-events: none;
}

/* Stijl voor elk individueel toast-element */
.toast-item {
    pointer-events: auto; /* zorg dat clicks werken op toast zelf */
    position: relative;
    width: 100%;
    font-size: 0.875rem;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
    transition: all 0.3s ease-in-out;
    opacity: 1;
    animation: slideIn 0.5s ease;
}

/* Header binnen een toast */
.toast-item .toast-header {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: #6c757d; /* Default header tekstkleur (grijs) */
    background-color: rgba(255, 255, 255, 0.85); /* Match toast achtergrond of maak lichter/donkerder */
    background-clip: padding-box;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05); /* Subtiele lijn tussen header en body */
    border-top-left-radius: calc(0.375rem - 1px); /* Match toast afronding (var(--bs-border-radius) - var(--bs-border-width)) */
    border-top-right-radius: calc(0.375rem - 1px);
}

.toast-item .toast-header strong {
    margin-right: auto; /* Duwt de knop naar rechts */
    font-weight: bold;
}

/* Close knop specifiek binnen de header */
.toast-item .toast-header .btn-close {
    /* Basis stijl voor de knop */
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: 0.25em 0.25em;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: 0.25rem;
    opacity: 0.5;
    cursor: pointer;
    margin-left: 0.75rem;
}
.toast-item .toast-header .btn-close:hover {
    opacity: 0.75;
}
/* Zorg dat de knop focus krijgt */
.toast-item .toast-header .btn-close:focus {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25); /* Voorbeeld focus ring */
    opacity: 1;
}


/* Body binnen een toast */
.toast-item .toast-body {
    padding: 0.75rem;
    color: #212529; /* Default body tekstkleur (donkergrijs/zwart) */
    word-wrap: break-word; /* Zorg dat lange woorden afbreken */
}

/* --- Styling per ToastLevel --- */

/* Error / Danger */
.toast-item.toast-error {
    background-color: #f8d7da; /* Lichtrode achtergrond */
    border-color: #f5c6cb;
}
.toast-item.toast-error .toast-header {
    color: #58151c; /* Donkerrode tekst */
    background-color: #f1aeb5; /* Iets donkerdere header */
    border-bottom-color: #e99da6;
}
.toast-item.toast-error .toast-header .btn-close {
    /* Filter kan nodig zijn als SVG default wit is */
    /* filter: unset; */
}
.toast-item.toast-error .toast-body {
    color: #58151c; /* Donkerrode body tekst */
}

/* Warning */
.toast-item.toast-warning,
.toast-warning.toast-item {
    background-color: #fff9c2;
    color: #3a2c00;
}

.toast-item.toast-warning .toast-header {
    background-color: #fde68a;
    color: #3e2e00;
    border-bottom-color: #ffde80;
}
.toast-item.toast-warning .toast-header .btn-close {
    /* Standaard donkere close knop is hier OK */
}
.toast-item.toast-warning .toast-body {
    color: #664d03;
}

/* Success */
.toast-item.toast-success {
    background-color: #d1e7dd; /* Lichtgroene achtergrond */
    border-color: #badbcc;
}
.toast-item.toast-success .toast-header {
    color: #0a3622; /* Donkergroene tekst */
    background-color: #a3cfbb; /* Iets donkerdere header */
    border-bottom-color: #96c5ae;
}
.toast-item.toast-success .toast-header .btn-close {
    /* Filter kan nodig zijn als SVG default wit is */
}
.toast-item.toast-success .toast-body {
    color: #0a3622; /* Donkergroene body tekst */
}

/* Info */
.toast-item.toast-info {
    background-color: #cff4fc; /* Lichtblauwe achtergrond */
    border-color: #b6effb;
}
.toast-item.toast-info .toast-header {
    color: #055160; /* Donkerblauwe tekst */
    background-color: #9eeaf9; /* Iets donkerdere header */
    border-bottom-color: #8ee5f8;
}
.toast-item.toast-info .toast-header .btn-close {
    /* Filter kan nodig zijn als SVG default wit is */
}
.toast-item.toast-info .toast-body {
    color: #055160; /* Donkerblauwe body tekst */
}

/* Optioneel: Zorg dat de close knop donker is op lichte achtergronden en licht op donkere */
/* Dit is een beetje een gok zonder filter, afhankelijk van de SVG kleur */
.toast-item.toast-warning .toast-header .btn-close,
.toast-item.toast-info .toast-header .btn-close {
    /* Als je SVG zwart is, is dit OK */
}
.toast-item.toast-error .toast-header .btn-close,
.toast-item.toast-success .toast-header .btn-close {
    /* Als je SVG zwart is, moet je hem wit maken, bv met filter */
    /* filter: invert(1) grayscale(100%) brightness(200%); */
    /* Of gebruik een andere SVG voor de close knop */
}


@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}