/**
 * AccountFlow Toast Notification System
 * Shared toast styles for all pages
 */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 400px;
}

/* Toast Base Styles */
.toast {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 300px;
    max-width: 400px;
    pointer-events: all;
    position: relative;
    overflow: hidden;
    animation: toastSlideIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid transparent;
}

.toast.toast-exit {
    animation: toastSlideOut 0.3s ease forwards;
}

/* Toast Types */
.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.warning {
    border-left-color: #f59e0b;
}

.toast.info {
    border-left-color: #3b82f6;
}

/* Toast Icon */
.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
}

.toast.success .toast-icon {
    background: #d1fae5;
    color: #059669;
}

.toast.error .toast-icon {
    background: #fee2e2;
    color: #dc2626;
}

.toast.warning .toast-icon {
    background: #fef3c7;
    color: #d97706;
}

.toast.info .toast-icon {
    background: #dbeafe;
    color: #2563eb;
}

/* Toast Content */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.toast-message {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Toast Close Button */
.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    margin: -4px -4px -4px 0;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #4b5563;
}

.toast-close:focus {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}

/* Progress Bar (optional auto-dismiss indicator) */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    width: 100%;
}

.toast-progress::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    background: currentColor;
    opacity: 0.3;
    animation: toastProgress 5s linear forwards;
}

.toast.success .toast-progress::after { background: #10b981; }
.toast.error .toast-progress::after { background: #ef4444; }
.toast.warning .toast-progress::after { background: #f59e0b; }
.toast.info .toast-progress::after { background: #3b82f6; }

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

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

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

/* Mobile Responsive */
@media (max-width: 640px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .toast,
    .toast.toast-exit {
        animation: none;
    }
    
    .toast-progress::after {
        animation: none;
        width: 0;
    }
}
