/**
 * Стили для централизованной системы уведомлений
 *
 * Подключается глобально (coreCSS). Тосты/уведомления: контейнер,
 * анимации slideInRight/slideOutRight, типы (success, error, warning, info).
 */

/* Контейнер уведомлений */
.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

/* Отдельное уведомление */
.notification {
    position: relative;
    margin-bottom: 15px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.notification.fade-out {
    animation: slideOutRight 0.3s ease-in forwards;
}

/* Иконка уведомления */
.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Контент уведомления */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.notification-message {
    font-size: 0.875rem;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Кнопка закрытия */
.notification-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-close:hover {
    opacity: 1;
}

/* Типы уведомлений */
.notification-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.notification-error,
.notification-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.notification-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #212529;
}

.notification-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.notification-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

/* Анимации */
@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;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .notifications-container {
        top: max(10px, env(safe-area-inset-top));
        right: max(10px, env(safe-area-inset-right));
        left: max(10px, env(safe-area-inset-left));
        max-width: none;
    }
    
    .notification {
        padding: 12px 16px;
    }
}

@media (max-width: 430px) {
    .notifications-container {
        top: max(8px, env(safe-area-inset-top));
        right: max(8px, env(safe-area-inset-right));
        left: max(8px, env(safe-area-inset-left));
    }
    
    .notification {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

/* Прогресс-бар для авто-закрытия */
.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 8px 8px;
    animation: progressBar linear forwards;
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}



/* Бейдж очереди уведомлений */
.notification-queue-badge {
    background: rgba(33, 37, 41, 0.85);
    color: #f8f9fa;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    animation: fadeInQueue 0.2s ease-out;
    pointer-events: auto;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

@keyframes fadeInQueue {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Доступность: Учет предпочтений уменьшения движения */
@media (prefers-reduced-motion: reduce) {
    .notification {
        animation: none !important;
        transition: opacity 0.1s ease !important;
    }
    
    .notification.fade-out {
        animation: none !important;
        opacity: 0 !important;
    }

    .notification-progress {
        display: none !important;
    }
}
