/**
 * Toast Notifications CSS
 * Modern toast system with colors based on notification type
 */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(26, 29, 33, 0.95);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.removing {
    transform: translateX(100%);
    opacity: 0;
}

/* Toast Types with Colors - Match the screenshot */
.toast-success {
    border-left: 4px solid #22c55e;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(22, 163, 74, 0.05) 100%);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.toast-error {
    border-left: 4px solid #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.05) 100%);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.toast-warning {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.05) 100%);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.toast-info {
    border-left: 4px solid #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.05) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
}

.toast-success .toast-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

/* Toast Content */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #fff;
}

.toast-success .toast-title {
    color: #10b981;
}

.toast-error .toast-title {
    color: #ef4444;
}

.toast-warning .toast-title {
    color: #f59e0b;
}

.toast-info .toast-title {
    color: #3b82f6;
}

.toast-message {
    font-size: 13px;
    line-height: 1.4;
    color: #e5e7eb;
    word-wrap: break-word;
}

/* Toast Close Button */
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 12px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Progress Bar (optional) */
.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    width: 100%;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform linear;
}

.toast-success::after {
    background: #10b981;
}

.toast-error::after {
    background: #ef4444;
}

.toast-warning::after {
    background: #f59e0b;
}

.toast-info::after {
    background: #3b82f6;
}

/* Animation for progress bar */
.toast.show::after {
    animation: toastProgress 5s linear forwards;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        margin-bottom: 8px;
        padding: 12px;
    }
    
    .toast-title {
        font-size: 13px;
    }
    
    .toast-message {
        font-size: 12px;
    }
}

/* Dark theme adjustments */
@media (prefers-color-scheme: dark) {
    .toast {
        background: rgba(17, 24, 39, 0.95);
        border-color: rgba(255, 255, 255, 0.05);
    }
}

/* Hover effects */
.toast:hover {
    transform: translateX(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

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

/* Multiple toasts stacking */
.toast:nth-child(1) { z-index: 100; }
.toast:nth-child(2) { z-index: 99; }
.toast:nth-child(3) { z-index: 98; }
.toast:nth-child(4) { z-index: 97; }
.toast:nth-child(5) { z-index: 96; }

/* Entrance animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Accessibility - These attributes should be set via JavaScript, not CSS */

/* High contrast mode support */
@media (prefers-contrast: high) {
    .toast {
        border-width: 2px;
        border-style: solid;
    }
    
    .toast-success {
        border-color: #10b981;
    }
    
    .toast-error {
        border-color: #ef4444;
    }
    
    .toast-warning {
        border-color: #f59e0b;
    }
    
    .toast-info {
        border-color: #3b82f6;
    }
}
