/* css/components/toasts.css - Toast Notification System */

.toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: var(--z-toast, 600);
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    max-width: 380px;
    width: calc(100% - 2.5rem);
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background-color: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: toastSlideIn 260ms cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
    position: relative;
    overflow: hidden;
    transition: transform var(--trans-fast), opacity var(--trans-fast);
}

.toast.hiding {
    opacity: 0;
    transform: translateX(100%);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toast-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 0.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.25;
}

.toast-message {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: 0.2rem;
    line-height: 1.4;
    word-break: break-word;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0.2rem;
    margin-top: -0.2rem;
    margin-right: -0.2rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--trans-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

/* Toast Variants */
.toast-success {
    border-left: 4px solid var(--color-success);
}
.toast-success .toast-icon {
    color: var(--color-success);
}

.toast-error {
    border-left: 4px solid var(--color-error);
}
.toast-error .toast-icon {
    color: var(--color-error);
}

.toast-warning {
    border-left: 4px solid var(--color-warning);
}
.toast-warning .toast-icon {
    color: var(--color-warning);
}

.toast-info {
    border-left: 4px solid var(--color-info);
}
.toast-info .toast-icon {
    color: var(--color-info);
}

/* Auto-dismiss progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2.5px;
    background-color: var(--color-primary-500);
    width: 100%;
    animation: toastProgress linear forwards;
}

.toast-success .toast-progress { background-color: var(--color-success); }
.toast-error .toast-progress { background-color: var(--color-error); }
.toast-warning .toast-progress { background-color: var(--color-warning); }
.toast-info .toast-progress { background-color: var(--color-info); }

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

@media (max-width: 640px) {
    .toast-container {
        top: 0.75rem;
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
    }
}
