/* Floating Toast Notifications System */

/* Toast Container - Fixed position at top of screen */
.toast-container {
    position: fixed;
    top: 80px; /* Below navbar */
    right: 20px;
    z-index: 10000; /* Above all other elements */
    pointer-events: none; /* Allow clicks to pass through container */
}

/* Individual Toast Styles */
.toast-notification {
    position: relative;
    min-width: 350px;
    max-width: 500px;
    margin-bottom: 15px;
    padding: 16px 20px;
    background: rgba(33, 37, 41, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 
                0 4px 12px rgba(0, 0, 0, 0.3),
                0 0 40px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: all; /* Re-enable clicks for toasts */
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    gap: 12px;
}

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

/* Toast Animation - Slide out */
.toast-notification.hiding {
    opacity: 0;
    transform: translateX(120%);
    transition: all 0.3s ease-out;
}

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

/* Toast Content */
.toast-content {
    flex: 1;
    color: #f8f9fa;
    font-size: 14px;
    line-height: 1.5;
}

/* Toast Close Button */
.toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    line-height: 1;
    padding: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}

/* Success Toast */
.toast-notification.toast-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95) 0%, rgba(5, 150, 105, 0.95) 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

.toast-notification.toast-success .toast-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Error/Danger Toast */
.toast-notification.toast-danger,
.toast-notification.toast-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(185, 28, 28, 0.95) 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.toast-notification.toast-danger .toast-icon,
.toast-notification.toast-error .toast-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Warning Toast */
.toast-notification.toast-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.95) 0%, rgba(217, 119, 6, 0.95) 100%);
    border-color: rgba(245, 158, 11, 0.3);
}

.toast-notification.toast-warning .toast-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Info Toast */
.toast-notification.toast-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95) 0%, rgba(37, 99, 235, 0.95) 100%);
    border-color: rgba(59, 130, 246, 0.3);
}

.toast-notification.toast-info .toast-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Progress Bar for Auto-dismiss */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 12px 12px;
    transition: width linear;
}

/* Stacking Animation */
@keyframes stackDown {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(10px);
    }
}

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

/* Dark Mode Enhancement */
@media (prefers-color-scheme: dark) {
    .toast-notification {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 
                    0 4px 16px rgba(0, 0, 0, 0.4),
                    0 0 48px rgba(0, 0, 0, 0.3);
    }
}

/* Hover Effects */
.toast-notification:hover {
    transform: translateX(0) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 
                0 6px 16px rgba(0, 0, 0, 0.4),
                0 0 48px rgba(0, 0, 0, 0.3);
}

/* Multiple Toast Stacking */
.toast-container .toast-notification:not(:last-child) {
    margin-bottom: 12px;
}

/* Entrance Animation Delay for Multiple Toasts */
.toast-notification:nth-child(2) {
    animation-delay: 0.1s;
}

.toast-notification:nth-child(3) {
    animation-delay: 0.2s;
}

.toast-notification:nth-child(4) {
    animation-delay: 0.3s;
}

/* Max number of visible toasts */
.toast-container .toast-notification:nth-child(n+6) {
    display: none;
}