/**
 * Unified Notifications System
 * Единая система уведомлений для всех страниц сайта
 */

/* === ОСНОВНЫЕ СТИЛИ УВЕДОМЛЕНИЙ === */

/* Контейнер для всплывающих уведомлений */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

/* Основной блок уведомления */
.notification {
    position: relative;
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border: 1px solid #3a3a3a;
    border-left: 4px solid #3b82f6;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    margin-bottom: 12px;
    overflow: hidden;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    backdrop-filter: blur(10px);
}

/* Анимация появления */
.notification.show {
    transform: translateX(0);
    opacity: 1;
}

/* Содержимое уведомления */
.notification-content {
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    gap: 12px;
}

/* Иконка уведомления */
.notification-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

/* Текстовое содержимое */
.notification-text {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.notification-message {
    font-size: 14px;
    color: #d1d5db;
    margin: 0;
    line-height: 1.4;
}

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

.notification-close:hover {
    background: rgba(156, 163, 175, 0.2);
    color: #ffffff;
}

/* === ТИПЫ УВЕДОМЛЕНИЙ === */

/* Успех */
.notification.success {
    border-left-color: #10b981;
}

.notification.success .notification-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

/* Ошибка */
.notification.error {
    border-left-color: #ef4444;
}

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

/* Предупреждение */
.notification.warning {
    border-left-color: #f59e0b;
}

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

/* Информация */
.notification.info {
    border-left-color: #3b82f6;
}

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

/* === ПРОГРЕСС БАР === */
.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transform-origin: left;
    animation: progress-countdown var(--duration, 8s) linear forwards;
}

@keyframes progress-countdown {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Разные цвета прогресс-бара для разных типов */
.notification.success .notification-progress {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.notification.error .notification-progress {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.notification.warning .notification-progress {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.notification.info .notification-progress {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 768px) {
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .notification-content {
        padding: 14px 16px;
        gap: 10px;
    }

    .notification-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .notification-title {
        font-size: 15px;
    }

    .notification-message {
        font-size: 13px;
    }
}

/* === АНИМАЦИИ === */
@keyframes slideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Специальные эффекты */
.notification.slide-in {
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.notification.slide-out {
    animation: slideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* === МНОЖЕСТВЕННЫЕ УВЕДОМЛЕНИЯ === */
.notification:nth-child(1) { z-index: 999999; }
.notification:nth-child(2) { z-index: 999998; transform: translateY(-8px) scale(0.98); }
.notification:nth-child(3) { z-index: 999997; transform: translateY(-16px) scale(0.96); }
.notification:nth-child(n+4) { display: none; }

/* Эффект сложения при множественных уведомлениях */
.notification-container:has(.notification:nth-child(2)) .notification:nth-child(1) {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.2);
}