/* ============================================
   MODERN TOAST NOTIFICATIONS
   ============================================ */

:root {
    --toast-success: #10B981;
    --toast-error: #EF4444;
    --toast-warning: #F59E0B;
    --toast-info: #3B82F6;
    --toast-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Контейнер для уведомлений */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

/* Базовый стиль toast */
.toast {
    background: #ffffff;
    color: #1a1a1a;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: var(--toast-shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    border-left: 4px solid transparent;
}

/* Анимация появления */
.toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* Анимация исчезновения */
.toast.hide {
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease-in;
}

/* Иконка */
.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

/* Контент */
.toast-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-title {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
}

.toast-message {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Кнопка закрытия */
.toast-close {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    color: #333;
}

/* Прогресс-бар */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    width: 100%;
    transform-origin: left;
    animation: toast-progress 3s linear forwards;
}

@keyframes toast-progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* ============================================
   ТИПЫ УВЕДОМЛЕНИЙ
   ============================================ */

/* Success (Успех) */
.toast.toast-success {
    border-left-color: var(--toast-success);
}

.toast.toast-success .toast-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--toast-success);
}

.toast.toast-success .toast-progress {
    background: var(--toast-success);
}

/* Error (Ошибка) */
.toast.toast-error {
    border-left-color: var(--toast-error);
}

.toast.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--toast-error);
}

.toast.toast-error .toast-progress {
    background: var(--toast-error);
}

/* Warning (Предупреждение) */
.toast.toast-warning {
    border-left-color: var(--toast-warning);
}

.toast.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--toast-warning);
}

.toast.toast-warning .toast-progress {
    background: var(--toast-warning);
}

/* Info (Информация) */
.toast.toast-info {
    border-left-color: var(--toast-info);
}

.toast.toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--toast-info);
}

.toast.toast-info .toast-progress {
    background: var(--toast-info);
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media (max-width: 768px) {
    #toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .toast {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .toast-icon {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
    
    .toast-title {
        font-size: 14px;
    }
    
    .toast-message {
        font-size: 12px;
    }
}

/* ============================================
   ДОПОЛНИТЕЛЬНЫЕ ВАРИАНТЫ
   ============================================ */

/* Компактный вариант */
.toast.toast-compact {
    padding: 12px 16px;
    min-width: 250px;
}

.toast.toast-compact .toast-content {
    gap: 0;
}

.toast.toast-compact .toast-message {
    display: none;
}

/* Темная тема */
.toast.toast-dark {
    background: #1a1a1a;
    color: #ffffff;
}

.toast.toast-dark .toast-message {
    color: #cccccc;
}

.toast.toast-dark .toast-close {
    color: #999;
}

.toast.toast-dark .toast-close:hover {
    color: #ffffff;
}

/* С изображением */
.toast.toast-with-image .toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
}

.toast.toast-with-image .toast-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Позиция снизу */
#toast-container.toast-bottom {
    top: auto;
    bottom: 20px;
}

#toast-container.toast-bottom .toast {
    transform: translateX(400px) translateY(20px);
}

#toast-container.toast-bottom .toast.show {
    transform: translateX(0) translateY(0);
}

/* Позиция слева */
#toast-container.toast-left {
    right: auto;
    left: 20px;
}

#toast-container.toast-left .toast {
    transform: translateX(-400px);
}

#toast-container.toast-left .toast.show {
    transform: translateX(0);
}

/* Центрированные уведомления */
#toast-container.toast-center {
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    align-items: center;
}

#toast-container.toast-center .toast {
    transform: translateY(-100px);
}

#toast-container.toast-center .toast.show {
    transform: translateY(0);
}
