/* static/css/popup.css */

:root {
    /* Эти переменные должны совпадать с вашим основным файлом стилей */
    --font-mono: 'Fira Code', monospace;
    --radius-m: 12px;
    --transition-slow: 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

#popup-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none; /* Контейнер не должен перехватывать клики */
}

.popup-notification {
    width: 100%;
    max-width: 360px;
    background: hsla(0, 0%, 10%, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid hsla(0, 0%, 100%, 0.1);
    border-radius: var(--radius-m);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;

    pointer-events: auto; /* Уведомления должны быть кликабельны */
    position: relative;
    overflow: hidden;

    opacity: 0;
}

/* --- Анимации появления/исчезновения --- */
@keyframes popup-enter-anim {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
@keyframes popup-exit-anim {
    from {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateX(50%);
    }
}
.popup-notification.popup-enter {
    animation: popup-enter-anim var(--transition-slow) forwards;
}
.popup-notification.popup-exit {
    animation: popup-exit-anim var(--transition-slow) forwards;
}

/* --- Варианты стилей (успех/ошибка) --- */
.popup-notification.is-success {
    border-left: 4px solid #5dd592;
}
.popup-notification.is-error {
    border-left: 4px solid #ff6b81;
}

/* --- Внутренние элементы --- */
.popup-icon {
    flex-shrink: 0;
    margin-top: 2px;
}
.popup-notification.is-success .popup-icon { color: #5dd592; }
.popup-notification.is-error .popup-icon { color: #ff6b81; }

.popup-content {
    flex-grow: 1;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.5;
    font-weight: 500;
    color: #F0F0F0;
}

.popup-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #A0A0A0;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    transition: color 200ms ease;
}
.popup-close:hover {
    color: #FFFFFF;
}

/* --- Индикатор-таймер --- */
.popup-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background-color: hsla(0, 0%, 100%, 0.2);
    animation: progress-countdown linear forwards;
}
.popup-notification.is-success .popup-progress {
    background-color: #5dd592;
}
.popup-notification.is-error .popup-progress {
    background-color: #ff6b81;
}

@keyframes progress-countdown {
    from { width: 100%; }
    to { width: 0%; }
}