/* Toast уведомления */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: 15px;
    padding: 16px 20px;
    border-left: 4px solid;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    min-width: 300px;
    pointer-events: auto;
    backdrop-filter: blur(10px);
}

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

.toast.hide {
    transform: translateX(400px);
    opacity: 0;
}

/* Типы Toast'ов */
.toast-success {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.toast-success .toast-icon {
    background: #10b981;
    color: white;
}

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

.toast-error {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.toast-error .toast-icon {
    background: #ef4444;
    color: white;
}

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

.toast-warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.toast-warning .toast-icon {
    background: #f59e0b;
    color: white;
}

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

.toast-info {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.toast-info .toast-icon {
    background: #3b82f6;
    color: white;
}

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

.toast-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #374151;
    line-height: 1.2;
}

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

.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #9ca3af;
    font-size: 18px;
    transition: color 0.2s ease;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.toast-close:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 12px 12px;
    animation: toast-progress 5s linear forwards;
}

@keyframes toast-progress {
    from { 
        width: 100%; 
    }
    to { 
        width: 0%; 
    }
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #1f2937;
        color: #f9fafb;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    }
    
    .toast-success {
        background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    }
    
    .toast-error {
        background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    }
    
    .toast-warning {
        background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
    }
    
    .toast-info {
        background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    }
    
    .toast-title {
        color: #f9fafb;
    }
    
    .toast-message {
        color: #d1d5db;
    }
    
    .toast-close {
        color: #9ca3af;
    }
    
    .toast-close:hover {
        color: #f9fafb;
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .toast-container {
        left: 10px;
        right: 10px;
        top: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
        margin-bottom: 10px;
        padding: 14px 16px;
        transform: translateY(-100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
    
    .toast.hide {
        transform: translateY(-100px);
    }
    
    .toast-title {
        font-size: 13px;
    }
    
    .toast-message {
        font-size: 12px;
    }
}

/* Улучшенная анимация появления */
@media (prefers-reduced-motion: no-preference) {
    .toast {
        transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }
}

/* Анимация для пользователей с ограниченной анимацией */
@media (prefers-reduced-motion: reduce) {
    .toast {
        transition: opacity 0.2s ease, transform 0.2s ease;
    }
    
    .toast.show {
        animation: none;
    }
    
    .toast.hide {
        animation: none;
    }
    
    .toast-progress {
        animation: none;
    }
} 