/* ========== MODERN NOTIFICATIONS SYSTEM ========== */


/* Контейнер для уведомлений */

.notifications-container {
    position: fixed !important;
    top: 80px !important;
    /* Увеличиваем отступ сверху, чтобы не перекрывать навбар */
    right: 20px !important;
    z-index: 2147483647 !important;
    /* Максимальный z-index в CSS */
    pointer-events: none;
    max-width: 400px;
    width: 100%;
}


/* Базовые стили уведомления */

.notification {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 100%;
    word-wrap: break-word;
}

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

.notification.hide {
    transform: translateX(100%);
    opacity: 0;
}


/* Заголовок уведомления */

.notification-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.notification-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2d3748;
    margin: 0;
    flex: 1;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #a0aec0;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.notification-close:hover {
    background: rgba(160, 174, 192, 0.1);
    color: #4a5568;
}


/* Содержимое уведомления */

.notification-content {
    color: #4a5568;
    line-height: 1.5;
    font-size: 0.95rem;
}


/* Прогресс-бар */

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 15px 15px;
    transition: width linear;
}


/* Типы уведомлений */


/* Успех */

.notification.success {
    border-left: 4px solid #48bb78;
}

.notification.success .notification-icon {
    background: linear-gradient(135deg, #48bb78, #68d391);
}

.notification.success .notification-progress {
    background: #48bb78;
}


/* Ошибка */

.notification.error {
    border-left: 4px solid #e53e3e;
}

.notification.error .notification-icon {
    background: linear-gradient(135deg, #e53e3e, #fc8181);
}

.notification.error .notification-progress {
    background: #e53e3e;
}


/* Предупреждение */

.notification.warning {
    border-left: 4px solid #ed8936;
}

.notification.warning .notification-icon {
    background: linear-gradient(135deg, #ed8936, #f6ad55);
}

.notification.warning .notification-progress {
    background: #ed8936;
}


/* Информация */

.notification.info {
    border-left: 4px solid #4299e1;
}

.notification.info .notification-icon {
    background: linear-gradient(135deg, #4299e1, #63b3ed);
}

.notification.info .notification-progress {
    background: #4299e1;
}


/* Блокировка (специальный тип для занятых ресурсов) */

.notification.blocked {
    border-left: 4px solid #805ad5;
    background: rgba(255, 255, 255, 0.98);
    /* Более непрозрачный фон для лучшей видимости */
}

.notification.blocked .notification-icon {
    background: linear-gradient(135deg, #805ad5, #b794f6);
}

.notification.blocked .notification-progress {
    background: #805ad5;
}


/* Улучшенная видимость кнопок в блокирующих уведомлениях */

.notification.blocked .notification-btn.secondary {
    background: linear-gradient(135deg, #4a5568, #718096);
    color: white;
    border: 2px solid #718096;
    font-weight: 700;
}

.notification.blocked .notification-btn.secondary:hover {
    background: linear-gradient(135deg, #2d3748, #4a5568);
    border-color: #4a5568;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 85, 104, 0.5);
}


/* Анимации появления */

@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;
    }
}

@keyframes bounce {
    0%,
    20%,
    53%,
    80%,
    100% {
        transform: translate3d(0, 0, 0);
    }
    40%,
    43% {
        transform: translate3d(0, -5px, 0);
    }
    70% {
        transform: translate3d(0, -3px, 0);
    }
    90% {
        transform: translate3d(0, -1px, 0);
    }
}

.notification.bounce {
    animation: bounce 1s ease-in-out;
}


/* Эффект пульсации для важных уведомлений */

@keyframes pulse {
    0% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    }
    100% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    }
}

.notification.pulse {
    animation: pulse 2s infinite;
}


/* Эффект тряски для ошибок */

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-2px);
    }
    20%,
    40%,
    60%,
    80% {
        transform: translateX(2px);
    }
}

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


/* Кнопки действий в уведомлениях */

.notification-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.notification-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.notification-btn.primary {
    background: linear-gradient(135deg, #4299e1, #63b3ed);
    color: white;
}

.notification-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.4);
}

.notification-btn.secondary {
    background: linear-gradient(135deg, #718096, #a0aec0);
    color: white;
    border: 1px solid rgba(160, 174, 192, 0.5);
    font-weight: 600;
}

.notification-btn.secondary:hover {
    background: linear-gradient(135deg, #4a5568, #718096);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(113, 128, 150, 0.4);
}


/* Адаптивность */

@media (max-width: 768px) {
    .notifications-container {
        top: 70px !important;
        /* Отступ для мобильного навбара */
        right: 10px !important;
        left: 10px !important;
        max-width: none;
    }
    .notification {
        padding: 1.2rem;
        border-radius: 12px;
    }
    .notification-title {
        font-size: 1rem;
    }
    .notification-content {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .notifications-container {
        top: 60px !important;
        /* Отступ для мобильного навбара */
        right: 5px !important;
        left: 5px !important;
    }
    .notification {
        padding: 1rem;
        margin-bottom: 0.5rem;
    }
    .notification-header {
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }
    .notification-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    .notification-title {
        font-size: 0.95rem;
    }
    .notification-content {
        font-size: 0.85rem;
    }
    .notification-actions {
        margin-top: 0.8rem;
        gap: 0.3rem;
    }
    .notification-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        flex: 1;
        justify-content: center;
    }
}


/* Темная тема */

@media (prefers-color-scheme: dark) {
    .notification {
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    .notification-title {
        color: #103046;
    }
    .notification-content {
        color: #103046;
    }
    .notification-close {
        color: #a0aec0;
    }
    .notification-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #f7fafc;
    }
}


/* Специальные эффекты */

.notification.glow {
    box-shadow: 0 0 20px rgba(66, 153, 225, 0.5);
}

.notification.slide-down {
    transform: translateY(-100%);
}

.notification.slide-down.show {
    transform: translateY(0);
}


/* Звуковые индикаторы (визуальные) */

.notification.sound-wave::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, rgba(66, 153, 225, 0.5) 25%, rgba(66, 153, 225, 1) 50%, rgba(66, 153, 225, 0.5) 75%, transparent 100%);
    animation: soundWave 1.5s infinite;
}

@keyframes soundWave {
    0%,
    100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}