/**
 * Kopita Global Stackable Toast Snackbar
 * Minimalist, ultra-smooth, compact, semibold title, stretched design
 */

#globalToastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 420px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}

.global-toast {
    pointer-events: auto;
    width: 100%;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 10px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 6px 20px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    overflow: hidden;
    position: relative;
    animation: globalToastSlideIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-family-sans);
    will-change: transform, opacity;
}

.global-toast.toast-hiding {
    animation: globalToastSlideOut 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

.global-toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 12px;
}

.global-toast-icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    max-width: 30px;
    max-height: 30px;
    border-radius: 8px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
    flex-shrink: 0;
}

.global-toast-body {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 4px;
}

.global-toast-title {
    font-size: 0.86rem;
    font-weight: 600; /* Semibold as requested */
    color: #0F172A;
    margin: 0 0 1px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.global-toast-desc {
    font-size: 0.78rem;
    font-weight: 400;
    color: #64748B;
    margin: 0;
    line-height: 1.4;
    word-break: break-word;
}

.global-toast-close {
    background: transparent;
    border: none;
    color: #94A3B8;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 6px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.global-toast-close:hover {
    color: #0F172A;
    background: rgba(0, 0, 0, 0.05);
}

.global-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2.5px;
    width: 100%;
    animation: globalToastProgress linear forwards;
    transform-origin: left;
}

.global-toast:hover .global-toast-progress {
    animation-play-state: paused;
}

/* Minimalist Type Styles */
.global-toast-success .global-toast-icon {
    background: #ECFDF5;
    color: #059669;
}
.global-toast-success .global-toast-progress {
    background: linear-gradient(90deg, #10B981, #059669);
}

.global-toast-error .global-toast-icon,
.global-toast-danger .global-toast-icon {
    background: #FEF2F2;
    color: #DC2626;
}
.global-toast-error .global-toast-progress,
.global-toast-danger .global-toast-progress {
    background: linear-gradient(90deg, #EF4444, #DC2626);
}

.global-toast-warning .global-toast-icon {
    background: #FFFBEB;
    color: #D97706;
}
.global-toast-warning .global-toast-progress {
    background: linear-gradient(90deg, #F59E0B, #D97706);
}

.global-toast-info .global-toast-icon {
    background: #EFF6FF;
    color: #2563EB;
}
.global-toast-info .global-toast-progress {
    background: linear-gradient(90deg, #3B82F6, #2563EB);
}

.global-toast-pos .global-toast-icon {
    background: rgba(236, 24, 112, 0.08);
    color: #EC1870;
}
.global-toast-pos .global-toast-progress {
    background: linear-gradient(90deg, #FF3B8D, #EC1870);
}

/* Silky Smooth Animations */
@keyframes globalToastSlideIn {
    0% {
        opacity: 0;
        transform: translate3d(24px, 0, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes globalToastSlideOut {
    0% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
        max-height: 80px;
        margin-bottom: 0;
    }
    100% {
        opacity: 0;
        transform: translate3d(20px, 0, 0);
        max-height: 0;
        margin-bottom: -8px;
        padding-top: 0;
        padding-bottom: 0;
    }
}

@keyframes globalToastProgress {
    0% {
        width: 100%;
    }
    100% {
        width: 0%;
    }
}
