/**
 * Modern Toast Notification System
 * Lightweight, elegant, and responsive
 */

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 120px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

/* Individual Toast */
.toast {
    position: relative;
    min-width: 300px;
    max-width: 400px;
    padding: 16px 20px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    color: #ffffff;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    pointer-events: auto;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

/* Toast Animation - Slide In */
.toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* Toast Animation - Slide Out */
.toast.hide {
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease-in;
}

/* Toast Content */
.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.toast-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}

.toast-message {
    font-size: 15px;
    line-height: 1.5;
    opacity: 0.9;
    margin: 0;
}

/* Close Button */
.toast-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    font-size: 18px;
    line-height: 1;
}

.toast-close:hover {
    color: #ffffff;
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 12px 12px;
    transform-origin: left;
    animation: toast-progress 3s linear forwards;
}

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

/* Toast Types */

/* Success Toast */
.toast.success {
    background: rgba(16, 185, 129, 0.95);
    border-left: 4px solid #10b981;
    color: #ffffff;
}

.toast.success .toast-title,
.toast.success .toast-message {
    color: #ffffff;
}

.toast.success .toast-progress {
    background: rgba(255, 255, 255, 0.4);
}

/* Error Toast */
.toast.error {
    background: rgba(220, 38, 38, 0.95);
    border-left: 4px solid #dc2626;
    color: #ffffff;
}

.toast.error .toast-close {
    color: rgba(255, 255, 255, 0.9);
}

.toast.error .toast-close:hover {
    color: #ffffff;
}

.toast.error .toast-title,
.toast.error .toast-message {
    color: #ffffff;
    opacity: 1;
}

.toast.error .toast-progress {
    background: rgba(255, 255, 255, 0.4);
}

/* Warning Toast */
.toast.warning {
    background: rgba(245, 158, 11, 0.95);
    border-left: 4px solid #f59e0b;
    color: #ffffff;
}

.toast.warning .toast-title,
.toast.warning .toast-message {
    color: #ffffff;
}

.toast.warning .toast-progress {
    background: rgba(255, 255, 255, 0.4);
}

/* Info Toast */
.toast.info {
    background: rgba(59, 130, 246, 0.95);
    border-left: 4px solid #3b82f6;
    color: #ffffff;
}

.toast.info .toast-title,
.toast.info .toast-message {
    color: #ffffff;
}

.toast.info .toast-progress {
    background: rgba(255, 255, 255, 0.4);
}

/* Default Toast (dark) */
.toast.default {
    background: rgba(17, 24, 39, 0.95);
    border-left: 4px solid #6b7280;
}

/* Responsive Design */
@media (max-width: 640px) {
    .toast-container {
        bottom: 120px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
        transform: translateX(400px);
    }
    
    .toast.show {
        transform: translateX(0);
    }
    
    .toast.hide {
        transform: translateX(400px);
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .toast {
        transition: opacity 0.2s ease;
        transform: none;
    }
    
    .toast.show {
        opacity: 1;
    }
    
    .toast.hide {
        opacity: 0;
    }
    
    .toast-progress {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .toast {
        border: 2px solid currentColor;
    }
}
