/**
 * Premium Toast Notifications 2025
 * Премиальная система уведомлений
 */

:root {
    --toast-success: linear-gradient(135deg, #10b981, #059669);
    --toast-error: linear-gradient(135deg, #ef4444, #dc2626);
    --toast-warning: linear-gradient(135deg, #f59e0b, #d97706);
    --toast-info: linear-gradient(135deg, #6366f1, #4f46e5);
    --toast-primary: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

/* Контейнер для toast уведомлений */
.toast-container {
    position: fixed;
    top: 90px;
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 16px;
    pointer-events: none;
    max-width: 420px;
    width: auto;
}

/* Toast уведомление - Premium стиль */
.toast {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 16px;
    padding: 18px 22px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    pointer-events: auto;
    transform: translateX(500px) scale(0.9);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    min-width: 320px;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Анимация появления */
.toast.show {
    transform: translateX(0) scale(1);
    opacity: 1;
    animation: toastBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toastBounce {
    0% {
        transform: translateX(500px) scale(0.8);
        opacity: 0;
    }
    60% {
        transform: translateX(-10px) scale(1.02);
        opacity: 1;
    }
    100% {
        transform: translateX(0) scale(1);
    }
}

/* Анимация скрытия */
.toast.hide {
    transform: translateX(500px) scale(0.9);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53);
}

/* Accent bar слева */
.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--toast-accent);
    border-radius: 16px 0 0 16px;
}

/* Иконка toast - Premium стиль */
.toast-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    position: relative;
    background: var(--toast-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-icon::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    background: var(--toast-accent);
    opacity: 0.3;
    filter: blur(8px);
    z-index: -1;
    animation: iconPulse 2s infinite;
}

@keyframes iconPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

.toast-icon i {
    color: white;
    position: relative;
    z-index: 1;
}

/* Типы toast */
.toast.success {
    --toast-accent: var(--toast-success);
    border-left: 4px solid #10b981;
}

.toast.error {
    --toast-accent: var(--toast-error);
    border-left: 4px solid #ef4444;
}

.toast.warning {
    --toast-accent: var(--toast-warning);
    border-left: 4px solid #f59e0b;
}

.toast.info {
    --toast-accent: var(--toast-info);
    border-left: 4px solid #6366f1;
}

.toast.primary {
    --toast-accent: var(--toast-primary);
    border-left: 4px solid #8b5cf6;
}

/* Прогресс-бар - Premium стиль */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background: var(--toast-accent);
    border-radius: 0 0 16px 16px;
    transform-origin: left;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.1);
}

.toast-progress.animate {
    animation: toastProgress 3s linear forwards;
}

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

/* Контент toast */
.toast-content {
    flex: 1;
    min-width: 0;
    padding: 2px 0;
}

.toast-title {
    font-weight: 700;
    font-size: 15px;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

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

/* Кнопка закрытия - Premium */
.toast-close {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-size: 16px;
    line-height: 1;
    padding: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #111827;
    transform: scale(1.1) rotate(90deg);
}

.toast-close:active {
    transform: scale(0.95);
}

/* Action buttons в toast */
.toast-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.toast-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.toast-btn-primary {
    background: var(--toast-accent);
    color: white;
}

.toast-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.toast-btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: #6b7280;
}

.toast-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #111827;
}

/* Темная тема - более контрастная */
[data-theme="dark"] .toast,
body.dark-theme .toast,
@media (prefers-color-scheme: dark) {
    .toast {
        background: rgba(30, 41, 59, 0.95);
        backdrop-filter: blur(24px) saturate(200%);
        border: 1px solid rgba(148, 163, 184, 0.1);
        box-shadow: 
            0 20px 60px rgba(0, 0, 0, 0.4),
            0 8px 24px rgba(0, 0, 0, 0.3),
            0 0 0 1px rgba(255, 255, 255, 0.05);
    }
    
    .toast-title {
        color: #f8fafc;
    }
    
    .toast-message {
        color: #cbd5e1;
    }
    
    .toast-close {
        background: rgba(255, 255, 255, 0.05);
        color: #94a3b8;
    }
    
    .toast-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #f8fafc;
    }
    
    .toast-btn-secondary {
        background: rgba(255, 255, 255, 0.05);
        color: #cbd5e1;
    }
    
    .toast-btn-secondary:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #f8fafc;
    }
}

/* Shake анимация для важных уведомлений */
@keyframes toastShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.toast.shake {
    animation: toastShake 0.5s ease-in-out;
}

/* Pulse эффект для успеха */
@keyframes toastSuccessPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.toast.success.show {
    animation: toastBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), 
               toastSuccessPulse 1s ease-out 0.3s;
}

/* Адаптивность */
@media (max-width: 768px) {
    .toast-container {
        top: 70px;
        right: 16px;
        left: 16px;
        max-width: none;
    }
    
    .toast {
        padding: 16px 18px;
        min-width: auto;
    }
    
    .toast-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    
    .toast-title {
        font-size: 14px;
    }
    
    .toast-message {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .toast-container {
        top: 60px;
        right: 12px;
        left: 12px;
    }
    
    .toast {
        padding: 14px 16px;
        gap: 12px;
        border-radius: 12px;
    }
    
    .toast-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
        border-radius: 10px;
    }
}

/* Для особых типов уведомлений */
.toast.premium {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(124, 58, 237, 0.1)),
                rgba(255, 255, 255, 0.98);
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.toast.premium::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 2px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.toast.premium .toast-icon {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

/* Стеклянный эффект */
.toast.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .toast.glass,
body.dark-theme .toast.glass {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Анимация конфетти для особых успехов */
@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.toast-confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--toast-accent);
    border-radius: 50%;
    pointer-events: none;
}

/* Звук уведомления - визуальная волна */
@keyframes soundWave {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.toast-sound-wave {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    border: 2px solid var(--toast-accent);
    animation: soundWave 0.8s ease-out;
    pointer-events: none;
}









