/* Стили для системы уведомлений */

/* Контейнер уведомлений */
.toast-notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}

/* Базовые стили уведомления */
.toast-notification {
    display: flex;
    align-items: flex-start;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 12px;
    padding: 18px 45px 18px 18px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
    border-left: 4px solid #6c757d;
    max-width: 420px;
    min-width: 320px;
    position: relative;
    box-sizing: border-box;
}

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

/* Анимация исчезновения */
.toast-notification.hide {
    opacity: 0;
    transform: translateX(100%);
    margin-bottom: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Типы уведомлений */
.toast-notification-success {
    border-left-color: #28a745;
}

.toast-notification-info {
    border-left-color: #007bff;
}

.toast-notification-warning {
    border-left-color: #ffc107;
}

.toast-notification-error {
    border-left-color: #dc3545;
}

.toast-notification-progress {
    border-left-color: #6f42c1;
}

/* Иконка уведомления */
.toast-notification-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-notification-icon .material-symbols-rounded {
    font-size: 28px;
    font-variation-settings:
        'FILL' 1,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;
}

.toast-notification-success .toast-notification-icon {
    color: #28a745;
}

.toast-notification-info .toast-notification-icon {
    color: #007bff;
}

.toast-notification-warning .toast-notification-icon {
    color: #ffc107;
}

.toast-notification-error .toast-notification-icon {
    color: #dc3545;
}

.toast-notification-progress .toast-notification-icon {
    color: #6f42c1;
}

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

.toast-notification-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 6px;
    color: #333;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.toast-notification-message {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    max-height: 180px;
    overflow-y: auto;
}

/* Кнопка закрытия */
.toast-notification-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
}

.toast-notification-close .material-symbols-rounded {
    font-size: 20px;
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 20;
}

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

/* Прогресс бар в уведомлениях */
.toast-notification .progress {
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.toast-notification .progress-bar {
    height: 100%;
    background-color: #6f42c1;
    transition: width 0.3s ease;
}

/* Скроллбар для длинных сообщений */
.toast-notification-message::-webkit-scrollbar {
    width: 5px;
}

.toast-notification-message::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.toast-notification-message::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.toast-notification-message::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .toast-notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast-notification {
        margin-bottom: 10px;
        padding: 16px 40px 16px 16px;
        max-width: none;
        min-width: auto;
    }

    .toast-notification-title {
        font-size: 14px;
    }

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

/* Анимация пульсации для важных уведомлений */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 4px 25px rgba(220, 53, 69, 0.3);
    }
    100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
}

.toast-notification-error {
    animation: pulse 2s ease-in-out infinite;
}

/* Стили для темной темы */
@media (prefers-color-scheme: dark) {
    .toast-notification {
        background: #2d3748;
        color: #e2e8f0;
    }

    .toast-notification-title {
        color: #f7fafc;
    }

    .toast-notification-message {
        color: #cbd5e0;
    }

    .toast-notification-close {
        color: #a0aec0;
    }

    .toast-notification-close:hover {
        color: #f7fafc;
        background-color: rgba(255, 255, 255, 0.1);
    }
}
