
.success {
    background-color: #2ecc71;
}

.error {
    background-color: #e74c3c;
}

.warning {
    background-color: #f1c40f;
    color: black;
}

.info {
    background-color: #3498db;
}


#toast-container {
    position: fixed;
    top: 70px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    z-index: 1000; /* To ensure toasts appear above other elements */
}


.toast {
    background-color: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    color: black;
    opacity: 1;
    transition: all 0.3s ease;
    min-width: 300px; /* Set minimum width */
    position: relative; /* Needed for the progress bar */
}

    .toast.success {
        border-left: 5px solid #2ecc71;
        border-right: 5px solid #2ecc71;
    }

    .toast.error {
        border-left: 5px solid #e74c3c;
        border-right: 5px solid #e74c3c;
    }

    .toast.warning {
        border-left: 5px solid #f1c40f;
        border-right: 5px solid #f1c40f;
    }

    .toast.info {
        border-left: 5px solid #3498db;
        border-right: 5px solid #3498db;
    }


    .toast i {
        margin-right: 10px;
        font-size: 1.5em;
    }

    .toast .message {
        flex-grow: 1;
    }

    .toast .close-btn {
        cursor: pointer;
        font-size: 1.2em;
        margin-left: 10px;
    }

        .toast .close-btn:hover {
            font-weight: bold;
        }

    /* Progress Bar */
    .toast .progress-bar {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 3px;
        background-color: rgba(0, 0, 0, 0.2);
    }

    .toast .progress {
        height: 100%;
        width: 0%; /* Start at 0 width */
        background-color: #2ecc71; /* Success bar color */
        transition: width 0.3s linear;
    }

    .toast.error .progress {
        background-color: #e74c3c;
    }

    .toast.warning .progress {
        background-color: #f1c40f;
    }

    .toast.info .progress {
        background-color: #3498db;
    }


    .toast.hide {
        opacity: 0;
        margin-right: -100px; /* Move it offscreen */
    }

@media (max-width: 600px) {
    #toast-container {
        right: 10px;
        left: 10px;
        align-items: center;
        width: 90%;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}
