/* Toast Notification Styles */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: 400px;
}

.toast {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transform: translateX(100%) scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    position: relative;
    max-width: 100%;
}

.toast.visible {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.toast.removing {
    transform: translateX(100%) scale(0.95);
    opacity: 0;
}

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

/* Toast types */
.toast-success {
    border-left: 4px solid #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast-loading {
    border-left: 4px solid #6b7280;
}

/* Toast content */
.toast-content {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    gap: 0.75rem;
}

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

.toast-success .toast-icon {
    color: #10b981;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

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

.toast-loading .toast-icon {
    color: #6b7280;
}

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #1f2937;
    font-weight: 500;
    margin-top: 0.125rem;
}

/* Action button */
.toast-action-btn {
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.toast-action-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.toast-success .toast-action-btn {
    border-color: #10b981;
    color: #10b981;
}

.toast-success .toast-action-btn:hover {
    background: #ecfdf5;
}

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

.toast-error .toast-action-btn:hover {
    background: #fef2f2;
}

/* Close button */
.toast-close-btn {
    background: transparent;
    border: none;
    padding: 0.25rem;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: all 0.15s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close-btn:hover {
    color: #6b7280;
    background: #f3f4f6;
}

/* Progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.05);
}

.toast-progress-bar {
    height: 100%;
    width: 0;
    background: currentColor;
    opacity: 0.6;
    transition: width 0.1s ease;
}

.toast-progress-bar.animate {
    animation: toast-progress linear;
    animation-fill-mode: forwards;
}

.toast-success .toast-progress-bar {
    background: #10b981;
}

.toast-error .toast-progress-bar {
    background: #ef4444;
}

.toast-warning .toast-progress-bar {
    background: #f59e0b;
}

.toast-info .toast-progress-bar {
    background: #3b82f6;
}

/* Loading spinner animation */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes toast-progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Dark theme support */
.dark-theme .toast {
    background: #1f2937;
    border-color: #374151;
}

.dark-theme .toast-message {
    color: #f9fafb;
}

.dark-theme .toast-close-btn {
    color: #9ca3af;
}

.dark-theme .toast-close-btn:hover {
    color: #d1d5db;
    background: #374151;
}

.dark-theme .toast-action-btn {
    border-color: #4b5563;
    color: #d1d5db;
}

.dark-theme .toast-action-btn:hover {
    background: #374151;
    border-color: #6b7280;
}

/* Responsive design */
@media (max-width: 768px) {
    .toast-container {
        left: 1rem;
        right: 1rem;
        top: 1rem;
        max-width: none;
    }
    
    .toast {
        transform: translateY(-100%) scale(0.95);
    }
    
    .toast.visible {
        transform: translateY(0) scale(1);
    }
    
    .toast.removing {
        transform: translateY(-100%) scale(0.95);
    }
    
    .toast-content {
        padding: 0.875rem;
    }
    
    .toast-message {
        font-size: 0.8rem;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .toast {
        border-width: 2px;
    }
    
    .toast-success {
        border-left-width: 6px;
    }
    
    .toast-error {
        border-left-width: 6px;
    }
    
    .toast-warning {
        border-left-width: 6px;
    }
    
    .toast-info {
        border-left-width: 6px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .toast {
        transition: opacity 0.2s ease;
        transform: none;
    }
    
    .toast.visible {
        transform: none;
    }
    
    .toast.removing {
        transform: none;
    }
    
    .animate-spin {
        animation: none;
    }
}

/* Focus indicators for accessibility */
.toast-action-btn:focus-visible,
.toast-close-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}