/* Snackbar Notification System - Material Design Style */

.snackbar {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 320px;
    max-width: 600px;
    background: #323232;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.snackbar.show {
    bottom: 32px;
    opacity: 1;
}

.snackbar.success {
    background: linear-gradient(135deg, #43A047, #2E7D32);
    border-left: 4px solid #66BB6A;
}

.snackbar.error {
    background: linear-gradient(135deg, #E53935, #C62828);
    border-left: 4px solid #EF5350;
}

.snackbar.info {
    background: linear-gradient(135deg, #1E88E5, #1565C0);
    border-left: 4px solid #42A5F5;
}

.snackbar-icon {
    font-size: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
}

.snackbar-content {
    flex: 1;
}

.snackbar-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.snackbar-message {
    font-weight: 400;
    opacity: 0.95;
    font-size: 14px;
}

.snackbar-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    margin: -8px -8px -8px 0;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.snackbar-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

/* Animazione di entrata */
@keyframes slideInUp {
    from {
        bottom: -100px;
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        bottom: 32px;
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Animazione di uscita */
@keyframes slideOutDown {
    from {
        bottom: 32px;
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        bottom: -100px;
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

.snackbar.show {
    animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.snackbar.hide {
    animation: slideOutDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .snackbar {
        min-width: calc(100% - 32px);
        max-width: calc(100% - 32px);
        left: 16px;
        right: 16px;
        transform: none;
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .snackbar.show {
        bottom: 24px;
        transform: none;
    }
    
    .snackbar-icon {
        font-size: 20px;
        width: 28px;
        height: 28px;
    }
    
    .snackbar-title {
        font-size: 15px;
    }
    
    .snackbar-message {
        font-size: 13px;
    }
    
    @keyframes slideInUp {
        from {
            bottom: -100px;
            opacity: 0;
        }
        to {
            bottom: 24px;
            opacity: 1;
        }
    }
    
    @keyframes slideOutDown {
        from {
            bottom: 24px;
            opacity: 1;
        }
        to {
            bottom: -100px;
            opacity: 0;
        }
    }
}

/* Progress bar per auto-dismiss */
.snackbar-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 8px 8px;
    animation: progressBar 5s linear forwards;
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}
