/* ============================================
   Custom Toast System — Velzon theme aligned
   ============================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    min-width: 320px;
    max-width: 420px;
    background: var(--vz-card-bg-custom, #fff);
    color: var(--vz-body-color, #212529);
    border-radius: 8px;
    border: 1px solid var(--vz-border-color, #e9ebec);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 450;
    line-height: 1.45;
    overflow: hidden;
    transform: translateY(-12px) scale(0.97);
    opacity: 0;
    animation: toast-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    cursor: pointer;
    transition: box-shadow 0.2s ease;
    will-change: transform, opacity;
}

.toast-item:hover {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
}

.toast-item.toast-dismissing {
    animation: toast-out 0.28s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* Icons */
.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon svg {
    width: 20px;
    height: 20px;
}

/* Message */
.toast-message {
    flex: 1;
    word-break: break-word;
}

/* Close button */
.toast-close {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--vz-body-color, #878a99);
    opacity: 0.4;
    cursor: pointer;
    border-radius: 4px;
    padding: 0;
    transition: opacity 0.15s, background 0.15s;
    font-size: 16px;
    line-height: 1;
}

.toast-close:hover {
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.05);
}

/* Progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.toast-progress-bar {
    height: 100%;
    animation: toast-progress linear forwards;
    transform-origin: left;
}

/* ---- Type variants ---- */

/* Success — Velzon green #0ab39c */
.toast-item.toast-success {
    border-left: 3px solid #0ab39c;
}
.toast-success .toast-icon { color: #0ab39c; }
.toast-success .toast-progress-bar { background: #0ab39c; }

/* Error — Velzon red #f06548 */
.toast-item.toast-error {
    border-left: 3px solid #f06548;
}
.toast-error .toast-icon { color: #f06548; }
.toast-error .toast-progress-bar { background: #f06548; }

/* Warning — Velzon yellow #f7b84b */
.toast-item.toast-warning {
    border-left: 3px solid #f7b84b;
}
.toast-warning .toast-icon { color: #f7b84b; }
.toast-warning .toast-progress-bar { background: #f7b84b; }

/* Info — Velzon blue #299cdb */
.toast-item.toast-info {
    border-left: 3px solid #299cdb;
}
.toast-info .toast-icon { color: #299cdb; }
.toast-info .toast-progress-bar { background: #299cdb; }

/* Animations */
@keyframes toast-in {
    0% {
        transform: translateY(-12px) scale(0.97);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes toast-out {
    0% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateX(120%) scale(0.97);
        opacity: 0;
    }
}

@keyframes toast-progress {
    0% { transform: scaleX(1); }
    100% { transform: scaleX(0); }
}

/* Mobile */
@media (max-width: 480px) {
    .toast-container {
        top: 70px;
        right: 12px;
        left: 12px;
    }

    .toast-item {
        min-width: unset;
        max-width: unset;
        width: 100%;
    }
}
