/* agti_app/static/css/notifications-toast.css */
/* Модуль: notifications-toast.css */
/* Назначение: Стили для универсальных toast-уведомлений и confirm modal */
/* Версия: 1.2.0 */
/* Дата: 2025-12-27 */
/* */
/* v1.2.0 | 2026-09-06 */
/* - .paused: пауза полоски прогресса при наведении курсора */
/* - .persistent: уведомление без автозакрытия — полоски прогресса нет */

/* SECTION: Toast container */

.toast-container-agti {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 350px;
    max-width: 500px;
}

/* SECTION: Toast item */

.toast-agti {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 15px;
    overflow: hidden;
    animation: slideInRight 0.3s ease-out;
    position: relative;
}

.toast-agti.hiding {
    animation: slideOutRight 0.3s ease-in;
}

/* Progress bar */
.toast-agti::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: rgba(0, 0, 0, 0.1);
    animation: progressBar var(--duration, 5s) linear;
}

@keyframes progressBar {
    from { width: 100%; }
    to { width: 0%; }
}

/* Курсор над уведомлением — отсчёт стоит, полоска стоит вместе с ним */
.toast-agti.paused::before {
    animation-play-state: paused;
}

/* duration = 0: автозакрытия нет, полоска прогресса ввела бы в заблуждение */
.toast-agti.persistent::before {
    display: none;
}

/* SECTION: Toast header */

.toast-agti-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.toast-agti-icon {
    font-size: 24px;
    margin-right: 12px;
    flex-shrink: 0;
}

.toast-agti-title {
    font-weight: 600;
    font-size: 15px;
    flex-grow: 1;
    margin: 0;
}

.toast-agti-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.toast-agti-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #000;
}

/* SECTION: Toast body */

.toast-agti-body {
    padding: 12px 15px;
    font-size: 14px;
    color: #495057;
    line-height: 1.5;
}

/* SECTION: Toast types */

/* Success */
.toast-agti.success .toast-agti-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.toast-agti.success .toast-agti-icon {
    color: white;
}

.toast-agti.success::before {
    background: #10b981;
}

/* Error */
.toast-agti.error .toast-agti-header {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.toast-agti.error .toast-agti-icon {
    color: white;
}

.toast-agti.error::before {
    background: #ef4444;
}

/* Warning */
.toast-agti.warning .toast-agti-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.toast-agti.warning .toast-agti-icon {
    color: white;
}

.toast-agti.warning::before {
    background: #f59e0b;
}

/* Info */
.toast-agti.info .toast-agti-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.toast-agti.info .toast-agti-icon {
    color: white;
}

.toast-agti.info::before {
    background: #3b82f6;
}

/* SECTION: Animations */

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* SECTION: Confirm modal */

.confirm-modal-agti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.confirm-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease-out;
}

.confirm-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.confirm-modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.confirm-modal-body {
    padding: 24px;
    font-size: 15px;
    color: #4b5563;
    line-height: 1.6;
    /* Текст подтверждения экранируется (escapeHtml), поэтому разметку в него
       передать нельзя и не нужно. pre-line даёт единственное, чего не хватало —
       переносы строк по 
: многострочные подтверждения (сводка сумм перед
       принятием предложения) иначе слипались в абзац. Пробелы не схлопываются
       в кашу, как было бы у pre. */
    white-space: pre-line;
}

.confirm-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.confirm-modal-btn {
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-modal-btn.cancel {
    background: #f3f4f6;
    color: #374151;
}

.confirm-modal-btn.cancel:hover {
    background: #e5e7eb;
}

.confirm-modal-btn.confirm {
    background: #3b82f6;
    color: white;
}

.confirm-modal-btn.confirm:hover {
    background: #2563eb;
}

.confirm-modal-btn.danger {
    background: #ef4444;
    color: white;
}

.confirm-modal-btn.danger:hover {
    background: #dc2626;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* SECTION: Responsive */

@media (max-width: 576px) {
    .toast-container-agti {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
    }
    
    .confirm-modal-content {
        width: 95%;
        margin: 20px;
    }
}

/* SECTION: Dark mode support */

@media (prefers-color-scheme: dark) {
    .toast-agti {
        background: #1f2937;
    }
    
    .toast-agti-body {
        color: #d1d5db;
    }
    
    .toast-agti-close {
        color: #9ca3af;
    }
    
    .toast-agti-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #f3f4f6;
    }
    
    .confirm-modal-content {
        background: #1f2937;
        color: #f3f4f6;
    }
    
    .confirm-modal-header,
    .confirm-modal-footer {
        border-color: #374151;
    }
    
    .confirm-modal-body {
        color: #d1d5db;
    }
}
