.toast-container {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.toast-container.top-right { top: 20px; right: 20px; }
.toast-container.top-left { top: 20px; left: 20px; }
.toast-container.bottom-right { bottom: 20px; right: 20px; flex-direction: column-reverse; }
.toast-container.bottom-left { bottom: 20px; left: 20px; flex-direction: column-reverse; }

.toast-item {
    pointer-events: auto;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 340px;
    max-width: 420px;
    position: relative;
    overflow: hidden;
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

[data-bs-theme="light"] .toast-item {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.03) inset;
}

.toast-item.removing {
    animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.toast-icon-wrap {
    position: relative;
    flex-shrink: 0;
}

.toast-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.toast-icon svg {
    width: 32px;
    height: 32px;
    stroke-width: 1.5;
    color: #fff;
}

.toast-icon-glow {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    opacity: 0.2;
    filter: blur(8px);
    z-index: 0;
}

.toast-item.success .toast-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}
.toast-item.success .toast-icon-glow {
    background: #10b981;
}
.toast-item.success .toast-progress {
    background: #10b981;
}

.toast-item.error .toast-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}
.toast-item.error .toast-icon-glow {
    background: #ef4444;
}
.toast-item.error .toast-progress {
    background: #ef4444;
}

.toast-item.warning .toast-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}
.toast-item.warning .toast-icon-glow {
    background: #f59e0b;
}
.toast-item.warning .toast-progress {
    background: #f59e0b;
}

.toast-item.info .toast-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}
.toast-item.info .toast-icon-glow {
    background: #3b82f6;
}
.toast-item.info .toast-progress {
    background: #3b82f6;
}

.toast-content {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.toast-title {
    font-size: 15px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 4px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

[data-bs-theme="light"] .toast-title {
    color: #1e293b;
}

.toast-message {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0;
}

[data-bs-theme="light"] .toast-message {
    color: #64748b;
}

.toast-close {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    color: #64748b;
    padding: 0;
    margin: -2px -4px -2px 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    transform: scale(1.05);
}

[data-bs-theme="light"] .toast-close {
    background: rgba(0, 0, 0, 0.04);
    color: #94a3b8;
}

[data-bs-theme="light"] .toast-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #475569;
}

.toast-close svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left;
    animation: toastProgress 4s linear forwards;
    border-radius: 0 0 16px 16px;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(40px) scale(0.96);
    }
}

@keyframes toastProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.toast-container.top-left .toast-item,
.toast-container.bottom-left .toast-item {
    animation: toastSlideInLeft 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-container.top-left .toast-item.removing,
.toast-container.bottom-left .toast-item.removing {
    animation: toastSlideOutLeft 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes toastSlideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-40px) scale(0.96);
    }
}

@media (max-width: 576px) {
    .toast-container {
        width: calc(100% - 32px);
        left: 16px !important;
        right: 16px !important;
    }

    .toast-container.top-right,
    .toast-container.top-left {
        top: 16px;
    }

    .toast-container.bottom-right,
    .toast-container.bottom-left {
        bottom: 16px;
    }

    .toast-item {
        min-width: 100%;
        max-width: 100%;
        padding: 14px 16px;
        border-radius: 14px;
    }
    
    .toast-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }
    
    .toast-icon svg {
        width: 20px;
        height: 20px;
    }
}
