/*
 * Toast Notify — global "Laravel Notify"-style toast notifications.
 * Cards slide in from the top-right, auto-dismiss with a shrinking
 * progress bar, and pause on hover. Used app-wide via session-messages.blade.php
 * and window.ToastNotify.show(type, message, title).
 */

.toast-notify-container {
    position: fixed;
    top: 88px;
    right: 20px;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

@media (max-width: 576px) {
    .toast-notify-container {
        top: auto;
        bottom: 16px;
        right: 16px;
        left: 16px;
        width: auto;
    }
}

.toast-notify-item {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #ffffff;
    border-radius: 12px;
    padding: 14px 16px 16px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(2, 8, 23, 0.05),
        0 8px 16px -4px rgba(2, 8, 23, 0.12),
        0 20px 40px -12px rgba(2, 8, 23, 0.18);
    border-left: 4px solid var(--toast-accent, #0d6efd);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.38s cubic-bezier(0.21, 1.02, 0.47, 1), opacity 0.3s ease;
}

.toast-notify-item.toast-notify-in {
    transform: translateX(0);
    opacity: 1;
}

.toast-notify-item.toast-notify-out {
    transform: translateX(120%);
    opacity: 0;
}

@media (max-width: 576px) {
    .toast-notify-item {
        transform: translateY(120%);
    }
    .toast-notify-item.toast-notify-in {
        transform: translateY(0);
    }
    .toast-notify-item.toast-notify-out {
        transform: translateY(120%);
    }
}

.toast-notify-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.05rem;
    background: var(--toast-accent-soft, rgba(13, 110, 253, 0.12));
    color: var(--toast-accent, #0d6efd);
}

.toast-notify-body {
    flex: 1;
    min-width: 0;
    padding-right: 18px;
}

.toast-notify-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: #1a1a2e;
    margin-bottom: 2px;
}

.toast-notify-message {
    font-size: 0.85rem;
    color: #5b6472;
    line-height: 1.4;
    word-break: break-word;
}

.toast-notify-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: transparent;
    color: #adb5bd;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    line-height: 1;
    transition: background-color 0.18s ease, color 0.18s ease;
    cursor: pointer;
}

.toast-notify-close:hover {
    background: #f1f3f5;
    color: #495057;
}

.toast-notify-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--toast-accent, #0d6efd);
    opacity: 0.35;
    transform-origin: left;
    animation: toast-notify-shrink linear forwards;
    animation-duration: var(--toast-duration, 5000ms);
}

.toast-notify-item:hover .toast-notify-progress {
    animation-play-state: paused;
}

@keyframes toast-notify-shrink {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* Type accents */
.toast-notify-success {
    --toast-accent: #198754;
    --toast-accent-soft: rgba(25, 135, 84, 0.12);
}

.toast-notify-error {
    --toast-accent: #dc3545;
    --toast-accent-soft: rgba(220, 53, 69, 0.12);
}

.toast-notify-warning {
    --toast-accent: #f0ad16;
    --toast-accent-soft: rgba(240, 173, 22, 0.16);
}

.toast-notify-info {
    --toast-accent: #0d6efd;
    --toast-accent-soft: rgba(13, 110, 253, 0.12);
}

@media (prefers-reduced-motion: reduce) {
    .toast-notify-item,
    .toast-notify-progress {
        transition: none;
        animation: none;
    }
}
