/* Modern Toast Notification System */

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

/* Mobile adjustments */
@media (max-width: 576px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: 100%;
    }
}

/* Toast Notification */
.toast-notification {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    min-width: 300px;
    max-width: 100%;
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: toastSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transition: all 0.3s ease;
    border-left: 4px solid;
    overflow: hidden;
}

.toast-notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: inherit;
}

/* Toast Types */
.toast-notification.success {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #ffffff 0%, #f8fff9 100%);
}

.toast-notification.error {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #ffffff 0%, #fff8f8 100%);
}

.toast-notification.warning {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, #ffffff 0%, #fffef8 100%);
}

.toast-notification.info {
    border-left-color: #17a2b8;
    background: linear-gradient(135deg, #ffffff 0%, #f8fcff 100%);
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    margin-top: 2px;
}

.toast-notification.success .toast-icon {
    background: #28a745;
}

.toast-notification.error .toast-icon {
    background: #dc3545;
}

.toast-notification.warning .toast-icon {
    background: #ffc107;
    color: #000;
}

.toast-notification.info .toast-icon {
    background: #17a2b8;
}

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

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

.toast-message {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Toast Close Button */
.toast-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #6c757d;
    font-size: 18px;
    line-height: 1;
    opacity: 0.6;
    transition: all 0.2s ease;
    margin-top: -2px;
    margin-right: -4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.toast-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
    color: #212529;
}

.toast-close:active {
    transform: scale(0.95);
}

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

.toast-progress-bar {
    height: 100%;
    background: currentColor;
    width: 100%;
    animation: toastProgress linear;
    transform-origin: left;
}

.toast-notification.success .toast-progress-bar {
    background: #28a745;
}

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

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

.toast-notification.info .toast-progress-bar {
    background: #17a2b8;
}

/* Animations */
@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

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

/* Toast Exit Animation */
.toast-notification.exiting {
    animation: toastSlideOut 0.3s ease forwards;
}

/* Mobile Optimizations */
@media (max-width: 576px) {
    .toast-notification {
        min-width: auto;
        padding: 14px 16px;
    }
    
    .toast-title {
        font-size: 14px;
    }
    
    .toast-message {
        font-size: 13px;
    }
    
    @keyframes toastSlideIn {
        from {
            transform: translateY(-100px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    @keyframes toastSlideOut {
        from {
            transform: translateY(0);
            opacity: 1;
        }
        to {
            transform: translateY(-100px);
            opacity: 0;
        }
    }
}

/* Toast Hover Effect */
.toast-notification:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

/* Toast Stacking */
.toast-container .toast-notification:nth-child(n+4) {
    opacity: 0.95;
    transform: scale(0.98);
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .toast-notification {
        background: #2d2d2d;
        color: #ffffff;
    }
    
    .toast-title {
        color: #ffffff;
    }
    
    .toast-message {
        color: #b0b0b0;
    }
    
    .toast-close {
        color: #b0b0b0;
    }
    
    .toast-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }
}

