/* School Insight ERP — 3D Toast Notifications */

.si-toast-stack {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(380px, calc(100vw - 2rem));
    pointer-events: none;
}

.si-toast {
    pointer-events: auto;
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 1rem 1rem 1rem 0.9rem;
    border-radius: 16px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95));
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow:
        0 18px 40px rgba(15, 23, 42, 0.14),
        0 4px 10px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translate3d(120%, 0, 0) rotateY(-12deg) scale(0.92);
    opacity: 0;
    transform-origin: right center;
    transition:
        transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.35s ease;
    overflow: hidden;
    position: relative;
}

.si-toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 16px 0 0 16px;
}

.si-toast.is-visible {
    transform: translate3d(0, 0, 0) rotateY(0deg) scale(1);
    opacity: 1;
}

.si-toast.is-hiding {
    transform: translate3d(110%, -8px, 0) rotateY(-8deg) scale(0.96);
    opacity: 0;
}

.si-toast-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow:
        0 10px 18px rgba(15, 23, 42, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transform: translateZ(12px);
}

.si-toast-body {
    min-width: 0;
    padding-top: 0.1rem;
}

.si-toast-title {
    margin: 0 0 0.2rem;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.25;
}

.si-toast-message {
    margin: 0;
    font-size: 0.84rem;
    color: #64748B;
    line-height: 1.45;
}

.si-toast-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: #F1F5F9;
    color: #64748B;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: 0.2s ease;
    flex-shrink: 0;
}

.si-toast-close:hover {
    background: #E2E8F0;
    color: #0F172A;
}

.si-toast-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(15, 23, 42, 0.06);
}

.si-toast-progress > span {
    display: block;
    height: 100%;
    width: 100%;
    transform-origin: left center;
    animation: siToastProgress linear forwards;
}

/* Types */
.si-toast--success::before { background: #16A34A; }
.si-toast--success .si-toast-icon {
    background: linear-gradient(145deg, #4ADE80, #16A34A);
}
.si-toast--success .si-toast-progress > span { background: #16A34A; }

.si-toast--error::before,
.si-toast--warning::before { background: #EA580C; }
.si-toast--error .si-toast-icon,
.si-toast--warning .si-toast-icon {
    background: linear-gradient(145deg, #FB923C, #EA580C);
}
.si-toast--error .si-toast-progress > span,
.si-toast--warning .si-toast-progress > span { background: #EA580C; }

.si-toast--info::before { background: #2563EB; }
.si-toast--info .si-toast-icon {
    background: linear-gradient(145deg, #60A5FA, #2563EB);
}
.si-toast--info .si-toast-progress > span { background: #2563EB; }

@keyframes siToastProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@media (max-width: 575.98px) {
    .si-toast-stack {
        top: auto;
        bottom: 1rem;
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
    }

    .si-toast {
        transform: translate3d(0, 120%, 0) scale(0.96);
    }

    .si-toast.is-visible {
        transform: translate3d(0, 0, 0) scale(1);
    }

    .si-toast.is-hiding {
        transform: translate3d(0, 40%, 0) scale(0.96);
    }
}
