/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 320px;
    width: 100%;
}

/* Base Toast Styles */
.toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 320px;
    border-radius: 12px;
    overflow: hidden;
    transform: translateX(350px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    
    /* Black Glassmorphism */
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Toast Show Animation */
.toast.toast-show {
    transform: translateX(0);
    opacity: 1;
}

/* Toast Hide Animation */
.toast.toast-hide {
    transform: translateX(350px);
    opacity: 0;
}

/* Toast Content */
.toast-content {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 10px;
    position: relative;
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
}

/* Toast Message */
.toast-message {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 2px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.2;
}

.toast-text {
    font-size: 12px;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.7);
    word-wrap: break-word;
}

/* Toast Close Button */
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.toast-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: rgba(255, 255, 255, 0.4);
    animation: toast-progress-animation linear forwards;
    transform: translateX(-100%);
}

@keyframes toast-progress-animation {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(100%);
    }
}

/* Success Toast */
.toast-success {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

.toast-success .toast-icon {
    color: rgba(255, 255, 255, 0.8);
}

.toast-success .toast-progress::before {
    background: rgba(255, 255, 255, 0.4);
}

/* Error Toast */
.toast-error {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

.toast-error .toast-icon {
    color: rgba(255, 255, 255, 0.8);
}

.toast-error .toast-progress::before {
    background: rgba(255, 255, 255, 0.4);
}

/* Warning Toast */
.toast-warning {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

.toast-warning .toast-icon {
    color: rgba(255, 255, 255, 0.8);
}

.toast-warning .toast-progress::before {
    background: rgba(255, 255, 255, 0.4);
}

/* Info/Message Toast */
.toast.toast-message {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

.toast.toast-message .toast-icon {
    color: rgba(255, 255, 255, 0.8);
}

.toast.toast-message .toast-progress::before {
    background: rgba(255, 255, 255, 0.4);
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
    
    .toast-content {
        padding: 10px 14px;
    }
}

/* Hover effects */
.toast:hover {
    transform: translateX(-3px);
    box-shadow: 
        0 12px 30px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Focus styles for accessibility */
.toast:focus-within {
    outline: 1px solid rgba(255, 255, 255, 0.3);
    outline-offset: 1px;
}

/* Animation for stacked toasts */
.toast-container .toast:not(:last-child) {
    margin-bottom: 6px;
}

/* Custom toast sizes */
.toast.toast-small {
    min-width: 240px;
}

.toast.toast-large {
    min-width: 360px;
    max-width: 380px;
}

.toast.toast-small .toast-content {
    padding: 10px 12px;
}

.toast.toast-large .toast-content {
    padding: 14px 18px;
}