/* Toast appearance */
.app-toast {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-left: 6px solid;
    border-radius: 1rem;
    min-width: min(350px, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    overflow: hidden;

    --bs-toast-bg: transparent;
    --bs-toast-color: #212529;
    --bs-toast-border-color: transparent;
    --bs-toast-box-shadow: none;
}

.app-toast .toast-body {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    font-size: 0.95rem;
}

.app-toast .toast-icon {
    font-size: 1.5rem;
}

.app-toast .toast-message {
    flex-grow: 1;
}

.app-toast .btn-close {
    --bs-btn-close-color: #6c757d;
}

.toast--success {
    border-left-color: var(--bs-success);
}

.toast--success .toast-icon {
    color: var(--bs-success);
}

.toast--danger {
    border-left-color: var(--bs-danger);
}

.toast--danger .toast-icon {
    color: var(--bs-danger);
}

.toast--warning {
    border-left-color: var(--bs-warning);
}

.toast--warning .toast-icon {
    color: var(--bs-warning);
}

.toast--info {
    border-left-color: var(--bs-info);
}

.toast--info .toast-icon {
    color: var(--bs-info);
}

/* Countdown bar */
.app-toast .toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.1);
    animation: toast-countdown 5.5s linear forwards;
}

.toast--success .toast-progress {
    background-color: var(--bs-success);
}

.toast--danger .toast-progress {
    background-color: var(--bs-danger);
}

.toast--warning .toast-progress {
    background-color: var(--bs-warning);
}

.toast--info .toast-progress {
    background-color: var(--bs-info);
}

@keyframes toast-countdown {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* Configurable toast stacks */
.toast-container-app,
.toast-stack {
    z-index: 1100;
}

.toast-stack {
    position: fixed;
    --toast-offset: 16px;
}

.toast-stack .toast {
    margin-top: 12px;
}

.toast-stack .toast:first-child {
    margin-top: 0;
}

.toast-pos-top-left {
    top: var(--toast-offset);
    left: var(--toast-offset);
}

.toast-pos-top-center {
    top: var(--toast-offset);
    left: 50%;
    transform: translateX(-50%);
}

.toast-pos-top-right {
    top: var(--toast-offset);
    right: var(--toast-offset);
}

.toast-pos-bottom-left {
    bottom: var(--toast-offset);
    left: var(--toast-offset);
}

.toast-pos-bottom-center {
    bottom: var(--toast-offset);
    left: 50%;
    transform: translateX(-50%);
}

.toast-pos-bottom-right {
    right: var(--toast-offset);
    bottom: var(--toast-offset);
}

.toast-offset-0 { --toast-offset: 0px; }
.toast-offset-4 { --toast-offset: 4px; }
.toast-offset-8 { --toast-offset: 8px; }
.toast-offset-12 { --toast-offset: 12px; }
.toast-offset-16 { --toast-offset: 16px; }
.toast-offset-20 { --toast-offset: 20px; }
.toast-offset-24 { --toast-offset: 24px; }
.toast-offset-28 { --toast-offset: 28px; }
.toast-offset-32 { --toast-offset: 32px; }
.toast-offset-36 { --toast-offset: 36px; }
.toast-offset-40 { --toast-offset: 40px; }
.toast-offset-48 { --toast-offset: 48px; }
.toast-offset-56 { --toast-offset: 56px; }
.toast-offset-64 { --toast-offset: 64px; }
