﻿
:root {
    --toast-dark: #34495E;
    --toast-light: #ffffff;
    --toast-success: #0ABF30;
    --toast-error: #E24D4C;
    --toast-warning: #E9BD0C;
    --toast-info: #3498DB;
}

/* 2. Đổi tên tất cả các class bằng cách thêm tiền tố "custom-toast-" */
.custom-toast-container {
    position: fixed;
    top: 30px;
    right: 20px;
    z-index: 9999; /* Đảm bảo toast luôn nổi lên trên */
    list-style: none;
    padding: 0;
    margin: 0;
}

.custom-toast {
    background: var(--toast-light);
    width: 100%;
    max-width: 400px;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem; /* 8px */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    position: relative; /* Cần cho thanh progress */
    transform: translateX(calc(100% + 20px));
    animation: toast-slideIn 0.5s forwards;
    gap: 1rem;
}

    .custom-toast.hide {
        animation: toast-slideOut 0.5s forwards;
    }

/* 3. Đổi tên các animation */
@keyframes toast-slideIn {
    to {
        transform: translateX(0);
    }
}

@keyframes toast-slideOut {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(calc(100% + 20px));
    }
}

.custom-toast__column {
    display: flex;
    align-items: center;
    gap: 15px;
}

.custom-toast__icon {
    font-size: 1.75rem;
    line-height: 1;
}

.custom-toast__text .title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.custom-toast__text .message {
    font-size: 0.95rem;
    color: #666;
    margin: 0;
}

.custom-toast__close-btn {
    cursor: pointer;
    font-size: 1.2rem;
    color: #999;
    transition: color 0.2s;
    line-height: 1;
}

    .custom-toast__close-btn:hover {
        color: var(--toast-dark);
    }

.custom-toast__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
}

@keyframes toast-progress {
    to {
        width: 0%;
    }
}

/* Áp dụng màu sắc dựa trên modifier class */
.custom-toast--success .custom-toast__progress {
    background-color: var(--toast-success);
}

.custom-toast--success .custom-toast__icon {
    color: var(--toast-success);
}

.custom-toast--error .custom-toast__progress {
    background-color: var(--toast-error);
}

.custom-toast--error .custom-toast__icon {
    color: var(--toast-error);
}

.custom-toast--warning .custom-toast__progress {
    background-color: var(--toast-warning);
}

.custom-toast--warning .custom-toast__icon {
    color: var(--toast-warning);
}

.custom-toast--info .custom-toast__progress {
    background-color: var(--toast-info);
}

.custom-toast--info .custom-toast__icon {
    color: var(--toast-info);
}
