/* BOTONES DEMO (puedes quitarlos si no los usas) */
.toast-buttons {
    max-width: 700px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 2em auto;
}

.toast-row {
    display: flex;
    justify-content: center;
    margin: 1em 0;
    padding: 1rem;
    flex-wrap: wrap;
}

button.custom-toast {
    padding: 0.5rem 1rem;
    border: none;
    color: #fff;
    font-weight: 500;
    border-radius: 5px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    width: 150px;
    margin: 0.5em;
    transition: 0.2s ease-in-out;
    font-size: 1rem;
    background: #3498db;
}

button.custom-toast:hover {
    filter: brightness(0.9);
}

button.success-toast { background-color: #2ecc71; }
button.danger-toast { background-color: #e74c3c; }
button.info-toast { background-color: #3498db; }
button.warning-toast { background-color: #f1c40f; }


/* ========================= */
/* TOAST NOTIFICATION */
/* ========================= */

.toast {
    position: fixed;
    top: 25px;
    left: 50%;
    transform: translate(-50%, -150%);
    
    max-width: 350px;
    width: max-content;

    background: #fff;
    padding: 0.75rem;
    border-radius: 6px;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.25);
    
    z-index: 9999;

    animation: 
        slideInTop 0.4s ease forwards,
        slideOutTop 0.4s ease forwards 3s;
}

/* CIERRE MANUAL */
.toast.closing {
    animation: slideOutTop 0.4s ease forwards;
}

/* CONTENIDO */
.toast-content-wrapper {
    display: flex;
    align-items: center;
}

.toast-icon {
    width: 24px;
    height: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-right: 10px;
    color: #111;
    line-height: 1;
}

.toast-message {
    font-size: 0.9rem;
    color: #000;
}

/* BARRA DE PROGRESO */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background: #ccc;
    animation: toastProgress 3s linear forwards;
}

/* ========================= */
/* TIPOS DE TOAST */
/* ========================= */

.toast.toast-success {
    background: #e6f9ef;
}

.toast.toast-success .toast-progress {
    background: #2ecc71;
}

.toast.toast-danger {
    background: #fdecea;
}

.toast.toast-danger .toast-progress {
    background: #e74c3c;
}

.toast.toast-info {
    background: #eaf4fb;
}

.toast.toast-info .toast-progress {
    background: #3498db;
}

.toast.toast-warning {
    background: #fff8e5;
}

.toast.toast-warning .toast-progress {
    background: #f1c40f;
}


/* ========================= */
/* ANIMACIONES */
/* ========================= */

@keyframes slideInTop {
    0% {
        transform: translate(-50%, -150%);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes slideOutTop {
    0% {
        transform: translate(-50%, 0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -150%);
        opacity: 0;
    }
}

@keyframes toastProgress {
    0% {
        width: 100%;
    }
    100% {
        width: 0%;
    }
}