/* === EduOkrug Toast Notifications === */
/* Современная система уведомлений с прогресс-баром и стеком */

:root {
    --toast-max-width: 380px;
    --toast-min-width: 280px;
    --toast-radius: 12px;
    --toast-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.05);
    --toast-shadow-hover: 0 15px 50px -10px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* === CONTAINER === */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    pointer-events: none;
    max-height: calc(100vh - 48px);
    overflow: visible;
}

/* === TOAST BASE === */
.toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: var(--toast-min-width);
    max-width: var(--toast-max-width);
    padding: 14px 16px 14px 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--toast-radius);
    box-shadow: var(--toast-shadow);
    pointer-events: auto;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.25s ease,
                opacity 0.2s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    font-family: var(--font);
}

.toast:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: var(--toast-shadow-hover);
}

.toast:hover .toast-progress-fill {
    animation-play-state: paused;
}

/* === TOAST TYPE COLORS === */
.toast-success {
    border-left: 4px solid var(--success);
    background: linear-gradient(to right, rgba(16, 185, 129, 0.02), white);
}

.toast-error {
    border-left: 4px solid var(--danger);
    background: linear-gradient(to right, rgba(239, 68, 68, 0.02), white);
}

.toast-warning {
    border-left: 4px solid var(--warning);
    background: linear-gradient(to right, rgba(245, 158, 11, 0.02), white);
}

.toast-info {
    border-left: 4px solid var(--primary);
    background: linear-gradient(to right, rgba(37, 99, 235, 0.02), white);
}

/* === ICON === */
.toast-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.toast-icon svg {
    width: 18px;
    height: 18px;
}

.toast-success .toast-icon {
    background: var(--success-light);
    color: var(--success-text);
}

.toast-error .toast-icon {
    background: var(--danger-light);
    color: var(--danger-text);
}

.toast-warning .toast-icon {
    background: var(--warning-light);
    color: var(--warning-text);
}

.toast-info .toast-icon {
    background: var(--primary-light);
    color: var(--primary);
}

/* === CONTENT === */
.toast-content {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.toast-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 2px;
    line-height: 1.3;
}

.toast-message {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
    word-wrap: break-word;
}

/* === CLOSE BUTTON === */
.toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s;
    margin: -2px -4px 0 0;
}

.toast-close svg {
    width: 14px;
    height: 14px;
}

.toast-close:hover {
    background: var(--bg);
    color: var(--dark);
}

/* === PROGRESS BAR === */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.toast-progress-fill {
    height: 100%;
    width: 100%;
    transform-origin: left center;
    animation: toastProgress linear forwards;
    border-radius: 0 3px 3px 0;
}

.toast-success .toast-progress-fill { background: linear-gradient(90deg, var(--success), #34d399); }
.toast-error .toast-progress-fill { background: linear-gradient(90deg, var(--danger), #f87171); }
.toast-warning .toast-progress-fill { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.toast-info .toast-progress-fill { background: linear-gradient(90deg, var(--primary), var(--accent)); }

@keyframes toastProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* === ENTRANCE ANIMATION === */
.toast-enter {
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* === EXIT ANIMATION === */
.toast-exit {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateX(120%) scale(0.8);
    }
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
    .toast-container {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }
    
    .toast {
        min-width: 0;
        max-width: 100%;
    }
    
    .toast-title { font-size: 13px; }
    .toast-message { font-size: 12.5px; }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    .toast,
    .toast-enter,
    .toast-exit,
    .toast-progress-fill {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
