/* ========================================
   Toast Notifications
   ======================================== */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: 400px;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-tooltip);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease-out;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.toast.toast-exit {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.toast-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-word;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.toast-close:hover {
    opacity: 1;
}

.toast.toast-error .toast-icon {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.toast.toast-warning .toast-icon {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
}

.toast.toast-success .toast-icon {
    background: rgba(39, 174, 96, 0.2);
    color: #27ae60;
}

.toast.toast-info .toast-icon {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--text-muted);
    border-radius: 0 0 12px 12px;
    animation: toastProgress linear forwards;
}

@keyframes toastProgress {
    from {
        width: 100%;
    }

    to {
        width: 0;
    }
}

@media (max-width: 480px) {
    .toast-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}

/* Toast position variants */
.toast-container.toast-pos-top-right {
    top: 1rem;
    right: 1rem;
    bottom: auto;
    left: auto;
}

.toast-container.toast-pos-bottom-right {
    top: auto;
    right: 1rem;
    bottom: 1rem;
    left: auto;
    flex-direction: column-reverse;
}

.toast-container.toast-pos-bottom-center {
    top: auto;
    right: auto;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column-reverse;
}