/* --- Premium Stacking Toast System --- */
#premium-toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 99999;
    /* Elevated above almost everything */
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    pointer-events: none;
    max-width: 400px;
    width: 100%;
}

@media (max-width: 640px) {
    #premium-toast-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        width: auto;
        max-width: none;
    }
}

.premium-toast {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 1.5rem;
    padding: 1.125rem 1.25rem;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 20px 25px -5px rgba(0, 0, 0, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 1.125rem;
    position: relative;
    overflow: hidden;
    animation: toast-spring-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-toast:hover {
    transform: translateY(-2px) scale(1.01);
    background: rgba(255, 255, 255, 0.9);
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.08),
        0 25px 30px -5px rgba(0, 0, 0, 0.12),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.premium-toast-close {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-left: 0.5rem;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.premium-toast-close:hover {
    background: #f1f5f9;
    color: #1e293b;
    transform: scale(1.05); /* Added a very subtle scale instead of rotation */
}

.premium-toast.hiding {
    animation: toast-slide-out 0.4s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes toast-spring-in {
    0% {
        transform: translateX(120%) scale(0.9);
        opacity: 0;
    }

    60% {
        transform: translateX(-5%) scale(1.02);
    }

    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes toast-slide-out {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }

    to {
        transform: translateX(120%) scale(0.9);
        opacity: 0;
    }
}

.premium-toast-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.35rem;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    animation: icon-pop 0.5s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes icon-pop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.premium-toast-content {
    flex: 1;
    min-width: 0;
}

.premium-toast-title {
    font-size: 0.875rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.125rem;
    letter-spacing: -0.01em;
}

.premium-toast-message {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    line-height: 1.5;
    word-break: break-word;
}

.premium-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.08);
    width: 100%;
    transform-origin: left;
    border-radius: 0 2px 2px 0;
}

/* --- Type Styles with Premium Gradients --- */

/* Success */
.premium-toast-success .premium-toast-icon {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.1);
}

.premium-toast-success .premium-toast-progress {
    background: linear-gradient(to right, #34d399, #10b981);
}

/* Error */
.premium-toast-error .premium-toast-icon {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.1);
}

.premium-toast-error .premium-toast-progress {
    background: linear-gradient(to right, #f87171, #ef4444);
}

/* Warning */
.premium-toast-warning .premium-toast-icon {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.1);
}

.premium-toast-warning .premium-toast-progress {
    background: linear-gradient(to right, #fbbf24, #f59e0b);
}

/* Info */
.premium-toast-info .premium-toast-icon {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.premium-toast-info .premium-toast-progress {
    background: linear-gradient(to right, #60a5fa, #3b82f6);
}
