﻿/* Overlay semitrasparente dietro l'alert */
#alertOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.35);
    display: none;
    z-index: 1000;
}

/* Contenitore dell'alert */
#alertContainer {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    transform: translateY(-120%);
    transition: transform 0.5s ease, opacity 0.5s ease;
    opacity: 0;
    display: none;
    z-index: 1001;
    padding: 20px 30px;
    border: 2px solid transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
    height: auto;
    line-height: 1.5;
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    box-sizing: border-box;
}

    /* Quando l'alert diventa visibile */
    #alertContainer.show {
        display: flex;
        transform: translateY(0);
        opacity: 1;
    }

/* Messaggio */
#alertMessage {
    flex-grow: 1;
    text-align: center;
    word-wrap: break-word;
    padding-right: 60px;
    white-space: pre-line !important; /* <-- rende i \n visibili come a capo */
    overflow-wrap: break-word; /* o word-wrap: break-word; se preferisci */
}


/* Pulsante di chiusura (X) con colore uniforme, più grande */
#alertClose {
    /* niente posizione assoluta: lo flex-box lo centrerà da solo */
    position: static;
    /* lo spinge a destra del container */
    margin-left: auto;
    /* geometria del cerchio */
    width: 35px;
    height: 35px;
    border-radius: 50%;
    /* centriamo il glifo ❌ */
    display: flex;
    align-items: center;
    justify-content: center;
    /* stile testo */
    font-size: 35px; /* dimensione X */
    line-height: 1; /* evita spazio extra */
    padding: 0; /* niente padding = niente offset */
    border: none;
    cursor: pointer;
    color: #fff;
    background: currentColor; /* i colori li definisci per variante */
    /*  !!! diventa riferimento per il countdown  */
    position: relative;


    /*position: absolute;
    right: 15px;
    top: 50%;    
    transform: translateY(-50%);
    border: none;
    font-weight: bold;
    font-size: 35px; 
    color: white;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;*/
}

/* Mini-countdown “esponente” */
#alertCountdown {
    position: absolute;
    top: -10px; /* sposta un po’ sopra il bordo del cerchio */
    right: -10px; /* sposta un po’ a destra del cerchio       */
    font-size: 11px;
    font-weight: bold;
    font-style:italic;
    opacity: 0.9;
    pointer-events: none;
}

/* Colori per i vari tipi di alert */
.alert-info {
    background-color: #d9edf7;
    color: #31708f;
    border-color: #bcdff1;
}

    .alert-info #alertClose {
        background: #31708f;
    }

.alert-success {
    background-color: #dff0d8;
    color: #3c763d;
    border-color: #b2de9f;
}

    .alert-success #alertClose {
        background: #3c763d;
    }

.alert-warning {
    background-color: #fcf8e3;
    color: #8a6d3b;
    border-color: #f2e3af;
}

    .alert-warning #alertClose {
        background: #8a6d3b;
    }

.alert-danger {
    background-color: #f2dede;
    color: #a94442;
    border-color: #e2bdbd;
}

    .alert-danger #alertClose {
        background: #a94442;
    }
