/**
 * notification.js | notification.css
 *
 * Diese Datei enthält die Funktion `showNotification`, die verwendet werden kann, um Benachrichtigungen
 * auf einer Webseite anzuzeigen. Um diese Funktion in einer PHP- oder HTML-Datei zu verwenden, folgen Sie
 * bitte der nachstehenden Anleitung:
 *
 * Anleitung zur Verwendung:
 *
 * 1. Binden Sie die `notification.js` in Ihre HTML-Datei direkt vor dem schließenden </body>-Tag: ein:
 *    <script src="path/to/notification.js"></script>
 *    alternativ:
 *    <script src="<?= BASE_URL ?>assets/js/notification.js?v=<?= filemtime(BASE_PATH . 'assets/js/notification.js') ?>"></script>
 *    Stellen Sie sicher, dass der Pfad korrekt ist und die Datei nach der Definition des `notification`-Elements eingebunden wird.
 *
 * 2. Fügen Sie ein `div`-Element mit der ID `notification` in Ihren HTML-Code direkt nach dem öffnenden <body>-Tag ein:
 *    <div id="notification" class="notification"></div>
 *
 * 3. Binden Sie die `notification.css` in den <head> Ihrer HTML-Datei ein:
 *    <link rel="stylesheet" href="path/to/notification.css">
 *
 * 4. Verwenden Sie die `showNotification`-Funktion in Ihrem HTML-Code, um Benachrichtigungen anzuzeigen:
 *    Beispiele:
 *    <button onclick="showNotification('Erfolgreich kopiert!', 'success')">Erfolgsbenachrichtigung</button>
 *    <button onclick="showNotification('Fehler beim Kopieren!', 'error')">Fehlerbenachrichtigung</button>
 */

.toast {
    display: none;
    position: fixed;
    top: -50px; /* Start above the viewport */
    left: 50%;
    transform: translateX(-50%);
    background-color: #f8d7da; /* light red background */
    color: #721c24; /* dark red text */
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    width: 600px; /* Adjust width as needed */
    text-align: left;
    text-wrap: break-word;
}

.toast.success {
    background-color: #d4edda; /* light green background */
    color: #155724; /* dark green text */
}

.toast.fadeIn {
    animation: fadeIn 0.5s forwards;
}

.toast.fadeOut {
    animation: fadeOut 0.5s forwards;
}

.btn-close {
    --bs-btn-close-color: #000;
    --bs-btn-close-bg: 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 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
    --bs-btn-close-opacity: .5;
    --bs-btn-close-hover-opacity: .75;
    --bs-btn-close-focus-shadow: 0 0 0 .25rem rgba(13,110,253,0.25);
    --bs-btn-close-focus-opacity: 1;
    --bs-btn-close-disabled-opacity: .25;
    --bs-btn-close-white-filter: invert(1) grayscale(100%) brightness(200%);
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: .25em .25em;
    color: var(--bs-btn-close-color);
    background: transparent var(--bs-btn-close-bg) center/1em auto no-repeat;
    border: 0;
    border-radius: .375rem;
    opacity: var(--bs-btn-close-opacity)
}

@keyframes fadeIn {
    0% {
        top: -50px;
        opacity: 0;
    }

    100% {
        top: 100px;
        opacity: 1;
    }
}

@keyframes fadeOut {
    0% {
        top: 100px;
        opacity: 1;
    }
    
    100% {
        top: -50px;
        opacity: 0;
        visibility: hidden;
    }
}