﻿/* Stile base per tutti i messaggi */
.custom-alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    color: #fff;
    font-size: 0.95rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    animation: fadeIn 0.3s ease;
}

    /* Tipi di messaggio */
    .custom-alert.info,
    .custom-alert.message {
        background: linear-gradient(135deg, #5dade2, #85c1e9); /* azzurro */
    }

    .custom-alert.confirm {
        background: linear-gradient(135deg, #27ae60, #58d68d); /* verde */
    }

    .custom-alert.warning {
        background: linear-gradient(135deg, #f39c12, #f7b731); /* arancio */
        color: #2c3e50;
    }

    .custom-alert.alert {
        background: linear-gradient(135deg, #d35400, #e67e22); /* arancio scuro */
    }

    .custom-alert.error {
        background: linear-gradient(135deg, #c0392b, #e74c3c); /* rosso */
    }

    /* Bottoni dentro il messaggio */
    .custom-alert .btn-group {
        margin-top: 0.75rem;
    }

    .custom-alert button {
        margin-left: 0.4rem;
        margin-right: 0.5rem;
        padding: 0.4rem 0.8rem;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-weight: 600;
    }

    .custom-alert.confirm button {
        margin-left: 0.4rem;
        background-color: #fff;
        color: #27ae60;
    }

    .custom-alert.alert button,
    .custom-alert.error button {
        margin-left: 0.4rem;
        background-color: #fff;
        color: #c0392b;
    }

/* Animazione di comparsa */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.custom-alert {
    position: fixed;
    top: 20px; /* altezza fissa */
    right: 20px; /* parte da destra */
    z-index: 9999;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    color: #fff;
    font-size: 0.95rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    min-width: 220px;
    animation: slideToCenter 0.6s ease forwards; /* nuova animazione */
}

/* Animazione: da destra al centro */
@keyframes slideToCenter {
    from {
        right: 20px; /* posizione iniziale */
        transform: translateX(0);
    }

    to {
        right: 50%; /* si sposta al centro */
        transform: translateX(50%); /* corregge per la larghezza */
    }
}