﻿.toast-container {
    position: fixed !important;
    z-index: 999999 !important;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: auto !important;
    max-width: 100% !important;
}

/* Posizioni */
.toast-top-right {
    top: 20px !important;
    right: 20px !important;
}

.toast-top-left {
    top: 20px !important;
    left: 20px !important;
}

.toast-bottom-right {
    bottom: 20px !important;
    right: 20px !important;
    flex-direction: column-reverse;
}

.toast-bottom-left {
    bottom: 20px !important;
    left: 20px !important;
    flex-direction: column-reverse;
}

.toast-top-center {
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

.toast-bottom-center {
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    flex-direction: column-reverse;
}

.toast-box {
    position: relative !important;
    min-width: 300px;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: auto;
}

.toast-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.toast-message {
    flex-grow: 1;
    padding-right: 8px;
}

.toast-close {
    background: transparent !important;
    border: none !important;
    color: inherit !important;
    font-size: 24px !important;
    line-height: 1 !important;
    padding: 0 !important;
    cursor: pointer !important;
    opacity: 0.7 !important;
    transition: opacity 0.2s !important;
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: -5px -5px 0 0 !important;
}

    .toast-close:hover {
        opacity: 1 !important;
    }

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.3);
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    background: white;
    width: 100%;
    animation: countdown linear forwards;
}

/* Animazioni per le diverse posizioni */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes countdown {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* Applicazione delle animazioni */
.toast-top-right .toast-box {
    animation: slideInRight 0.3s ease-out;
}

.toast-top-left .toast-box {
    animation: slideInLeft 0.3s ease-out;
}

.toast-bottom-right .toast-box {
    animation: slideInUp 0.3s ease-out;
}

.toast-bottom-left .toast-box {
    animation: slideInUp 0.3s ease-out;
}

.toast-top-center .toast-box {
    animation: slideInDown 0.3s ease-out;
}

.toast-bottom-center .toast-box {
    animation: slideInUp 0.3s ease-out;
}

/* Colori dei toast */
.toast-info {
    background-color: #3498db !important;
    color: white !important;
}

.toast-success {
    background-color: #2ecc71 !important;
    color: white !important;
}

.toast-warning {
    background-color: #f1c40f !important;
    color: black !important;
}

.toast-error {
    background-color: #e74c3c !important;
    color: white !important;
}
