/* Toast Notifications Styles */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}

/* Base Toast Styles */
.toast {
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.06);
    margin-bottom: 1rem;
    max-width: 400px;
    min-width: 300px;
    overflow: hidden;
    pointer-events: all;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
}

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

.toast.hide {
    transform: translateX(400px);
    opacity: 0;
}

/* Toast Header */
.toast-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.toast-header strong {
    flex: 1;
    margin-right: auto;
    font-weight: 600;
    font-size: 0.875rem;
}

.toast-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    margin-left: 0.5rem;
    opacity: 0.7;
    padding: 0;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

/* Toast Body */
.toast-body {
    padding: 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Toast Types */
.toast.success .toast-header {
    background: linear-gradient(135deg, #dcfce7 0%, #d1fae5 100%);
    color: #065f46;
    border-bottom-color: #a7f3d0;
}

.toast.success .toast-body {
    color: #047857;
}

.toast.error .toast-header {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #7f1d1d;
    border-bottom-color: #fca5a5;
}

.toast.error .toast-body {
    color: #b91c1c;
}

.toast.warning .toast-header {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #78350f;
    border-bottom-color: #fcd34d;
}

.toast.warning .toast-body {
    color: #92400e;
}

.toast.info .toast-header {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e3a8a;
    border-bottom-color: #93c5fd;
}

.toast.info .toast-body {
    color: #1e40af;
}

/* Icons */
.toast-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

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

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

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

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

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation: progress 5s linear forwards;
}

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

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

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

.toast.info .toast-progress-bar {
    background: #2563eb;
}

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

/* Animation for multiple toasts */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .toast-container {
        top: 80px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        max-width: calc(100vw - 20px);
        min-width: auto;
        width: 100%;
    }
}

/* Dark Mode Support (if needed) */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #1f2937;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 4px 10px rgba(0, 0, 0, 0.2);
    }
    
    .toast-close {
        color: #9ca3af;
    }
    
    .toast.success .toast-header {
        background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
        color: #d1fae5;
        border-bottom-color: #047857;
    }
    
    .toast.success .toast-body {
        color: #a7f3d0;
    }
    
    .toast.error .toast-header {
        background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
        color: #fecaca;
        border-bottom-color: #b91c1c;
    }
    
    .toast.error .toast-body {
        color: #fca5a5;
    }
    
    .toast.warning .toast-header {
        background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
        color: #fde68a;
        border-bottom-color: #b45309;
    }
    
    .toast.warning .toast-body {
        color: #fcd34d;
    }
    
    .toast.info .toast-header {
        background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
        color: #bfdbfe;
        border-bottom-color: #2563eb;
    }
    
    .toast.info .toast-body {
        color: #93c5fd;
    }
}

/* Stacking Animation */
.toast-container .toast:not(:last-child) {
    margin-bottom: 0.75rem;
}

.toast-container .toast:nth-child(n+4) {
    opacity: 0;
    pointer-events: none;
}

/* Accessibility */
.toast:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.toast-close:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* Print Styles */
@media print {
    .toast-container {
        display: none;
    }
}