#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
    /* Allow clicking through the container area */
}

.toast {
    position: relative;
    width: 500px;
    /* background-color handled by JS */
    border-radius: 4px;
    box-shadow: var(--toast-shadow);
    display: flex;
    align-items: center;
    padding: 15px 20px 15px 0;
    /* Left padding is handled by sidebar */
    pointer-events: auto;
    /* Re-enable pointer events for the toast itself */
    overflow: hidden;
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: right center;
}

.toast-sidebar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    /* background-color handled by JS */
}

.toast-icon {
    margin-left: 20px;
    margin-right: 15px;
    /* color handled by JS */
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-content {
    flex-grow: 1;
    font-family: 'Jost', sans-serif;
    color: var(--toast-message);
}

.toast-title {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 4px;
    line-height: 1.2;
}

.toast-message {
    font-weight: 400;
    font-size: 16px;
    line-height: 1.4;
    color: var(--toast-message);
    word-break: break-word;
    /* Ensure long words/strings break */
}

.toast-close {
    cursor: pointer;
    color: var(--toast-message);
    font-size: 18px;
    padding: 5px;
    margin-left: 10px;
    opacity: 0.7;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* Toast Types */
.toast-error {
    background-color: var(--toast-error-bg);
}

.toast-error .toast-sidebar {
    background-color: var(--toast-error);
}

.toast-error .toast-icon {
    color: var(--toast-error);
}

.toast-success {
    background-color: var(--toast-success-bg);
}

.toast-success .toast-sidebar {
    background-color: var(--toast-success);
}

.toast-success .toast-icon {
    color: var(--toast-success);
}

.toast-info {
    background-color: var(--toast-info-bg);
}

.toast-info .toast-sidebar {
    background-color: var(--toast-info);
}

.toast-info .toast-icon {
    color: var(--toast-info);
}

.toast-warning {
    background-color: var(--toast-warning-bg);
}

.toast-warning .toast-sidebar {
    background-color: var(--toast-warning);
}

.toast-warning .toast-icon {
    color: var(--toast-warning);
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    #toast-container {
        left: 20px;
        /* Center on small screens */
        right: 20px;
        bottom: 20px;
    }

    .toast {
        width: 100%;
    }
}