/**
 * Toast Notification Styles
 * Reusable toast notifications for success, error, and info messages
 */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    width: auto;
    max-width: 90vw;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none; /* ensure container doesn't capture pointer events or affect layout */
}

.toast {
    display: flex;
    align-items: center;
    background: white;
    color: #333;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px;
    margin-bottom: 12px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    pointer-events: auto; /* allow interaction with the toast itself */
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-icon {
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-message {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.toast-details {
    margin: 4px 0 0;
    font-size: 12px;
    color: #666;
    opacity: 0.9;
}

.toast-close {
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    flex-shrink: 0;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #333;
}

/* Toast types */
.toast.success {
    border-left-color: #4CAF50;
}

.toast.success .toast-icon {
    color: #4CAF50;
}

.toast.error {
    border-left-color: #F44336;
}

.toast.error .toast-icon {
    color: #F44336;
}

.toast.warning {
    border-left-color: #FF9800;
}

.toast.warning .toast-icon {
    color: #FF9800;
}

.toast.info {
    border-left-color: #2196F3;
}

.toast.info .toast-icon {
    color: #2196F3;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .toast-container {
        width: calc(100% - 40px);
        /* center the container on small screens to avoid layout shifts */
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        align-items: center;
    }

    .toast {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .toast-icon {
        margin-right: 0;
    }

    .toast-content {
        width: 100%;
    }

    .toast-close {
        position: absolute;
        top: 8px;
        right: 8px;
    }
}